[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#672996: libstdc++6-4.6-dev: Static linking of C++ runtime fails due to relocation problems, recompiling with -fPIC needed.



Am 06.10.2012 14:24, schrieb Matthias Klose:
> tags 672996 + moreinfo
> thanks
>
> On 15.05.2012 12:47, Flynn Marquardt wrote:
>> Package: libstdc++6-4.6-dev
>> Version: 4.6.3-1
>> Severity: normal
>>
>> Dear Maintainer,
>>
>> trying to link the C++-runtime statically with the option -static-libstdc++
>> fails for me with following error:
>>
>> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a(ctype.o):
>> relocation R_X86_64_32S against `vtable for std::ctype<wchar_t>' can not
>> be used when making a shared object; recompile with -fPIC
>> /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a: could not read symbols:
>> Bad value
>>
>> Please consider building /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a
>> with the Option -fPIC,
>> maybe other version of gcc from version 4.5 (introducing the option
>> -static-libstdc++) too.
> the bug report is missing information how the objects are built and linked.
>
>
Built was a shared library, that should be linked statically against
libstdc++.

Used compiler flags (except -D -I): -m64 -O3 -fPIC -fno-strict-aliasing
-ffunction-sections -pthread
Used linker flags: -fPIC -m64 -Wl,--version-script=... 
-Wl,--gc-sections,-z,defs,--as-needed,-O1 -shared -Wl,-soname,...

If you need more incofrmation, let me know.

(gcc-4.7 has the same problem, but the symbol in question is different ...)

Flynn

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: