build,stage1: include systemd dir when checking libs #3186
Conversation
9e9fbbf
to
732040c
Compare
LGTM if green. |
732040c
to
d40155b
Compare
This works on my machine to build stage1-src-master. |
SLD_INCLUDED := x | ||
SLD_LOCATIONS := $(shell ld --verbose | grep SEARCH_DIR | sed -e 's/SEARCH_DIR("=*\([^"]*\)");*/\1/g') | ||
SLD_LOCATIONS := $(foreach l,$(SLD_LOCATIONS),$l$(SLD_SPACE)$l/systemd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLD_LOCATIONS += $(foreach l,$(SLD_LOCATIONS),$l/systemd)
should be fine.
But anyway, something like /usr/lib64/systemd
rather shouldn't be considered to be a lib dir that is used by a dynamic loader, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, after short investigation, we noticed that systemd binaries linking to the libsystemd-shared.so which is not placed in the usual libdir (it is something like /usr/lib/systemd
) have an RPATH set.
For now I'm fine with hardcoding /usr/lib/systemd
or else, because src
flavor is meant to be used by developers only.
In the src flavor, we have some code to copy missing libraries from the host to stage1 if they're not already present after building systemd. In systemd v231, libshared was converted into a private shared library living in `/usr/lib/systemd` (systemd/systemd#3516). However, the logic that detects if a library is present or not was not taking into account `$ROOTFS/usr/lib/systemd`, only `$ROOTFS/usr/lib`. So the host's library overwrote the `libsystemd-shared-231.so` generated by the systemd build, causing general madness. Add the systemd directory to the list of paths to check.
d40155b
to
2cd16d6
Compare
Thx for the review. Updated! |
LFAD. |
didn't this fix a bug, or did we never have one filed? |
It's quite unlikely that an issue was filed - a bug appears only in the src flavor and probably the only users of this flavor are rkt developers. |
In the src flavor, we have some code to copy missing libraries from the
host to stage1 if they're not already present after building systemd.
In systemd v231, libshared was converted into a private shared library
living in
/usr/lib/systemd
(systemd/systemd#3516).However, the logic that detects if a library is present or not was not
taking into account
$ROOTFS/usr/lib/systemd
, only$ROOTFS/usr/lib
.So the host's library overwrote the
libsystemd-shared-231.so
generatedby the systemd build, causing general madness.
Add the systemd directory to the list of paths to check.