On Jun 27, 2023, at 10:48 AM, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2023/06/27 08:18, Kurt Miller wrote: >> The CLA situation is no more. Greg and I have given up on getting >> BSD support merged upstream. It became clear that Oracle would not >> accept our code without a deep pocket corporation backing the >> effort. >> >> If you have tested diffs already baked, please go ahead and commit >> them. I can build new bootstraps after it lands. > > Not super-tidy, but this does the trick. I don't see how to tell > for sure whether a binary is built with this or not (it's possible > that it's "LOOS+5a3dbe8" in readelf -l) so I haven't made any > extra checks like are done for wxneeded. > > Will commit it to move ahead, happy to test any tweaks if wanted.
This is fine for now. Okay kurt@ > Index: 1.8/Makefile > =================================================================== > RCS file: /cvs/ports/devel/jdk/1.8/Makefile,v > retrieving revision 1.81 > diff -u -p -r1.81 Makefile > --- 1.8/Makefile 19 May 2023 01:43:08 -0000 1.81 > +++ 1.8/Makefile 27 Jun 2023 14:11:22 -0000 > @@ -1,5 +1,6 @@ > ONLY_FOR_ARCHS= i386 amd64 aarch64 sparc64 > USE_WXNEEDED= Yes > +USE_NOBTCFI= Yes > DPB_PROPERTIES= parallel > > COMMENT= OpenJDK Software Development Kit v${V} > @@ -11,7 +12,7 @@ V= ${BASE_VER}.${UPDATE_VER}.${BUILD_VE > PKGNAME= jdk-${V} > PKGSTEM= jdk-${BASE_VER} > EPOCH= 0 > -REVISION= 0 > +REVISION= 1 > > DIST_SUBDIR= jdk > DISTNAME= jdk8u${UPDATE_VER}-${BUILD_VER}.${BSD_PORT_REL} > Index: 1.8/patches/patch-common_autoconf_generated-configure_sh > =================================================================== > RCS file: 1.8/patches/patch-common_autoconf_generated-configure_sh > diff -N 1.8/patches/patch-common_autoconf_generated-configure_sh > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ 1.8/patches/patch-common_autoconf_generated-configure_sh 27 Jun 2023 > 14:11:22 -0000 > @@ -0,0 +1,21 @@ > +Index: common/autoconf/generated-configure.sh > +--- common/autoconf/generated-configure.sh.orig > ++++ common/autoconf/generated-configure.sh > +@@ -41202,7 +41202,7 @@ fi > + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld requires -z > wxneeded" >&5 > + $as_echo_n "checking if ld requires -z wxneeded... " >&6; } > + PUSHED_LDFLAGS="$LDFLAGS" > +- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded" > ++ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + cat confdefs.h - <<_ACEOF >conftest.$ac_ext > + /* end confdefs.h. */ > + int main() { } > +@@ -41212,7 +41212,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : > + if $READELF -l conftest$ac_exeext | $GREP OPENBSD_WXNEED > > /dev/null; then > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 > + $as_echo "yes" >&6; } > +- LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded" > ++ LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + else > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 > + $as_echo "yes" >&6; } > Index: 1.8/patches/patch-common_autoconf_toolchain_m4 > =================================================================== > RCS file: 1.8/patches/patch-common_autoconf_toolchain_m4 > diff -N 1.8/patches/patch-common_autoconf_toolchain_m4 > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ 1.8/patches/patch-common_autoconf_toolchain_m4 27 Jun 2023 14:11:22 -0000 > @@ -0,0 +1,18 @@ > +Index: common/autoconf/toolchain.m4 > +--- common/autoconf/toolchain.m4.orig > ++++ common/autoconf/toolchain.m4 > +@@ -855,12 +855,12 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], > + if test "`uname -s`" = "OpenBSD"; then > + AC_MSG_CHECKING([if ld requires -z wxneeded]) > + PUSHED_LDFLAGS="$LDFLAGS" > +- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded" > ++ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { }]])], > + [ > + if $READELF -l conftest$ac_exeext | $GREP OPENBSD_WXNEED > > /dev/null; then > + AC_MSG_RESULT([yes]) > +- LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded" > ++ LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + else > + AC_MSG_RESULT([yes]) > + fi > Index: 11/Makefile > =================================================================== > RCS file: /cvs/ports/devel/jdk/11/Makefile,v > retrieving revision 1.45 > diff -u -p -r1.45 Makefile > --- 11/Makefile 17 Jun 2023 21:15:29 -0000 1.45 > +++ 11/Makefile 27 Jun 2023 14:11:22 -0000 > @@ -1,5 +1,6 @@ > ONLY_FOR_ARCHS= i386 amd64 aarch64 > USE_WXNEEDED= Yes > +USE_NOBTCFI= Yes > DPB_PROPERTIES= parallel > > COMMENT= OpenJDK Software Development Kit v${VERSION_STR} > @@ -11,7 +12,7 @@ PACKAGE_VER= ${BASE_VER}.${PATCH_VER}.${ > PKGNAME= jdk-${PACKAGE_VER} > PKGSTEM= jdk-11 > EPOCH= 0 > -REVISION= 1 > +REVISION= 2 > > DIST_SUBDIR= jdk > DISTNAME= jdk-${VERSION_STR} > Index: 11/patches/patch-make_autoconf_flags-ldflags_m4 > =================================================================== > RCS file: 11/patches/patch-make_autoconf_flags-ldflags_m4 > diff -N 11/patches/patch-make_autoconf_flags-ldflags_m4 > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ 11/patches/patch-make_autoconf_flags-ldflags_m4 27 Jun 2023 14:11:22 -0000 > @@ -0,0 +1,18 @@ > +Index: make/autoconf/flags-ldflags.m4 > +--- make/autoconf/flags-ldflags.m4.orig > ++++ make/autoconf/flags-ldflags.m4 > +@@ -127,12 +127,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], > + if test "x$OPENJDK_TARGET_OS_ENV" = xbsd.openbsd; then > + AC_MSG_CHECKING([if ld requires -z wxneeded]) > + PUSHED_LDFLAGS="$LDFLAGS" > +- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded" > ++ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { }]])], > + [ > + if $READELF -l conftest$ac_exeext | $GREP WXNEED > /dev/null; > then > + AC_MSG_RESULT([yes]) > +- OS_LDFLAGS="-Wl,-z,wxneeded" > ++ OS_LDFLAGS="-Wl,-z,wxneeded -Wl,-z,nobtcfi" > + else > + AC_MSG_RESULT([no]) > + fi > Index: 17/Makefile > =================================================================== > RCS file: /cvs/ports/devel/jdk/17/Makefile,v > retrieving revision 1.18 > diff -u -p -r1.18 Makefile > --- 17/Makefile 17 Jun 2023 21:15:29 -0000 1.18 > +++ 17/Makefile 27 Jun 2023 14:11:22 -0000 > @@ -1,5 +1,6 @@ > ONLY_FOR_ARCHS= i386 amd64 aarch64 > USE_WXNEEDED= Yes > +USE_NOBTCFI= Yes > DPB_PROPERTIES= parallel > > COMMENT= OpenJDK Software Development Kit v${VERSION_STR} > @@ -11,7 +12,7 @@ PACKAGE_VER= ${BASE_VER}.${PATCH_VER}.${ > PKGNAME= jdk-${PACKAGE_VER} > PKGSTEM= jdk-17 > EPOCH= 0 > -REVISION= 1 > +REVISION= 2 > > DIST_SUBDIR= jdk > DISTNAME= jdk-${VERSION_STR} > Index: 17/patches/patch-make_autoconf_flags-ldflags_m4 > =================================================================== > RCS file: 17/patches/patch-make_autoconf_flags-ldflags_m4 > diff -N 17/patches/patch-make_autoconf_flags-ldflags_m4 > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ 17/patches/patch-make_autoconf_flags-ldflags_m4 27 Jun 2023 14:11:22 -0000 > @@ -0,0 +1,18 @@ > +Index: make/autoconf/flags-ldflags.m4 > +--- make/autoconf/flags-ldflags.m4.orig > ++++ make/autoconf/flags-ldflags.m4 > +@@ -127,12 +127,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], > + if test "x$OPENJDK_TARGET_OS_ENV" = xbsd.openbsd; then > + AC_MSG_CHECKING([if ld requires -z wxneeded]) > + PUSHED_LDFLAGS="$LDFLAGS" > +- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded" > ++ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi" > + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { }]])], > + [ > + if $READELF -l conftest$ac_exeext | $GREP WXNEED > /dev/null; > then > + AC_MSG_RESULT([yes]) > +- OS_LDFLAGS="-Wl,-z,wxneeded" > ++ OS_LDFLAGS="-Wl,-z,wxneeded -Wl,-z,nobtcfi" > + else > + AC_MSG_RESULT([no]) > + fi >