diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2024-01-19 13:43:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-21 12:27:09 +0000 |
commit | b93562937737e97dbc8cb7c874e9913f6a285a34 (patch) | |
tree | 381c23261f11c14b1e3b8d0c56439b4dbc43635e /meta/recipes-extended | |
parent | 4a7b42fcf6981d3120c08091a7ed3d4d7bcd41f0 (diff) | |
download | openembedded-core-b93562937737e97dbc8cb7c874e9913f6a285a34.tar.gz |
shadow: replace static linking with dynamic libraries in a custom location and bundled with shadow
Despite our efforts to make static linking work, there have
been new reports of bizarre build failures:
https://lists.openembedded.org/g/openembedded-core/message/194006
https://lists.openembedded.org/g/openembedded-core/message/193907
This commit changes back to dynamic linking, but places
the libraries in a custom location, per RP's suggestion.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/shadow/shadow.inc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc index 43f456251a..b8e5e285c4 100644 --- a/meta/recipes-extended/shadow/shadow.inc +++ b/meta/recipes-extended/shadow/shadow.inc @@ -47,16 +47,6 @@ 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" @@ -161,6 +151,20 @@ do_install:append() { touch ${D}${sysconfdir}/subgid } +# Make executables look for dynamically linked libraries in a custom location, and install +# the needed libraries there. That way we can use them from sstate +# in setscene tasks without worrying about the dependency libraries being available. +do_install:append:class-native() { + binaries=$(find ${D}${base_bindir}/ ${D}${base_sbindir}/ ${D}${bindir}/ ${D}${sbindir}/ -executable -type f) + chrpath -k -r ${STAGING_DIR_NATIVE}/lib-shadow-deps $binaries + mkdir -p ${D}${STAGING_DIR_NATIVE}/lib-shadow-deps/ + install ${STAGING_LIBDIR_NATIVE}/libattr.so.* ${STAGING_LIBDIR_NATIVE}/libbsd.so.* ${STAGING_LIBDIR_NATIVE}/libmd.so.* ${D}${STAGING_DIR_NATIVE}/lib-shadow-deps/ + install ${D}${libdir}/*.so.* ${D}${STAGING_DIR_NATIVE}/lib-shadow-deps/ +} + +SYSROOT_DIRS:append:class-native = " ${STAGING_DIR_NATIVE}/lib-shadow-deps/" +INSANE_SKIP:${PN}:class-native = "already-stripped" + PACKAGES =+ "${PN}-base" FILES:${PN}-base = "\ ${base_bindir}/login.shadow \ |