From 39b86fa4aea725bf8020389cbfb81c8eac5f848d Mon Sep 17 00:00:00 2001 From: Stephan Hartmann Date: Sun, 15 May 2022 13:10:36 +0200 Subject: app-shells/ksh: fix building with gcc-12 Bug: https://bugs.gentoo.org/840538 Signed-off-by: Stephan Hartmann --- app-shells/ksh/files/ksh-1.0.0-beta.2-gcc12.patch | 63 +++++++++++++++++++++++ app-shells/ksh/ksh-1.0.0_beta2.ebuild | 4 ++ 2 files changed, 67 insertions(+) create mode 100644 app-shells/ksh/files/ksh-1.0.0-beta.2-gcc12.patch (limited to 'app-shells/ksh') diff --git a/app-shells/ksh/files/ksh-1.0.0-beta.2-gcc12.patch b/app-shells/ksh/files/ksh-1.0.0-beta.2-gcc12.patch new file mode 100644 index 000000000000..1d46cc3b3f5e --- /dev/null +++ b/app-shells/ksh/files/ksh-1.0.0-beta.2-gcc12.patch @@ -0,0 +1,63 @@ +From 4a1dbcbaa04b6edf4c8c5d950031c6d853acf358 Mon Sep 17 00:00:00 2001 +From: Vincent Mihalkovic +Date: Wed, 11 May 2022 14:27:35 +0200 +Subject: [PATCH] Mamfile: add -lm flag where needed + +--- + src/cmd/builtin/Mamfile | 2 +- + src/cmd/ksh93/Mamfile | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/cmd/builtin/Mamfile b/src/cmd/builtin/Mamfile +index 16974ae54ad2..f6e726105e43 100644 +--- a/src/cmd/builtin/Mamfile ++++ b/src/cmd/builtin/Mamfile +@@ -50,7 +50,7 @@ make install + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c + done pty.o generated + bind -lutil dontcare +- exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd} ++ exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd} -lm + done pty generated + make ${INSTALLROOT}/bin + exec - if silent test ! -d ${INSTALLROOT}/bin +diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile +index 3936ff926902..e2899523b634 100644 +--- a/src/cmd/ksh93/Mamfile ++++ b/src/cmd/ksh93/Mamfile +@@ -1219,7 +1219,7 @@ make install + make data/math.tab implicit + done data/math.tab + done features/math.sh dontcare +- exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab ++ exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} -lm : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab + make ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_standards.h dontcare + make ${INSTALLROOT}/src/lib/libast/FEATURE/float implicit +@@ -1386,7 +1386,7 @@ make install + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} +- exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libast} ++ exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libast} -lm + done ksh generated + make shcomp + make shcomp.o +@@ -1408,7 +1408,7 @@ make install + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} +- exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} ++ exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} -lm + done shcomp generated + make suid_exec + make suid_exec.o +@@ -1429,7 +1429,7 @@ make install + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} +- exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast} ++ exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast} -lm + done suid_exec generated + make shell + prev libshell.a archive diff --git a/app-shells/ksh/ksh-1.0.0_beta2.ebuild b/app-shells/ksh/ksh-1.0.0_beta2.ebuild index 6ff7b141d0d7..297d09947372 100644 --- a/app-shells/ksh/ksh-1.0.0_beta2.ebuild +++ b/app-shells/ksh/ksh-1.0.0_beta2.ebuild @@ -18,6 +18,10 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~ S="${WORKDIR}/${PN}-${MY_PV}" +PATCHES=( + "${FILESDIR}/ksh-1.0.0-beta.2-gcc12.patch" +) + src_prepare() { default -- cgit v1.2.3-65-gdbad