Date: Wed, 05 Aug 2015 00:22:33 +0200 From: Carlos Jacobo Puga Medina <cpm@fbsd.es> To: Jung-uk Kim <jkim@FreeBSD.org>, "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org> Subject: Re: lang/tcc unusable Message-ID: <1438726953.17293.9.camel@fbsd.es> In-Reply-To: <55C13155.3070500@FreeBSD.org> References: <1438633579.6572.13.camel@fbsd.es> <55BFD033.8070507@FreeBSD.org> <1438634467.7343.2.camel@fbsd.es> <55BFDCA0.8040006@FreeBSD.org> <1438638022.7343.7.camel@fbsd.es> <55BFEAAA.4070008@FreeBSD.org> <1438644237.7343.13.camel@fbsd.es> <55C005D7.3050103@FreeBSD.org> <1438700587.2911.4.camel@fbsd.es> <55C13155.3070500@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-PkiWg5pbHnq1jx9NNEOX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable El mar, 04-08-2015 a las 17:40 -0400, Jung-uk Kim escribi=C3=B3: > On 08/04/2015 11:03, Carlos Jacobo Puga Medina wrote: > > El lun, 03-08-2015 a las 20:22 -0400, Jung-uk Kim escribi=C3=B3: > > > On 08/03/2015 19:23, Carlos Jacobo Puga Medina wrote: > > > > El lun, 03-08-2015 a las 18:26 -0400, Jung-uk Kim escribi=C3=B3: > > > > > On 08/03/2015 17:40, Carlos Jacobo Puga Medina wrote: > > > > > > El lun, 03-08-2015 a las 17:26 -0400, Jung-uk Kim > > > > > > escribi=C3=B3: > > > > > > > On 08/03/2015 16:41, Carlos Jacobo Puga Medina wrote: > > > > > > > > El lun, 03-08-2015 a las 16:33 -0400, Jung-uk Kim=20 > > > > > > > > escribi=C3=B3: > > > > > > > >=20 > > > > > > > > Hi Jung-uk, > >=20 > > > > > > > > > On 08/03/2015 16:26, Carlos Jacobo Puga Medina > > > > > > > > > wrote: > > > > > > > > > > Hi people, > > > > > > > > > >=20 > > > > > > > > > > Recently I added amd64 support to TinyCC, but I=20 > > > > > > > > > > encounter the following problem trying to compile a > > > > > > > > > > simple code. > > > > > > > > > >=20 > > > > > > > > > > #include <stdio.h> > > > > > > > > > >=20 > > > > > > > > > > int main(){ printf("hello, world!\n); return 0; } > > > > > > > > > >=20 > > > > > > > > > > % tcc -o hello hello.c In file included from=20 > > > > > > > > > > hello.c:1: /usr/include/stdio.h:63: error: ';' > > > > > > > > > > expected (got "va_list") > > > > > > > > > >=20 > > > > > > > > > > I guess that some change introduced in 'stdio.h' > > > > > > > > > > causes this weird behaviour. Last time that TCC > > > > > > > > > > worked fine was on FreeBSD 9.1 -RELEASE/i386. > > > > > > > > > >=20 > > > > > > > > > > Also I reported this problem in the tinycc-devel=20 > > > > > > > > > > mailing list [1] > > > > > > > > > >=20 > > > > > > > > > > Any thoughts? > > > > > > > > >=20 > > > > > > > > > I haven't tried tcc but '"' is missing for the > > > > > > > > > printf(). > > > > > > > >=20 > > > > > > > > Yes, it was a typo here :) > > > > > > >=20 > > > > > > > It seems it's a known tcc bug: > > > > > > >=20 > > > > > > > http://savannah.nongnu.org/bugs/?30966 > > > > > > >=20 > > > > > >=20 > > > > > > Is there something that we can do about it? > > > > > >=20 > > > > > > Thanks for pointing me, jkim@ > > > > >=20 > > > > > It seems there is no easy way to fix this problem without=20 > > > > > touching src tree, e.g., > > > > >=20 > > > > > --- sys/x86/include/_types.h (revision 286256) +++=20 > > > > > sys/x86/include/_types.h (working copy) @@ -152,7=20 > > > > > +152,7 @@ > > > > > */ #ifdef __GNUCLIKE_BUILTIN_VARARGS typedef > > > > > __builtin_va_lis t __va_list; /* internally known to=20 > > > > > gcc */ > > > > > -#elif defined(lint) +#elif defined(__TINYC__) || > > > > > defined(lint) typedef char * __va_list; /*=20 > > > > > pretend */ #endif > > > > > #if defined(__GNUC_VA_LIST_COMPATIBILITY) &&=20 > > > > > !defined(__GNUC_VA_LIST) \ > > > > >=20 > > > >=20 > > > > If you need doing some changes into the src tree. > > >=20 > > > https://svnweb.freebsd.org/changeset/base/286265 > > >=20 > >=20 > > That's OK! > >=20 > > > > So, what do you recommend in such case? Would it be much > > > > trouble add the necessary changes to run TCC again? > > > > Furthermore, TinyCC developer has ignored this issue > > > > completely. > > >=20 > > > The only hack I see is defining __va_list as a macro from > > > libtcc.c but it is ugly. > > >=20 > >=20 > > Probably this should be discussed in the tinycc-devel ML. In the=20 > > meanwhile we can try your dirty hack :-) >=20 > See the attached patch. Yes, it is ugly. ;-) It works :) If I compile some c file it generates a coredump (Bus error)=20 /* traditional way */ % tcc -o hello hello.c % ./hello Bus error (core dumped) Although, it works using '-run' option % tcc -run hello.c hello, world! Best regards,--=20 Carlos Jacobo Puga Medina <cpm@fbsd.es> PGP fingerprint =3D C60E 9497 5302 793B CC2D BB89 A1F3 5D66 E6D0 5453 --=-PkiWg5pbHnq1jx9NNEOX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABCAAGBQJVwTspAAoJEKHzXWbm0FRTh74H/2srzZejWGuiT7L1yF+frhwk 9SZp7wwX0d5yEVqkHtJBiEfiJe3MIw8a53PsF/vXApI1Ka3hA0i3b2fhyvZG0bo3 ugav0X3H7sMJW+BRs4t5RPfm9BJRKKxHdiUyBZRsFdcrkiteQuo67Bt1PHkeA8TU AfJAtLvPHjfWxWMriICFWQU6cAikjQec6QBj/JnLFb1HgtV+UpZC9jOGeS7CDraO /pFeWCBLdcy3USdi6aOTUiJbG70FQk29fsvYiNcpej1hQAcaSok6NV2gQlmPC5+O L5eBWvPIyxl7dvGDIdoBR1DhG+vKuKCN6eEQmuFejWPwkUQhg21cpX9dt/eBMgs= =xgO5 -----END PGP SIGNATURE----- --=-PkiWg5pbHnq1jx9NNEOX--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1438726953.17293.9.camel>