我想編譯一個共享庫,它沒有足夠的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