summaryrefslogtreecommitdiff
path: root/user/gnucobol/keep-debug-flags.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/gnucobol/keep-debug-flags.patch')
-rw-r--r--user/gnucobol/keep-debug-flags.patch53
1 files changed, 36 insertions, 17 deletions
diff --git a/user/gnucobol/keep-debug-flags.patch b/user/gnucobol/keep-debug-flags.patch
index 40c188802..625a5002b 100644
--- a/user/gnucobol/keep-debug-flags.patch
+++ b/user/gnucobol/keep-debug-flags.patch
@@ -1,6 +1,6 @@
---- gnucobol-3.0-rc1/configure.ac 2018-04-22 22:00:19.000000000 +0000
-+++ gnucobol-3.0-rc1/configure.ac 2019-06-28 12:09:56.160772995 +0000
-@@ -1216,40 +1216,6 @@
+--- gnucobol-3.1.2/configure.ac 2020-12-23 05:51:14.000000000 -0500
++++ gnucobol-3.1.2/configure.ac 2021-05-03 02:35:16.051807283 -0400
+@@ -1854,59 +1854,6 @@ if test "$COB_USES_CLANG_ONLY" = "yes";
fi
@@ -18,26 +18,45 @@
- cob_temp_flags="$CPPFLAGS"
- fi
-fi
--if test "x$cob_temp_flags" != "x"; then
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-g3//' -e 's/-g//' -e 's/ $//' -e 's/^ //'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/@<:@+-@:>@O@<:@0-9s@:>@//' -e 's/ $//' -e 's/^ //'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-O//' -e 's/ $//' -e 's/^ //'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-fmessage-length=0//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-D_FORTIFY_SOURCE=.//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-fstack-protector-strong//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-fstack-protector-all//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-fstack-protector//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-funwind-tables//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/-fasynchronous-unwind-tables//'`
-- cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/ */ /g' -e 's/ $//' -e 's/^ //'`
+-
+-#
+-# Add CFLAGS and CPPFLAGS to COB_CFLAGS, minus optimization/debug options.
+-
+-cob_temp_flags="$CFLAGS $CPPFLAGS"
+-
+-if test "$enable_hardening" = no; then
+- cob_temp_flags=$(echo x$cob_temp_flags | \
+- sed -e 's/^x//' \
+- -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' \
+- -e 's/-D_FORTIFY_SOURCE=.//g' \
+- -e 's/-fmessage-length=0//g' \
+- -e 's/-fstack-protector-strong//g' \
+- -e 's/-fstack-protector-all//g' \
+- -e 's/-fstack-protector//g' \
+- )
-fi
-
+-cob_temp_flags=$(echo x$cob_temp_flags | \
+- sed -e 's/^x//' \
+- -e 's/-g\(db\)\{0,1\}[[0-9 ]]//g' \
+- -e 's/-g\(db\)\{0,1\}$//' \
+- -e 's/[[+-]]O[[0-9s]]*//g' \
+- -e 's/-O//g' \
+- -e 's/-funwind-tables//g' \
+- -e 's/-fasynchronous-unwind-tables//g' \
+- -e 's/ / /g' \
+- -e 's/ $//g' \
+- )
+-
-if test "x$cob_temp_flags" != "x"; then
-- COB_CFLAGS="$COB_CFLAGS $cob_temp_flags"
+- COB_CFLAGS="$cob_temp_flags $COB_CFLAGS"
+-fi
+-if test "$enable_hardening" = "yes"; then
+- # needs optimization
+- COB_CFLAGS="$COB_CFLAGS -O"
-fi
-unset cob_temp_flags
-
--
# Special stuff
AH_VERBATIM([_XOPEN_SOURCE_EXTENDED],