Bug 9772 - musl libgcc_s.so.1 missing symbols on target
Summary: musl libgcc_s.so.1 missing symbols on target
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.2 M3
Assignee: Khem Raj
QA Contact: Francisco Pedraza
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-06-14 08:28 UTC by Jussi Kukkonen
Modified: 2016-07-29 15:49 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jussi Kukkonen 2016-06-14 08:28:18 UTC
> sh-4.3# ldd /lib/libgcc_s.so.1
>         ldd (0x800f7000)
>         libc.so => ldd (0x800f7000)
> Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
> Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found


This happens with TCLIBC = "musl" and seems to break newer libvte versions.
Comment 1 Ross Burton 2016-07-18 21:18:01 UTC
We also saw this with weston:

  gbm: failed to open any driver (search paths /usr/lib/dri)
  gbm: last dlopen error: Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
  failed to load driver: i965

There was talk of security flags being a problem here, has this been verified or refuted?
Comment 2 Khem Raj 2016-07-19 00:15:44 UTC
(In reply to comment #1)
> We also saw this with weston:
> 
>   gbm: failed to open any driver (search paths /usr/lib/dri)
>   gbm: last dlopen error: Error relocating /lib/libgcc_s.so.1:
> __cpu_indicator_init: symbol not found
>   failed to load driver: i965
> 
> There was talk of security flags being a problem here, has this been
> verified or refuted?

which architecture does it happen on ?
on x86 (qemux86) I dont see it

kraj02@dvm-wcdcc-khem-002 /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/lib
 % readelf -sW libgcc_s.so.1 | grep __cpu
   125: 0001d040    16 OBJECT  GLOBAL DEFAULT   22 __cpu_model@GCC_4.8.0
   135: 00002210   855 FUNC    GLOBAL DEFAULT   11 __cpu_indicator_init@GCC_4.8.0
Comment 3 Jussi Kukkonen 2016-07-19 07:42:20 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > We also saw this with weston:
> > 
> >   gbm: failed to open any driver (search paths /usr/lib/dri)
> >   gbm: last dlopen error: Error relocating /lib/libgcc_s.so.1:
> > __cpu_indicator_init: symbol not found
> >   failed to load driver: i965
> > 
> > There was talk of security flags being a problem here, has this been
> > verified or refuted?
>
> which architecture does it happen on ?

The core-image-weston test was with "MACHINE=intel-corei7-64" so x86-64.

I assume this is the issue:
https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00822.html
Comment 4 Jussi Kukkonen 2016-07-19 08:11:29 UTC
(In reply to comment #2)
> on x86 (qemux86) I dont see it
> 
> kraj02@dvm-wcdcc-khem-002
> /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/lib
>  % readelf -sW libgcc_s.so.1 | grep __cpu
>    125: 0001d040    16 OBJECT  GLOBAL DEFAULT   22 __cpu_model@GCC_4.8.0
>    135: 00002210   855 FUNC    GLOBAL DEFAULT   11
> __cpu_indicator_init@GCC_4.8.0

readelf -s does not seem to show the problem:

root@qemux86-64:~# readelf -sW /lib/libgcc_s.so.1 |grep _cpu
    92: 0000000000002e60   969 FUNC    GLOBAL DEFAULT   12 __cpu_indicator_init@GCC_4.8.0
   116: 0000000000215650    16 OBJECT  GLOBAL DEFAULT   24 __cpu_model@GCC_4.8.0
root@qemux86-64:~# ldd /lib/libgcc_s.so.1 
	ldd (0x55bb59997000)
	libc.so => ldd (0x55bb59997000)
Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found
Comment 5 Khem Raj 2016-07-20 00:52:19 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > on x86 (qemux86) I dont see it
> > 
> > kraj02@dvm-wcdcc-khem-002
> > /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/lib
> >  % readelf -sW libgcc_s.so.1 | grep __cpu
> >    125: 0001d040    16 OBJECT  GLOBAL DEFAULT   22 __cpu_model@GCC_4.8.0
> >    135: 00002210   855 FUNC    GLOBAL DEFAULT   11
> > __cpu_indicator_init@GCC_4.8.0
> 
> readelf -s does not seem to show the problem:
> 
> root@qemux86-64:~# readelf -sW /lib/libgcc_s.so.1 |grep _cpu
>     92: 0000000000002e60   969 FUNC    GLOBAL DEFAULT   12
> __cpu_indicator_init@GCC_4.8.0
>    116: 0000000000215650    16 OBJECT  GLOBAL DEFAULT   24
> __cpu_model@GCC_4.8.0
> root@qemux86-64:~# ldd /lib/libgcc_s.so.1 
> 	ldd (0x55bb59997000)
> 	libc.so => ldd (0x55bb59997000)
> Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
> Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found


testing a patch here

https://github.com/kraj/openembedded-core/commit/d1f8f1622d9c936019220e9105c9544644d50c52
Comment 6 Khem Raj 2016-07-20 19:44:20 UTC
posted patched to ml
Comment 7 Ross Burton 2016-07-26 16:32:17 UTC
Fixed in oe-core f96da00e78999899ea7037ebc9547a87023e309a.