On Fri, 23 Mar 2018, Peter Hessler wrote:
> Yes, packages for 6.3 will be built for armv7. Having gcc-4.9 available
> would be quite nice. Thanks for looking into this.
>
> I see from your other mail, the configure patch isn't helpful so I'll
> wait for the next info.
The obvious solution is to inject the -fbracket-depth=512 parameter only
if CC is actually clang. The patches below survived a FLAVOR=full build on
my armv7 board. I did a build with those patches on amd64 and i386 to make
sure no side effects were introduced.
It took a long time to build with FLAVOR=full ...
Index: patches/patch-gcc_configure
===================================================================
RCS file: /cvs/ports/lang/gcc/4.9/patches/patch-gcc_configure,v
retrieving revision 1.5
diff -u -p -r1.5 patch-gcc_configure
--- patches/patch-gcc_configure 1 Sep 2016 17:30:33 -0000 1.5
+++ patches/patch-gcc_configure 24 Mar 2018 11:39:19 -0000
@@ -1,7 +1,20 @@
$OpenBSD: patch-gcc_configure,v 1.5 2016/09/01 17:30:33 pascal Exp $
---- gcc/configure.orig Sun May 22 10:53:32 2016
-+++ gcc/configure Sat Aug 6 19:19:05 2016
-@@ -17367,7 +17367,7 @@ openbsd*)
+Index: gcc/configure
+--- gcc/configure.orig
++++ gcc/configure
+@@ -6597,6 +6597,11 @@ $as_echo "$ac_res" >&6; }
+ fi
+ done
+ CFLAGS="$save_CFLAGS"
++if [[ `uname -m` == armv7 ]] ; then
++ if $CC --version 2>&1 | grep clang; then
++ noexception_flags="$noexception_flags -fbracket-depth=512"
++ fi
++fi
+
+
+ # Enable expensive internal checks
+@@ -17367,7 +17372,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix
${libname}${shared_ext}$versuffix'
@@ -10,7 +23,7 @@ $OpenBSD: patch-gcc_configure,v 1.5 2016
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test
"$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
-@@ -21027,7 +21027,7 @@ openbsd*)
+@@ -21027,7 +21032,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix
${libname}${shared_ext}$versuffix'
@@ -19,7 +32,7 @@ $OpenBSD: patch-gcc_configure,v 1.5 2016
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test
"$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
-@@ -27522,6 +27522,7 @@ else
+@@ -27522,6 +27527,7 @@ else
fi
;;
Index: patches/patch-gcc_system_h
===================================================================
RCS file: patches/patch-gcc_system_h
diff -N patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-gcc_system_h 24 Mar 2018 11:39:19 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -231,6 +231,7 @@ extern int errno;
+ file uses a standard library header that includes <cstdlib>, we will get
+ an error about 'using std::malloc'. */
+ #ifdef __cplusplus
++#include <new>
+ #include <cstdlib>
+ #endif
+