mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
shadow: link executables statically for -native variant
shadow 4.14.x adds a number of libraries it dynamically links with (md, bsd, attr). This causes troubles in setscene tasks where shadow executables are used (such as useradd), as pulling in the needed dynamic libraries needs unpleasant special-casing. (From OE-Core rev: 495ff95eae14a91c94187f78a0b30c7957c9b168) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
405cc80b6b
commit
ea9e07a3e2
@@ -21,6 +21,11 @@ DISABLE_STATIC:pn-libusb1-native = ""
|
||||
# needed by rust
|
||||
DISABLE_STATIC:pn-musl = ""
|
||||
|
||||
# needed by shadow-native to build static executables, particularly useradd
|
||||
DISABLE_STATIC:pn-attr-native = ""
|
||||
DISABLE_STATIC:pn-libbsd-native = ""
|
||||
DISABLE_STATIC:pn-libmd-native = ""
|
||||
|
||||
EXTRA_OECONF:append = "${DISABLE_STATIC}"
|
||||
|
||||
EXTRA_OECMAKE:append:pn-libical = " -DSHARED_ONLY=True"
|
||||
|
||||
@@ -47,6 +47,16 @@ EXTRA_OECONF += "--without-libcrack \
|
||||
|
||||
CFLAGS:append:libc-musl = " -DLIBBSD_OVERLAY"
|
||||
|
||||
# Force static linking of utilities so we can use from the sysroot/sstate for useradd
|
||||
# without worrying about the dependency libraries being available
|
||||
LDFLAGS:append:class-native = " -no-pie"
|
||||
do_compile:prepend:class-native () {
|
||||
sed -i -e 's#\(LIBS.*\)-lbsd#\1 ${STAGING_LIBDIR}/libbsd.a ${STAGING_LIBDIR}/libmd.a#g' \
|
||||
-e 's#\(LIBBSD.*\)-lbsd#\1 ${STAGING_LIBDIR}/libbsd.a ${STAGING_LIBDIR}/libmd.a#g' \
|
||||
-e 's#\(LIBATTR.*\)-lattr#\1 ${STAGING_LIBDIR}/libattr.a#g' \
|
||||
${B}/lib/Makefile ${B}/src/Makefile
|
||||
}
|
||||
|
||||
NSCDOPT = ""
|
||||
NSCDOPT:class-native = "--without-nscd"
|
||||
NSCDOPT:class-nativesdk = "--without-nscd"
|
||||
|
||||
Reference in New Issue
Block a user