Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

build,stage1: include systemd dir when checking libs #3186

Merged
merged 1 commit into from Sep 14, 2016

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Sep 12, 2016

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.

@alban
Copy link
Member

alban commented Sep 12, 2016

LGTM if green.

@iaguis
Copy link
Member Author

iaguis commented Sep 12, 2016

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)
Copy link
Collaborator

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?

Copy link
Collaborator

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.
@iaguis
Copy link
Member Author

iaguis commented Sep 14, 2016

Thx for the review. Updated!

@krnowak
Copy link
Collaborator

krnowak commented Sep 14, 2016

LFAD.

@krnowak krnowak merged commit efea0ef into rkt:master Sep 14, 2016
@jonboulle
Copy link
Contributor

didn't this fix a bug, or did we never have one filed?

@krnowak
Copy link
Collaborator

krnowak commented Sep 14, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants