FreeBSD 8.2r amd 64 problem when compiling 32bit applications
noel beck
nbeck at hobsoft.com.mt
Thu Aug 25 13:28:19 UTC 2011
I installed FreeBSD 8.2 release on a 64-bit machine (amd64) and it has gcc
4.2.1 built in. The library directories are lib, lib32 and lib64. When I
compiled for 64-bit the compilation was successful.
However, the problem is when I am compiling for 32-bit on this 64-bit
machine. We are getting an error stating that libstdc++.so.6 is missing.
Other forums state that if you install compact6x or compact7x, the missing
libraries will be installed. I installed these but it did not solve my
problem.
The following is the example of when compiling in 64-bit:
[gsaid at Bruno ~]$ ls
MyDocuments hello.c
[gsaid at Bruno ~]$ gcc -o hello hello.c
[gsaid at Bruno ~]$ ls
MyDocuments hello hello.c
[gsaid at Bruno ~]$ file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically
linked (uses shared libs), for FreeBSD 8.2, not stripped
[gsaid at Bruno ~]$ ./hello
Hello, World!
The following is the example of the error when compiling in 32-bit on a
64-bit machine:
[gsaid at Bruno ~]$ gcc -m32 -o hello hello.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
This is my Hello World script:
[gsaid at Bruno ~]$ cat hello.c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, World!\n");
return 0;
}
I have also tried adding "WITH_LIB32=yes" to /etc/make.conf and compiled and
installed the kernel again.
When I locate for libgcc.a to see if there is a one for 32-bit, only one is
found and it is of 64-bit
[gsaid at Bruno /]$ locate libgcc.a
/usr/lib/libgcc.a
[gsaid at Bruno /]$ nm /usr/lib/libgcc.a
__gcc_bcmp.o:
0000000000000000 T __gcc_bcmp
--
View this message in context: http://freebsd.1045724.n5.nabble.com/FreeBSD-8-2r-amd-64-problem-when-compiling-32bit-applications-tp4734497p4734497.html
Sent from the freebsd-stable mailing list archive at Nabble.com.
More information about the freebsd-stable
mailing list