tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [FreeBSD support] __aligned(n) + __pure issues


From: Christian JULLIEN
Subject: Re: [Tinycc-devel] [FreeBSD support] __aligned(n) + __pure issues
Date: Mon, 10 Oct 2016 13:19:00 +0200 (CEST)

The problem is perhaps different:
./tcc -B. -Iinclude -I. -run tests/tcctest.c
Compiles and works well. This one ic compiled with GCC

I get this issue only with:
../tcc -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -run tcctest.c > test.out3

If understand well, when tcc is compiled by itself.

It I add:
    tcc_define_symbol(s, "__aligned(n)", "__attribute__((aligned(n)))");                     
The issue is different, it compiles fine this time but I get:
------------ test3 ------------
../tcc -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I../include -I.. -I.. -run tcctest.c > test.out3
tcc: error: undefined symbol 'memmove'
tcc: error: undefined symbol 'memcpy'
tcc: error: undefined symbol 'strlen'
tcc: error: undefined symbol 'memset'
tcc: error: undefined symbol 'memcmp'
....

i.e. no stdlib function is found.


----- message d'origine -----
De : "grischka" <address@hidden>
date lun. 10/10/2016 12:35 (GMT +02:00)
À : "Christian JULLIEN" <address@hidden>, "address@hidden" <address@hidden>
Objet : Re: [Tinycc-devel] [FreeBSD support] __aligned(n) + __pure issues

Christian JULLIEN wrote:
> Thank you for your reply.
> This is of course something I tried.
> IMHO, because FreeBSD standard headers are known to use __aligned(x)
> and __pure, tcc should define them by default (at least for FreeFBSD)
> otherwise everybody will need to define those macros just to include
> standard header.
>
> Wdyt?

I'd think

1) try to find out why it works for gcc but doesn't for tcc

2) then you could for example put stuff into tcc's stddef.h
(assuming that the system headers will read it):

#ifdef __FreeBSD__
... whatever
#endif

Btw, please note that I don't (usually) commit other peoples'
patches the less ones that I can't test ;)

-- grischka

reply via email to

[Prev in Thread] Current Thread [Next in Thread]