我想编译一个共享库,它没有足够的libstdC++来运行它,这意味着我需要将libstdC++静态链接到库中。我想直接链接到的libstdC++一(-Wl,-Bstatic -L/path/to/lib64 -lstdc++
),但我发现,似乎表明我的libstdC++一个未用PIC链接错误:。如何使用PIC编译gnu libstdC++。a?
/usr/bin/ld: lib64/libstdc++.a(compatibility.o): relocation R_X86_64_32 against `typeinfo for __cxxabiv1::__forced_unwind' can not be used when making a shared object; recompile with -fPIC
lib64/libstdc++.a: could not read symbols: Bad value
我试图重新编译GCC CFLAGS =“ - fPIC”和CXXFLAGS =“ - fPIC”,但这似乎没有做任何事情。
帮助?
这是记录在任何地方吗?它不在http://gcc.gnu.org/install/configure.html – bobpoekert
但是,如果您更改为/libstdC++ - v3子目录并运行'configure --help',那么您将会看到它。 –
oakad
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28811 - 与stdC++ libs的图片问题有一个相当动荡的历史。 – oakad