Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685364 - x11-libs/libX11-1.6.7 - QA Notice: The following shared libraries lack NEEDED entries - /usr/lib64/libX11-xcb.so.1.0.0
Summary: x11-libs/libX11-1.6.7 - QA Notice: The following shared libraries lack NEEDED...
Status: RESOLVED DUPLICATE of bug 516016
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 16:08 UTC by Francesco Turco
Modified: 2019-05-10 03:55 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
info.txt (info.txt,5.71 KB, text/plain)
2019-05-08 16:09 UTC, Francesco Turco
Details
build.log.xz (build.log.xz,45.50 KB, application/x-xz)
2019-05-08 16:09 UTC, Francesco Turco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Turco 2019-05-08 16:08:43 UTC
Portage reports the following QA issue when emerging x11-libs/libX11-1.6.7:

 * QA Notice: The following shared libraries lack NEEDED entries
 * /usr/lib64/libX11-xcb.so.1.0.0
Comment 1 Francesco Turco 2019-05-08 16:09:06 UTC
Created attachment 575538 [details]
info.txt

emerge --info
Comment 2 Francesco Turco 2019-05-08 16:09:25 UTC
Created attachment 575540 [details]
build.log.xz
Comment 3 Matt Turner gentoo-dev 2019-05-08 21:11:25 UTC
I'm not really sure what the QA warning means or how to fix it. Maybe qa@ can give me some advice?
Comment 4 Mart Raudsepp gentoo-dev 2019-05-08 22:13:10 UTC
Not sure what this is about now. I mean, it seems to says it has no DT_NEEDED entries in the ELF dynamic section (readelf -d /usr/lib64/libx11-xcb.so.1.0.0), at least except for libc. But that's to be expected - nm -D confirms it doesn't need anything but C library and it just defines 2 symbols itself.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-05-09 14:37:16 UTC
I can't seem to reproduce this.

That said, I suspect the warning is exactly about what leio said -- not having DT_NEEDED, even for libc.  In other words, it sounds like something went really, really wrong on your system, for some reason.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2019-05-09 16:01:44 UTC
Not having DT_NEEDED for libc.so.6 is actually valid in rare cases when given file does not use anything from libc.so.6.


In x11-libs/libX11-1.6.7, results for me:

$ nm -D .../libX11-xcb.so
0000000000001130 T XGetXCBConnection
0000000000001170 T XSetEventQueueOwner
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
0000000000000000 A __gentoo_check_ldflags__
                 w __gmon_start__
                 U __stack_chk_fail
$ nm -D --defined-only .../libX11-xcb.so
0000000000001130 T XGetXCBConnection
0000000000001170 T XSetEventQueueOwner
0000000000000000 A __gentoo_check_ldflags__
$ nm -D --undefined-only .../libX11-xcb.so
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
                 U __stack_chk_fail


So there is only 1 undefined symbol: __stack_chk_fail
This symbol is defined for me in libc.so.6:

$ nm -D /lib64/libc.so.6 | grep __stack_chk_fail
000000000011fa10 T __stack_chk_fail


I guess that if you have USE="-ssp" for sys-libs/glibc and sys-devel/gcc, then you might get a version of libX11-xcb.so not linked against libc.so.6.
Please show: emerge -ptv sys-libs/glibc sys-devel/gcc
Comment 7 Francesco Turco 2019-05-09 18:04:23 UTC
# emerge -ptv sys-libs/glibc sys-devel/gcc

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/gcc-9.1.0:9.1.0::gentoo  USE="cxx nls nptl pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -fortran -go -graphite (-hardened) (-jit) (-libssp) (-multilib) -objc -objc++ -objc-gc -openmp -pgo -systemtap -test -vanilla" 0 KiB
[ebuild   R    ]  sys-libs/glibc-2.29-r2:2.2::gentoo  USE="multiarch ssp -audit -caps (-cet) (-compile-locales) -doc -gd -headers-only (-multilib) -nscd -profile (-selinux) -suid -systemtap -test (-vanilla)" 0 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB
Comment 8 Arfrever Frehtes Taifersar Arahesis 2019-05-09 18:16:49 UTC
Please show: nm -D /usr/lib64/libX11-xcb.so.1.0.0
Comment 9 Francesco Turco 2019-05-09 19:08:28 UTC
$ nm -D /usr/lib64/libX11-xcb.so.1.0.0
                 w __cxa_finalize
                 w __gmon_start__
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
0000000000001100 T XGetXCBConnection
0000000000001110 T XSetEventQueueOwner
Comment 10 Arfrever Frehtes Taifersar Arahesis 2019-05-10 00:39:49 UTC
(In reply to Francesco Turco from comment #9)
> $ nm -D /usr/lib64/libX11-xcb.so.1.0.0
>                  w __cxa_finalize
>                  w __gmon_start__
>                  w _ITM_deregisterTMCloneTable
>                  w _ITM_registerTMCloneTable
> 0000000000001100 T XGetXCBConnection
> 0000000000001110 T XSetEventQueueOwner

This means that, for whatever reason, this library does not have any undefined non-weak symbols (which would have to defined elsewhere at run-time in order to use this library), so no DT_NEEDED is actually needed.

*** This bug has been marked as a duplicate of bug 516016 ***
Comment 11 Arfrever Frehtes Taifersar Arahesis 2019-05-10 03:55:56 UTC
The way to reproduce absence of DT_NEEDED for libc.so.6 (which results in invalid QA warning) is to use GCC 9 and -Wl,--as-needed and level of stack protection smaller than "all" (-fstack-protector-all):

$ gcc-8.3.0 -fno-stack-protector -shared -fPIC -Wl,--as-needed -o test_gcc-8.3.0_no-ssp.so -x c - <<< "void x() {}"
$ gcc-8.3.0 -fstack-protector -shared -fPIC -Wl,--as-needed -o test_gcc-8.3.0_ssp.so -x c - <<< "void x() {}"
$ gcc-8.3.0 -fstack-protector-strong -shared -fPIC -Wl,--as-needed -o test_gcc-8.3.0_ssp-strong.so -x c - <<< "void x() {}"
$ gcc-8.3.0 -fstack-protector-all -shared -fPIC -Wl,--as-needed -o test_gcc-8.3.0_ssp-all.so -x c - <<< "void x() {}"
$ gcc-9.1.0 -fno-stack-protector -shared -fPIC -Wl,--as-needed -o test_gcc-9.1.0_no-ssp.so -x c - <<< "void x() {}"
$ gcc-9.1.0 -fstack-protector -shared -fPIC -Wl,--as-needed -o test_gcc-9.1.0_ssp.so -x c - <<< "void x() {}"
$ gcc-9.1.0 -fstack-protector-strong -shared -fPIC -Wl,--as-needed -o test_gcc-9.1.0_ssp-strong.so -x c - <<< "void x() {}"
$ gcc-9.1.0 -fstack-protector-all -shared -fPIC -Wl,--as-needed -o test_gcc-9.1.0_ssp-all.so -x c - <<< "void x() {}"
$ scanelf -F "%F: %n" test_gcc-8.3.0_{no-ssp,ssp,ssp-strong,ssp-all}.so
FILE NEEDED 
test_gcc-8.3.0_no-ssp.so: libc.so.6
test_gcc-8.3.0_ssp.so: libc.so.6
test_gcc-8.3.0_ssp-strong.so: libc.so.6
test_gcc-8.3.0_ssp-all.so: libc.so.6
$ scanelf -F "%F: %n" test_gcc-9.1.0_{no-ssp,ssp,ssp-strong,ssp-all}.so
FILE NEEDED 
test_gcc-9.1.0_no-ssp.so: 
test_gcc-9.1.0_ssp.so: 
test_gcc-9.1.0_ssp-strong.so: 
test_gcc-9.1.0_ssp-all.so: libc.so.6
$ nm -D test_gcc-8.3.0_{no-ssp,ssp,ssp-strong,ssp-all}.so

test_gcc-8.3.0_no-ssp.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-8.3.0_ssp.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-8.3.0_ssp-strong.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-8.3.0_ssp-all.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
                 U __stack_chk_fail
0000000000001128 T x
$ nm -D test_gcc-9.1.0_{no-ssp,ssp,ssp-strong,ssp-all}.so

test_gcc-9.1.0_no-ssp.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-9.1.0_ssp.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-9.1.0_ssp-strong.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
0000000000001118 T x

test_gcc-9.1.0_ssp-all.so:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize
                 w __gmon_start__
                 U __stack_chk_fail
0000000000001128 T x



So GCC 8.3.0 with -Wl,--as-needed (when -nostdlib is not used) performs linking against libc.so.6 even when created library has no undefined non-weak symbols which are defined in libc.so.6, but GCC 9.1.0 does not.