From owner-freebsd-stable@FreeBSD.ORG Thu Aug 25 13:28:19 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9FA71065704 for ; Thu, 25 Aug 2011 13:28:19 +0000 (UTC) (envelope-from nbeck@hobsoft.com.mt) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mx1.freebsd.org (Postfix) with ESMTP id B895A8FC1D for ; Thu, 25 Aug 2011 13:28:19 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QwZyk-0005Ke-Qf for freebsd-stable@freebsd.org; Thu, 25 Aug 2011 06:28:18 -0700 Date: Thu, 25 Aug 2011 06:28:18 -0700 (PDT) From: noel beck To: freebsd-stable@freebsd.org Message-ID: <1314278898818-4734497.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: FreeBSD 8.2r amd 64 problem when compiling 32bit applications X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2011 13:28:19 -0000 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@Bruno ~]$ ls MyDocuments hello.c [gsaid@Bruno ~]$ gcc -o hello hello.c [gsaid@Bruno ~]$ ls MyDocuments hello hello.c [gsaid@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@Bruno ~]$ ./hello Hello, World! The following is the example of the error when compiling in 32-bit on a 64-bit machine: [gsaid@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@Bruno ~]$ cat hello.c #include 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@Bruno /]$ locate libgcc.a /usr/lib/libgcc.a [gsaid@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.