Hi guys, I think I may have found an issue today with our bi-endian structure, and I wanted to make sure whether or not it was an already known issue (-m32 is broken for gcc with lib32/libgcc.a): [root@fbsd-7-test]# gcc -o boo boo.c # Compiles [root@fbsd-7-test]# gcc -m32 -o boo boo.c /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc [root@fbsd-7-test]# file /usr/lib32/libgcc_s.so.1 /usr/lib32/libgcc_s.so.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), dynamically linked, stripped [root@fbsd-7-test]# uname -a FreeBSD fbsd-7-test.gateway.2wire.net 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sun Nov 23 16:19:09 UTC 2008 root@fbsd-7-test.gateway.2wire.net:/usr/obj/usr/src/sys/STARR amd64 I wish I had my amd64 CURRENT machine in front of me to confirm this, but I don't. Please keep me CC'ed as I am not subscribed to either amd64@ or stable@. Thanks! -Garrett
"Garrett Cooper" <yanefbsd@gmail.com> wrote:> Hi guys, > I think I may have found an issue today with our bi-endian > structure, and I wanted to make sure whether or not it was an already > known issue (-m32 is broken for gcc with lib32/libgcc.a): > > [root@fbsd-7-test]# gcc -o boo boo.c # Compiles > [root@fbsd-7-test]# gcc -m32 -o boo boo.c > /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching > for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when > searching for -lgcc /usr/bin/ld: cannot find -lgcc > [root@fbsd-7-test]# file /usr/lib32/libgcc_s.so.1 > /usr/lib32/libgcc_s.so.1: ELF 32-bit LSB shared object, Intel 80386, > version 1 (FreeBSD), dynamically linked, stripped > [root@fbsd-7-test]# uname -a > FreeBSD fbsd-7-test.gateway.2wire.net 7.1-PRERELEASE FreeBSD > 7.1-PRERELEASE #0: Sun Nov 23 16:19:09 UTC 2008 > root@fbsd-7-test.gateway.2wire.net:/usr/obj/usr/src/sys/STARR amd64 > > I wish I had my amd64 CURRENT machine in front of me to confirm > this, but I don't. > Please keep me CC'ed as I am not subscribed to either amd64@ or > stable@. Thanks! > -GarrettI also noticed that behavior, shouldn't compiler/linker look into /usr/lib32 without additional -B switch? -- regards, Maciej Suszko. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20081223/d2044bbe/signature.pgp
I will extend topic to C++: [19:38] zubr:~/Code (1) $ g++ -m32 -B /usr/lib32 p.cpp In file included from /usr/include/c++/4.2/ext/new_allocator.h:37, from /usr/include/c++/4.2/bits/c++allocator.h:39, from /usr/include/c++/4.2/bits/allocator.h:53, from /usr/include/c++/4.2/memory:54, from /usr/include/c++/4.2/string:48, from /usr/include/c++/4.2/bits/locale_classes.h:47, from /usr/include/c++/4.2/bits/ios_base.h:47, from /usr/include/c++/4.2/ios:48, from /usr/include/c++/4.2/ostream:45, from /usr/include/c++/4.2/iostream:45, from p.cpp:1: /usr/include/c++/4.2/new:95: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter /usr/include/c++/4.2/new:96: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter /usr/include/c++/4.2/new:99: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter /usr/include/c++/4.2/new:100: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter /usr/include/c++/4.2/new:105: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter /usr/include/c++/4.2/new:106: error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter [19:38] zubr:~/Code (1) $ cat p.cpp #include <iostream> int main() { return 0; } [19:39] zubr:~/Code $ Problem with C++ is more connected to headers than binaries, any suggestions how to use G++ to produce 32bit code ?