From owner-freebsd-ports@freebsd.org Tue Aug 4 22:22:51 2015 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 702FD9B3D58 for ; Tue, 4 Aug 2015 22:22:51 +0000 (UTC) (envelope-from cpm@fbsd.es) Received: from imap2-2.ox.privateemail.com (imap2-2.ox.privateemail.com [192.64.116.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "privateemail.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4534EE0A; Tue, 4 Aug 2015 22:22:50 +0000 (UTC) (envelope-from cpm@fbsd.es) Received: from localhost (localhost [127.0.0.1]) by imap2.ox.privateemail.com (Postfix) with ESMTP id 436AC8C0082; Tue, 4 Aug 2015 18:22:48 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from imap2.ox.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id r9nvWWid3vhe; Tue, 4 Aug 2015 18:22:48 -0400 (EDT) Received: from daemonlab (120.Red-83-58-115.dynamicIP.rima-tde.net [83.58.115.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by imap2.ox.privateemail.com (Postfix) with ESMTPSA id 787188C0069; Tue, 4 Aug 2015 18:22:45 -0400 (EDT) Message-ID: <1438726953.17293.9.camel@fbsd.es> Subject: Re: lang/tcc unusable From: Carlos Jacobo Puga Medina To: Jung-uk Kim , "freebsd-ports@freebsd.org" Date: Wed, 05 Aug 2015 00:22:33 +0200 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> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-PkiWg5pbHnq1jx9NNEOX" X-Mailer: Evolution 3.16.4 (3.16.4-2.fc22) Mime-Version: 1.0 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 22:22:51 -0000 --=-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 > > > > > > > > > >=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 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--