tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] TCC fails to build on FreeBSD/amd64


From: Carlos Jacobo Puga Medina
Subject: Re: [Tinycc-devel] TCC fails to build on FreeBSD/amd64
Date: Wed, 05 Aug 2015 03:00:01 +0200

El vie, 24-07-2015 a las 01:50 +0200, Carlos Jacobo Puga Medina
escribió:
> El mié, 22-07-2015 a las 03:25 +0200, Carlos Jacobo Puga Medina
> escribió:
> > El mar, 21-07-2015 a las 18:47 +0200, Carlos Jacobo Puga Medina
> > escribió:
> > > El mar, 21-07-2015 a las 14:14 +0200, Carlos Jacobo Puga Medina
> > > escribió:
> > > > El mar, 21-07-2015 a las 08:34 +0100, Edmund Grimley Evans 
> > > > escribió:
> > > > > > ../tcc -B.. -c bcheck.c -o x86_64/bcheck.o -I..  -Wall -g 
> > > > > > -O0
> > > > > > -Wdeclaration-after-statement -Wno-deprecated-declarations 
> > > > > > -Wno
> > > > > > -strict
> > > > > > -aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused
> > > > > > -result 
> > > > > > -Wno
> > > > > > -uninitialized -fno-strict-aliasing -fPIC 
> > > > > > -DTCC_TARGET_X86_64
> > > > > > In file included from bcheck.c:21:
> > > > > > /usr/include/stdio.h:63: error: ';' expected (got 
> > > > > > "va_list")
> > > > > > Makefile:116: recipe for target 'x86_64/bcheck.o' failed
> > > > > > gmake[1]: *** [x86_64/bcheck.o] Error 1
> > > > > > gmake[1]: Leaving directory 
> > > > > > '/usr/home/cjpm/github/tinycc/lib'
> > > > > > Makefile:259: recipe for target 'libtcc1.a' failed
> > > > > > gmake: *** [libtcc1.a] Error 2
> > > > > > 
> > > > > > Any thoughts about how to handle this?
> > > > > 
> > > > > Take a look at the preprocessed source, bcheck.i, generated 
> > > > > by:
> > > > > 
> > > > > ../tcc -B.. -E bcheck.c -I..  -Wall -g -O0
> > > > > -Wdeclaration-after-statement -Wno-deprecated-declarations
> > > > > -Wno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
> > > > > -Wno-unused-result -Wno-uninitialized -fno-strict-aliasing 
> > > > > -fPIC
> > > > > -DTCC_TARGET_X86_64 -o bcheck.i
> > > > 
> > > > Yes, I checked it.
> > > > 
> > > > It builds fine on i386, but I'm not sure why it spits out this 
> > > > error 
> > > > on
> > > > amd64:
> > > > 
> > > > In file included from bcheck.c:22:
> > > > In file included from /usr/include/stdarg.h:6:
> > > > /usr/include/x86/stdarg.h:74: error: #error this file needs to 
> > > > be
> > > > ported to your compiler
> > > > 
> > > I tried on FreeBSD/i386 and it also fails to compile properly 
> > > with 
> > > the
> > > above error.
> > > 
> > > Note that last time that TCC worked like a charm was on FreeBSD
> > > -9.1/i386 release.
> > > 
> > Finally I compiled TCC on amd64
> > 
> > tcc version 0.9.26 (x86-64)
> > install: /usr/local/lib/tcc/
> > crt:
> >   /usr/lib
> > libraries:
> >   /usr/lib
> >   /lib
> >   /usr/local/lib
> > include:
> >   /usr/local/include
> >   /usr/include
> >   /usr/local/lib/tcc/include
> > elfinterp:
> >   /libexec/ld-elf.so.1
> > 
> > Trying to compile hello.c
> > % tcc -o hello hello.c
> > In file included from hello.c:1:
> > /usr/include/stdio.h:63: error: ';' expected (got "va_list")
> > 
> 
> hello.c
> =======
> extern int printf(char *, ...);
> int main(){
>       printf("hello, world!\n);
>       return 0;
> }
> =======
> 
> % tcc -run hello.c
> hello, world!
> 
> It seems that stdio.h is the culprit.

After a week, we are able to compile with TCC but it fails to link.
Patch is attached to this msg.

Here it is the proof:

% cat hello.c
#include <stdio.h>

int main(){
        printf("hello, world!\n");
        return 0;
}

% tcc -c hello.c
% tcc -o hello hello.o
% ./hello
Bus error (core dumped)
% cc -o hello hello.o
% ./hello
hello, world!

So we guess that linking is broken.
-- 
Carlos Jacobo Puga Medina <address@hidden>
PGP fingerprint = C60E 9497 5302 793B CC2D  BB89 A1F3 5D66 E6D0 5453

Attachment: tcc.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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