From 9422c8f238265063a0c40a871087f8f478c8cab2 Mon Sep 17 00:00:00 2001 From: "Casper Ti. Vector" Date: Sun, 4 Feb 2018 00:08:09 +0800 Subject: [PATCH] busybox: fix `'/dev/nul'*` != `/dev/null` issue. cf. http://lists.busybox.net/pipermail/busybox/2018-March/086295.html --- srcpkgs/busybox/files/busybox.dotconfig | 2 +- srcpkgs/busybox/template | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/srcpkgs/busybox/files/busybox.dotconfig b/srcpkgs/busybox/files/busybox.dotconfig index b83ef020ae..9168210902 100644 --- a/srcpkgs/busybox/files/busybox.dotconfig +++ b/srcpkgs/busybox/files/busybox.dotconfig @@ -40,7 +40,7 @@ CONFIG_PLATFORM_LINUX=y # Build Options # # CONFIG_STATIC is not set -# CONFIG_PIE is not set +CONFIG_PIE=y # CONFIG_NOMMU is not set # CONFIG_BUILD_LIBBUSYBOX is not set # CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set diff --git a/srcpkgs/busybox/template b/srcpkgs/busybox/template index a37aee3cf1..750bf2d609 100644 --- a/srcpkgs/busybox/template +++ b/srcpkgs/busybox/template @@ -19,15 +19,6 @@ alternatives=" ntpd:ntpd:/etc/sv/busybox-ntpd vi:vi:/usr/bin/busybox" -_cflags() { - local t=$1 - local c="$CFLAGS" - case $t in - busybox-static) c="$c -static";; - esac - echo "$c" -} - do_configure() { mkdir -p src mv * src || true @@ -35,10 +26,15 @@ do_configure() { local t for t in busybox busybox-static; do mkdir -p $t - make -C $t CFLAGS="$(_cflags $t)" KBUILD_SRC=${wrksrc}/src \ - -f ${wrksrc}/src/Makefile defconfig + make -C $t KBUILD_SRC=${wrksrc}/src -f ${wrksrc}/src/Makefile defconfig cp -f ${FILESDIR}/${t}.dotconfig ${t}/.config + if [ "$t" = busybox-static ]; then + sed -e '/CONFIG_STATIC/ s/.*/CONFIG_STATIC=y/' \ + -e '/CONFIG_PIE/ s/.*/# CONFIG_PIE is not set/' \ + -i "$t"/.config + fi + case "$XBPS_TARGET_MACHINE" in *-musl) sed -i -e /CONFIG_FEATURE_VI_REGEX_SEARCH/s/y/n/ \ -e /CONFIG_FEATURE_MOUNT_NFS/s/y/n/ \ @@ -62,7 +58,7 @@ do_configure() { do_build() { local t for t in busybox busybox-static; do - make -C $t SKIP_STRIP=y CFLAGS="$(_cflags $t)" LFLAGS="$LDFLAGS" ${makejobs} + make -C $t SKIP_STRIP=y ${makejobs} done } do_check() {