Re: [Tinycc-devel] core dump on FreeBSD with last commit "configure: --triplet= option, Makefile: cleanup"

2016-10-24 Thread Christian Jullien
You can compile but not link.
Maybe you need and extra package for the linker.

$ gcc -m32 foo.c
/usr/local/bin/ld: skipping incompatible
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd11.0/4.8.5/libgcc.a when
searching for -lgcc
/usr/local/bin/ld: skipping incompatible //usr/lib/libgcc.a when searching
for -lgcc
/usr/local/bin/ld: cannot find -lgcc
/usr/local/bin/ld: skipping incompatible
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd11.0/4.8.5/../../../libgcc_s.
so when searching for -lgcc_s
/usr/local/bin/ld: skipping incompatible //usr/lib/libgcc_s.so when
searching for -lgcc_s
/usr/local/bin/ld: cannot find -lgcc_s
/usr/local/bin/ld: skipping incompatible /lib/libc.so.7 when searching for
/lib/libc.so.7
/usr/local/bin/ld: cannot find /lib/libc.so.7
/usr/local/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when
searching for /usr/lib/libc_nonshared.a
/usr/local/bin/ld: cannot find /usr/lib/libc_nonshared.a
/usr/local/bin/ld: skipping incompatible /usr/lib/libssp_nonshared.a when
searching for /usr/lib/libssp_nonshared.a
/usr/local/bin/ld: cannot find /usr/lib/libssp_nonshared.a
collect2: error: ld returned 1 exit status

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org]
On Behalf Of Michael Matz
Sent: lundi 24 octobre 2016 18:02
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] core dump on FreeBSD with last commit
"configure: --triplet= option, Makefile: cleanup"

Hi,

On Thu, 20 Oct 2016, Christian Jullien wrote:

> I'm sure you'll not believe me, but it's NOT an April Fool.
> 
> $ uname -a
> FreeBSD freebsd64.eligis.com 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 
> #0
> r306420: Thu Sep 29 01:43:23 UTC 2016
> r...@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64 $ gcc 
> -m32 --print-file-name=crt1.o /usr/lib/crt1.o $ gcc -m64 
> --print-file-name=crt1.o /usr/lib/crt1.o $ gcc 
> --print-file-name=crt1.o /usr/lib/crt1.o $ find /usr -name crt1.o 
> /usr/lib32/crt1.o /usr/lib/crt1.o

Gnah!  So they managed to break GCCs multi-lib support in subtle ways.  
Can you even build a hello world type program with "gcc -m32" on that
system?

Sigh.  Okay, of course nothing is ever as simple :-/ :)

Ciao,
Michael.

> 
> -Original Message-
> From: Tinycc-devel 
> [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org]
> On Behalf Of Michael Matz
> Sent: jeudi 20 octobre 2016 17:23
> To: tinycc-devel@nongnu.org
> Subject: Re: [Tinycc-devel] core dump on FreeBSD with last commit
> "configure: --triplet= option, Makefile: cleanup"
> 
> Hello Christian,
> 
> On Wed, 19 Oct 2016, Christian Jullien wrote:
> 
> > x86_64:
> > $ uname -m
> > amd64
> > $ gcc --print-file-name=crt1.o
> > /usr/lib/crt1.o
> > $ find /usr -name crt1.o
> > /usr/lib32/crt1.o
> > /usr/lib/crt1.o
> 
> Aha!  So they chose the opposite way to the linuxes.  Okay, that 
> helps, thanks.  Can you verify that
> 
> % gcc -m32 --print-file-name=crt1.o
> 
> gives /usr/lib32/crt1.o ?
> 
> 
> Ciao,
> Michael.
> 
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 
> 
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc

2016-10-24 Thread Michael Matz
Hi,

On Thu, 20 Oct 2016, David Mertens wrote:

> > For instance, this is wrong for PCC layout.  MS layout indeed switches
> > storage containers when the base type changes, i.e. here:
> >
> > struct S {
> >   char  c:1;
> >   short s:1;
> >   char foo;
> > };
> >
> > PCC layout has no such provisions.  But the base type _does_ influence
> > alignment of the containing struct nevertheless.  Except if the bitfield
> > has :0 size, then it _does_ force the next field to be placed into a new
> > storage container.  It's all quite terrible and twisted :-/
> >
> 
> I question the wisdom of targeting the binary layout of pcc.

Sorry, maybe I wasn't clear enough.  The traditional PCC layout _is_ the 
GCC layout on most targets.  (That PCC only has few things in common with 
the current pcc project used by some BSDs).

> It's a neat compiler, with an aim similar to tcc, but developer time and 
> resources are limited. I'd vote for just MSVC and GCC compatibility as a 
> start. (Presumably we get clang for free with that.) If anybody later 
> comes along with inclination, they can extend it to handle PCC layout.

Perhaps I shouldn't have confused matters more, but the problem I had was 
that talking about "the" GCC layout would be wrong as well, as it itself 
tries to follow vendor compilers where they exist :)  It just so happens 
that if GCC is the "vendor" compiler (which it is for many recent 
architectures) and there's nothing specific in the psABI from the vendor 
(there is for instance for ARM) it often uses the same layout rules like 
the very old PCC compiler did for many Unixes (mostly because the usual 
ports people copy their initial version from simply has 
PCC_BITFIELD_TYPE_MATTERS set).

So, that's why I talked about PCC layout because it specifies a certain 
set of rules.  MS layout as well.  So, yes, I agree that that would be the 
choice, MS layout or "GCC" layout (aka PCC layout :) ).

And yes, that would be an option (or perhaps a compile time default 
depending on the target).


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] core dump on FreeBSD with last commit "configure: --triplet= option, Makefile: cleanup"

2016-10-24 Thread Michael Matz
Hi,

On Thu, 20 Oct 2016, Christian Jullien wrote:

> I'm sure you'll not believe me, but it's NOT an April Fool.
> 
> $ uname -a
> FreeBSD freebsd64.eligis.com 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0
> r306420: Thu Sep 29 01:43:23 UTC 2016
> r...@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
> $ gcc -m32 --print-file-name=crt1.o
> /usr/lib/crt1.o
> $ gcc -m64 --print-file-name=crt1.o
> /usr/lib/crt1.o
> $ gcc --print-file-name=crt1.o
> /usr/lib/crt1.o
> $ find /usr -name crt1.o
> /usr/lib32/crt1.o
> /usr/lib/crt1.o

Gnah!  So they managed to break GCCs multi-lib support in subtle ways.  
Can you even build a hello world type program with "gcc -m32" on that 
system?

Sigh.  Okay, of course nothing is ever as simple :-/ :)

Ciao,
Michael.

> 
> -Original Message-
> From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org]
> On Behalf Of Michael Matz
> Sent: jeudi 20 octobre 2016 17:23
> To: tinycc-devel@nongnu.org
> Subject: Re: [Tinycc-devel] core dump on FreeBSD with last commit
> "configure: --triplet= option, Makefile: cleanup"
> 
> Hello Christian,
> 
> On Wed, 19 Oct 2016, Christian Jullien wrote:
> 
> > x86_64:
> > $ uname -m
> > amd64
> > $ gcc --print-file-name=crt1.o
> > /usr/lib/crt1.o
> > $ find /usr -name crt1.o
> > /usr/lib32/crt1.o
> > /usr/lib/crt1.o
> 
> Aha!  So they chose the opposite way to the linuxes.  Okay, that helps,
> thanks.  Can you verify that
> 
> % gcc -m32 --print-file-name=crt1.o
> 
> gives /usr/lib32/crt1.o ?
> 
> 
> Ciao,
> Michael.
> 
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 
> 
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel