/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libstdc++.a: could not read symbols: Bad value

O. Hartmann ohartman at zedat.fu-berlin.de
Wed Dec 28 16:15:47 UTC 2011


Am 12/28/11 16:57, schrieb Dimitry Andric:
> On 2011-12-28 11:48, O. Hartmann wrote:
> ...
>> /usr/local/bin/ld:
>> /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libstdc++.a(functexcept.o):
>>
>> relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
>> can not be used when making a shared object; recompile with -fPIC
>> /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libstdc++.a:
>>
>> could not read symbols: Bad value
>> collect2: ld returned 1 exit status
> 
> What happens if you compile and link the following simple program with
> g++46:
> 
> #include <iostream>
> 
> int main(void)
> {
>     std::cout << "Hello World!" << std::endl;
>     return 0;
> }
> 
> Does it fail with the same type of link error, e.g. linking to the
> libstdc++.a instead libstdc++.so?  It would be nice if you can add -v to
> the command line, and paste the output here.
> 
> I suspect your g++46 port is busted, for some reason.

It works fine:

ohartmann at telesto: [~] g++46 -v -o muff muff.cpp
Using built-in specs.
COLLECT_GCC=g++46
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/lto-wrapper
Target: x86_64-portbld-freebsd9.0
Configured with: ./../gcc-4.6-20111209/configure --disable-nls
--enable-languages=c,c++,objc,fortran --libdir=/usr/local/lib/gcc46
--libexecdir=/usr/local/libexec/gcc46 --program-suffix=46
--with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/
--with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local
--with-pkgversion='FreeBSD Ports Collection' --with-system-zlib
--enable-languages=c,c++,objc,fortran,java --prefix=/usr/local
--mandir=/usr/local/man --infodir=/usr/local/info/gcc46
--build=x86_64-portbld-freebsd9.0
Thread model: posix
gcc version 4.6.3 20111209 (prerelease) (FreeBSD Ports Collection)
COLLECT_GCC_OPTIONS='-v' '-o' 'muff' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/cc1plus
-quiet -v muff.cpp -quiet -dumpbase muff.cpp -mtune=generic
-march=x86-64 -auxbase muff -version -o /var/tmp//ccu1eDPY.s
GNU C++ (FreeBSD Ports Collection) version 4.6.3 20111209 (prerelease)
(x86_64-portbld-freebsd9.0)
        compiled by GNU C version 4.6.3 20111209 (prerelease), GMP
version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../../../x86_64-portbld-freebsd9.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc46/include/c++/
 /usr/local/lib/gcc46/include/c++//x86_64-portbld-freebsd9.0
 /usr/local/lib/gcc46/include/c++//backward
 /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/include
 /usr/local/include
 /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/include-fixed
 /usr/include
End of search list.
GNU C++ (FreeBSD Ports Collection) version 4.6.3 20111209 (prerelease)
(x86_64-portbld-freebsd9.0)
        compiled by GNU C version 4.6.3 20111209 (prerelease), GMP
version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1f5bea4d4b089362b811317a91015e20
COLLECT_GCC_OPTIONS='-v' '-o' 'muff' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/bin/as -v -o /var/tmp//ccblbg7V.o /var/tmp//ccu1eDPY.s
GNU assembler version 2.22 (x86_64-portbld-freebsd9.0) using BFD version
(GNU Binutils) 2.22
COMPILER_PATH=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../../../x86_64-portbld-freebsd9.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../../../x86_64-portbld-freebsd9.0/lib/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'muff' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/collect2
--eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o muff
/usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/crtbegin.o
-L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3
-L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../../../x86_64-portbld-freebsd9.0/lib
-L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../..
/var/tmp//ccblbg7V.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/crtend.o
/usr/lib/crtn.o
GNU ld (GNU Binutils) 2.22
  Supported emulations:
   elf_x86_64_fbsd
   elf_i386_fbsd
   elf_x86_64
   elf_i386
   elf_l1om
   elf_l1om_fbsd
   elf_k1om
   elf_k1om_fbsd
ohartmann at telesto: [~] ./muff
Hello World!
ohartmann at telesto: [~]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20111228/597f149d/signature.pgp


More information about the freebsd-current mailing list