| Summary: | LSB: Some cases (libstdc++.so.6) failed on library check of LSB test. | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jingdong Lu <jingdong.lu> |
| Component: | devtools / tool chain | Assignee: | Nitin Kamble <nitin.a.kamble> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | jingdong.lu, meta.mr.watcher, meta.watcher, sgw |
| Version: | 1.0 | ||
| Target Milestone: | 1.0 M4 | ||
| Hardware: | x86 | ||
| OS: | x86 | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Jingdong Lu
2011-03-03 00:47:19 UTC
I test the unstripped libstdc++.so.6.0.14 generated by gcc-runtime_4.5.1.bb.
eric@eric-desktop:~/poky/poky-0210/build/tmp/work/i586-poky-linux/gcc-runtime-4.5.1-r2/image/usr/lib$ nm libstdc++.so | grep do_widen
0004d220 t _ZNKSt5ctypeIcE8do_widenEPKcS2_Pc
0004d100 t _ZNKSt5ctypeIcE8do_widenEc
000a2c80 T _ZNKSt5ctypeIwE8do_widenEPKcS2_Pw
000a2c60 T _ZNKSt5ctypeIwE8do_widenEc
_ZNKSt5ctypeIcE8do_widenEPKcS2_Pc, ... should be a weak symbol like this:
root@qemux86:~# nm -D /usr/lib/libstdc\+\+.so.6 | grep do_widen
0004d130 W _ZNKSt5ctypeIcE8do_widenEPKcS2_Pc
0004d010 W _ZNKSt5ctypeIcE8do_widenEc
000a30c0 T _ZNKSt5ctypeIwE8do_widenEPKcS2_Pw
000a30a0 T _ZNKSt5ctypeIwE8do_widenEc
I found that some weak symbols ('W') change into local ('t') during link time and be stripped. According to compiling log, the option "-fvisibility-inlines-hidden" is used for gcc. And this option caused some weak symbols change into local.
In .../meta/conf/distro/include/poky-eglibc.inc
CXXFLAGS += "-fvisibility-inlines-hidden"
~/poky/poky-0210/build$ bitbake -e | grep CXXFLAGS
...
# TARGET_CXXFLAGS=${TARGET_CFLAGS} -fpermissive
export TARGET_CXXFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -fpermissive"
# CXXFLAGS=${TARGET_CXXFLAGS} -fvisibility-inlines-hidden
export CXXFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden"
So I suggest this option "-fvisibility-inlines-hidden" should be removed when compiling libstdc++ and I give a proposed patch for this failure.
gcc-configure-runtime.inc
--- gcc-configure-runtime.inc.orig 2011-03-03 17:09:38.754912745 +0800
+++ gcc-configure-runtime.inc 2011-03-03 17:09:49.374912073 +0800
@@ -14,6 +14,7 @@
do_configure () {
export CXX="${CXX} -nostdinc++ -nostdlib++"
+ export CXXFLAGS="${TARGET_CXXFLAGS}"
for d in ${RUNTIMETARGET}; do
echo "Configuring $d"
mkdir -p ${B}/$d/
According to the suggestion from LFS, we also can unset CXXFLAGS when compiling libstdc++. I have checked these two modifications and got excepted results.
sent a patch to the mailing list for fixing this bug. |