[lsb-discuss] Bug in LSB 5.0 SDK, I think

Mats Wichmann mats at wichmann.us
Tue Feb 20 14:39:32 UTC 2018

On 02/20/2018 07:11 AM, Dallman, John wrote:
> /opt/lsb/lib64-5.0/libgcc_s.so.1 does not provide __gcc_personality_v0, which is causing all my attempts to link the product I work on with LSBCC to fail. The product is written in a domain-specific language which generates C code, using it as a kind of high-level assembly language.
> This symbol is present in the system libgcc_s.so on this CentOS 7.2 system:
> $ readelf -sW /usr/lib64/libgcc_s-4.8.5-20150702.so.1 | grep gcc_personality
>    163: 0000000000011e20   620 FUNC    GLOBAL DEFAULT   12 __gcc_personality_v0@@GCC_3.3.1
> Note that this is __gcc_personality_v0, for C code, not __g++_personality_v0 which is for C++ code.
> References to __gcc_personality_v0 are only emitted in .o files when one compiles C code with the -fexceptions option, to allow C++ exceptions to be thrown through C stack frames. That's presumably how this sneaked through testing.
> I have lsb-sdk-5.0.0-3.x86_64.tar.gz, which seems to be the latest available. Any chance of a fix? Is there a way for me to fix it myself?
> Thanks,

It's indeed missing.

(by the way - did you actually mean g++_personality_v0? we have
gxx_personality_v0 in our database)

This isn't anything I'm familiar with - we need to get a bugzilla filed
and sort it out.

In the meantime, if you want to build your own libgcc_s.so it should be
a pretty simple patch to add this symbol - obviously on an unsupported
basis, etc (not that we're able to do much in the way of "support"
anyway).  The change to build_env source would look like this for just
the one architecture, you'd have to repeat if if you need others:

=== modified file 'stub_libs/5.0/x86-64/libgcc_s.Version'
--- stub_libs/5.0/x86-64/libgcc_s.Version
revid:mats at linuxfoundation.org-20170424152416-mexuq1nhgpi0fz6x
+++ stub_libs/5.0/x86-64/libgcc_s.Version	2018-02-20 14:37:04 +0000
@@ -20,6 +20,9 @@
+GCC_3.3.1 {
+  __gcc_personality_v0;
 GCC_4.2.0 {

=== modified file 'stub_libs/5.0/x86-64/libgcc_s.c'
--- stub_libs/5.0/x86-64/libgcc_s.c
revid:mats at linuxfoundation.org-20170424152416-mexuq1nhgpi0fz6x
+++ stub_libs/5.0/x86-64/libgcc_s.c	2018-02-20 14:36:31 +0000
@@ -16,3 +16,4 @@
 void _Unwind_Resume_or_Rethrow() {} ;
 void _Unwind_SetGR() {} ;
 void _Unwind_SetIP() {} ;
+void __gcc_personality_v0() {} ;

More information about the lsb-discuss mailing list