From f41d1e587349e105b1ec32b2a461a0f000eb2676 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Sep 11 2016 21:31:42 +0000 Subject: Fix {debug,release}-dependent stripping behaviour when building John the Ripper, netcat, pkg-cron and OpenSSH (via midipix.) --- diff --git a/build.subr b/build.subr index c79872f..401dd82 100644 --- a/build.subr +++ b/build.subr @@ -251,7 +251,13 @@ parse_with_pkg_name() { if [ -n "$(get_var_unsafe PKG_LVL${PKG_LVL}_${_pwpn_vname})" ]; then export "PKG_${_pwpn_vname}=$(get_var_unsafe PKG_LVL${PKG_LVL}_${_pwpn_vname})"; fi; - if [ -n "$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname})" ]; then + if [ "${BUILD}" = "debug" ] \ + && [ -n "$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname}_DEBUG)" ]; then + export "PKG_${_pwpn_vname}=$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname}_DEBUG)"; + elif [ "${BUILD}" = "release" ] \ + && [ -n "$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname}_RELEASE)" ]; then + export "PKG_${_pwpn_vname}=$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname}_RELEASE)"; + elif [ -n "$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname})" ]; then export "PKG_${_pwpn_vname}=$(get_var_unsafe PKG_${_pwpn_pkg_NAME}_${_pwpn_vname})"; fi; done; unset _pwpn_vname; diff --git a/build.vars b/build.vars index f4c62e1..ff6f6fd 100644 --- a/build.vars +++ b/build.vars @@ -381,6 +381,7 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; : ${PKG_CRON_BUILD_DIR:=pkg-cron.git}; : ${PKG_CRON_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PKG_LVL3_CFLAGS_CONFIGURE} -D__GNU__"}; : ${PKG_CRON_GIT_BRANCH:=debian/3.0pl1-128}; +: ${PKG_CRON_MAKEFLAGS_INSTALL_EXTRA_RELEASE:="INSTALLFLAGS=-s"}; : ${PKG_CURL_VERSION:=7.47.1}; : ${PKG_CURL_SHA256SUM:=ddc643ab9382e24bbe4747d43df189a0a6ce38fcb33df041b9cb0b3cd47ae98f}; : ${PKG_CURL_URL:=https://curl.haxx.se/download/curl-${PKG_CURL_VERSION}.tar.bz2}; @@ -437,7 +438,8 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; : ${PKG_JOHN_URL:=http://www.openwall.com/john/j/john-${PKG_JOHN_VERSION}.tar.xz}; : ${PKG_JOHN_BUILD_DIR:=john-${PKG_JOHN_VERSION}}; : ${PKG_JOHN_INSTALL_FILES:="run/john=bin/ run/mailer=bin/ run/makechr=bin/ run/relbench=bin/ run/unafs=bin/ run/unique=bin/ run/unshadow=bin/ /=share/john run/ascii.chr=share/john/ run/digits.chr=share/john/ run/john.conf=share/john/ run/lm_ascii.chr=share/john/ run/password.lst=share/john/"}; -: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA:="-C src midipix-x86-64"}; +: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA_DEBUG:="-C src midipix-x86-64"}; +: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA_RELEASE:="-C src midipix-x86-64 LDFLAGS_DEBUG=-s"}; : ${PKG_JOHN_MAKEFLAGS_INSTALL_EXTRA:="-C src"}; : ${PKG_JOHN_NO_MAKE_INSTALL:=1}; : ${PKG_JOHN_SUBDIR:=john-${PKG_JOHN_VERSION}}; @@ -484,7 +486,8 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; : ${PKG_NETCAT_SHA256SUM:=5b3fda14e972d908896a605293f4634a72e2968278117410e12d8b3faf9a3976}; : ${PKG_NETCAT_URL:=https://dl.packetstormsecurity.net/UNIX/netcat/nc110.tgz}; : ${PKG_NETCAT_BUILD_DIR:=nc110}; -: ${PKG_NETCAT_MAKEFLAGS_BUILD_EXTRA:="midipix CC=${TARGET}-gcc"}; +: ${PKG_NETCAT_MAKEFLAGS_BUILD_EXTRA_DEBUG:="midipix CC=${TARGET}-gcc"}; +: ${PKG_NETCAT_MAKEFLAGS_BUILD_EXTRA_RELEASE:="midipix CC=${TARGET}-gcc LDFLAGS_DEBUG=-s"}; : ${PKG_NETCAT_ENV_VARS_EXTRA:="CFLAGS_EXTRA=${PKG_LVL3_CFLAGS_CONFIGURE}:LDFLAGS=${PKG_LVL3_LDFLAGS_CONFIGURE}"}; : ${PKG_NETCAT_INSTALL_FILES:=nc=bin/}; : ${PKG_NETCAT_NO_MAKE_INSTALL:=1}; @@ -493,6 +496,7 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}"; : ${PKG_OPENSSH_VERSION:=7.1p2}; : ${PKG_OPENSSH_SHA256SUM:=dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd}; : ${PKG_OPENSSH_URL:=http://artfiles.org/openbsd/OpenSSH/portable/openssh-${PKG_OPENSSH_VERSION}.tar.gz}; +: ${PKG_OPENSSH_CONFIGURE_ARGS_EXTRA_DEBUG:=--disable-strip}; : ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys}; : ${PKG_PACMAN_VERSION:=5.0.1}; : ${PKG_PACMAN_SHA256SUM:=84599e2ee2158134fd704f1cd681ea46e021165bed4df5f002aa1748caef9e7b}; diff --git a/john-1.8.0.local.patch b/john-1.8.0.local.patch index 8ffcc91..c3d9dff 100644 --- a/john-1.8.0.local.patch +++ b/john-1.8.0.local.patch @@ -63,9 +63,17 @@ diff -ru a/src/DES_bs.h b/src/DES_bs.h /* * Another special-case version: a non-zero IV, no salts, no iterations. -diff -ru a/src/Makefile b/src/Makefile ---- a/src/Makefile 2013-05-29 19:21:25.000000000 -0400 -+++ b/src/Makefile 2016-08-07 16:23:07.246422700 -0400 +--- john-1.8.0/src/Makefile.orig 2013-05-29 23:21:25.000000000 +0000 ++++ john-1.8.0/src/Makefile 2016-09-11 21:19:18.930129331 +0000 +@@ -32,7 +32,7 @@ + # CFLAGS for use on the main john.c file only + CFLAGS_MAIN = $(CFLAGS) + ASFLAGS = -c $(OMPFLAGS) +-LDFLAGS = -s $(OMPFLAGS) ++LDFLAGS = $(LDFLAGS_DEBUG) $(OMPFLAGS) + OPT_NORMAL = -funroll-loops + # Remove the "-Os" if you're using an ancient version of gcc + OPT_INLINE = -Os -funroll-loops -finline-functions @@ -104,6 +104,8 @@ # @echo "linux-ppc64-altivec Linux, PowerPC 64-bit w/AltiVec" @echo "linux-ppc64 Linux, PowerPC 64-bit" @@ -98,4 +106,3 @@ diff -ru a/src/Makefile b/src/Makefile freebsd-x86-64: $(LN) x86-64.h arch.h $(MAKE) $(PROJ) \ - diff --git a/nc110.local.patch b/nc110.local.patch index 5c07fe2..fcf6353 100644 --- a/nc110.local.patch +++ b/nc110.local.patch @@ -1,6 +1,6 @@ --- nc110/Makefile.orig 1996-03-20 03:16:06.000000000 +0000 -+++ nc110/Makefile 2016-06-28 17:26:50.985424240 +0000 -@@ -9,12 +9,12 @@ ++++ nc110/Makefile 2016-09-11 20:44:21.896119203 +0000 +@@ -9,13 +9,13 @@ # pick gcc if you'd rather , and/or do -g instead of -O if debugging # debugging # DFLAGS = -DTEST -DDEBUG @@ -11,10 +11,12 @@ # -Bstatic for sunos, -static for gcc, etc. You want this, trust me. STATIC = -CC = cc $(CFLAGS) +-LD = $(CC) -s # linker; defaults to stripped executables +CC = cc ${CFLAGS} - LD = $(CC) -s # linker; defaults to stripped executables ++LD = $(CC) $(LDFLAGS_DEBUG) # linker; defaults to stripped executables o = o # object extension + ALL = nc @@ -28,7 +28,7 @@ ### HARD TARGETS diff --git a/pkg-cron.git.local.patch b/pkg-cron.git.local.patch index adb254e..4d6bc53 100644 --- a/pkg-cron.git.local.patch +++ b/pkg-cron.git.local.patch @@ -1,5 +1,14 @@ ---- pkg-cron.git/Makefile.orig 2016-07-04 15:39:29.482061697 +0000 -+++ pkg-cron.git/Makefile 2016-07-04 15:41:34.770058916 +0000 +--- pkg-cron.git/Makefile.orig 2016-07-11 19:06:33.212362869 +0000 ++++ pkg-cron.git/Makefile 2016-09-11 20:37:42.714987721 +0000 +@@ -79,7 +79,7 @@ + #DEFS = -D_BSD_SIGNALS -Dconst= + #<> + #INSTALL = installbsd +-INSTALL = install -s ++INSTALL = install $(INSTALLFLAGS) + #<> + # LDFLAGS = -s + # Let install do the strip @@ -118,8 +118,8 @@ $(CC) $(LDFLAGS) -o crontab $(CRONTAB_OBJ) $(LIBS) diff --git a/pkg.build b/pkg.build index 99d6f65..50cd17a 100644 --- a/pkg.build +++ b/pkg.build @@ -135,7 +135,7 @@ if [ -x ../${PKG_SUBDIR}/configure ]\ CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}"\ LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}"\ ../${PKG_SUBDIR}/configure \ - ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA}; + ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG}; set_build_script_done configure clean -build; else __no_autoconf=1;