Skip to content

Commit

Permalink
Merge SVN 5167
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jan 27, 2025
1 parent 47cb2ba commit 4cfc80b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
16 changes: 10 additions & 6 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

* configure.ac: replace AC_ARG_VAR by AC_SUBST where appropriate

2024-05-14 David Declerck <[email protected]>

* configure.ac: update flags for building dynamic libraries on macOS
(helps fixing testsuite issues on recent macOS versions)

2023-08-22 Simon Sobisch <[email protected]>

* configure.ac: add -fstack-clash-protection to --enable-hardening[=no]

2023-07-28 Simon Sobisch <[email protected]>

* configure.ac, NEWS: updated for 3.2
Expand All @@ -12,11 +21,6 @@

* configure.ac: fix for resolving COBCRUN_NAME

2024-05-14 David Declerck <[email protected]>

* configure.ac: update flags for building dynamic libraries on macOS
(helps fixing testsuite issues on recent macOS versions)

2023-05-25 Chuck Haatvedt <[email protected]>

* configure.ac: added test for HAVE_RESIZE_TERM function
Expand Down Expand Up @@ -1687,7 +1691,7 @@
* Version 0.9 released.


Copyright 2002-2023 Free Software Foundation, Inc.
Copyright 2002-2024 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification, are
permitted provided the copyright notice and this notice are preserved.
29 changes: 23 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ AC_ARG_ENABLE([debug],

AC_ARG_ENABLE([hardening],
[AS_HELP_STRING([--enable-hardening, --disable-hardening],
[Enable GNU C "hardening" options: define _FORTIFY_SOURCE and use -fstack-protector.
[Enable GNU C "hardening" options: define _FORTIFY_SOURCE and use,
depending on the availability -fstack-protector-strong / -fstack-protector,
as well as -fstack-clash-protection.
If disabled, these are explicit removed from CFLAGS for building GnuCOBOL.
Defaults to "defined by CFLAGS".])],,
[enable_hardening="unset"])
Expand Down Expand Up @@ -2391,11 +2393,25 @@ AS_IF([test "$enable_hardening" = yes], [
[CFLAGS="$curr_cflags"; cob_temp_flags=""; AC_MSG_RESULT([no])])
])
if test "x$cob_temp_flags" != x; then
if test "x$COB_LDFLAGS" != x; then
COB_LDFLAGS="$COB_LDFLAGS $cob_temp_flags"
else
COB_LDFLAGS="$cob_temp_flags"
fi
if test "x$COB_LDFLAGS" != x; then
COB_LDFLAGS="$COB_LDFLAGS $cob_temp_flags"
else
COB_LDFLAGS="$cob_temp_flags"
fi
curr_cflags="$curr_cflags $cob_temp_flags"
fi
cob_temp_flags="-fstack-clash-protection"
CFLAGS="$curr_cflags $cob_temp_flags $ERRWARN"
AC_MSG_CHECKING([for $cob_temp_flags option])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],
[AC_MSG_RESULT([yes])],
[CFLAGS="$curr_cflags"; cob_temp_flags=""; AC_MSG_RESULT([no])])
if test "x$cob_temp_flags" != x; then
if test "x$COB_LDFLAGS" != x; then
COB_LDFLAGS="$COB_LDFLAGS $cob_temp_flags"
else
COB_LDFLAGS="$cob_temp_flags"
fi
CFLAGS="$curr_cflags $cob_temp_flags"
else
CFLAGS="$curr_cflags"
Expand Down Expand Up @@ -2504,6 +2520,7 @@ if test "$enable_hardening" = no; then
-e 's/-fstack-protector-strong//g' \
-e 's/-fstack-protector-all//g' \
-e 's/-fstack-protector//g' \
-e 's/-fstack-clash-protection//g' \
)
fi
Expand Down

0 comments on commit 4cfc80b

Please sign in to comment.