This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git


The following commit(s) were added to refs/heads/master by this push:
     new fed3689  Fix DAEMON-429 Enable control flow guard
fed3689 is described below

commit fed36896cbac1c7b524a047f4e973228d2d41ab7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 14 14:48:12 2024 +0100

    Fix DAEMON-429 Enable control flow guard
---
 src/changes/changes.xml                 | 9 ++++++---
 src/native/windows/include/Makefile.inc | 6 +++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8445ffa..d697071 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -45,9 +45,12 @@
       <action dev="ggregory" type="fix" due-to="step-security-bot, Gary 
Gregory">
         [StepSecurity] ci: Harden GitHub Actions #95.
       </action>
+      <action issue="DAEMON-429" dev="markt" type="fix">
+        Procrun. Enable Control Flow Guard for Windows binaries.
+      </action>
       <!-- Add -->
       <action type="add" dev="markt">
-        Add support for hybrid CRT builds.
+        Procrun. Add support for hybrid CRT builds.
       </action>
       <!-- Updates -->
       <action type="update" dev="ggregory" due-to="Dependabot">
@@ -58,8 +61,8 @@
         8.
       </action>
       <action type="update" dev="markt">
-        The minimum Windows versions supported are now Windows 10 and Windows
-        Server 2016.
+        Procrun. The minimum Windows versions supported are now Windows 10 and
+        Windows Server 2016.
       </action>
     </release>
     <release version="1.3.4" date="2023-05-12" description="Bug fix release">
diff --git a/src/native/windows/include/Makefile.inc 
b/src/native/windows/include/Makefile.inc
index b68766e..f26913e 100644
--- a/src/native/windows/include/Makefile.inc
+++ b/src/native/windows/include/Makefile.inc
@@ -177,9 +177,9 @@ MACHINE_LC=amd64
 
 !IF "$(BUILD)" == "RELEASE"
 !IF "$(CPU)" == "X86"
-OPT_CFLAGS = -O2 -Ob2 -Oy- -Zi -DNDEBUG
+OPT_CFLAGS = -O2 -Ob2 -Oy- -Zi -DNDEBUG -guard:cf
 !ELSE
-OPT_CFLAGS = -O2 -Ob2 -Zi -DNDEBUG
+OPT_CFLAGS = -O2 -Ob2 -Zi -DNDEBUG -guard:cf
 !ENDIF
 !ELSE
 OPT_CFLAGS = -Od -Zi -DDEBUG -D_DEBUG
@@ -227,7 +227,7 @@ COMMON_LFLAGS = /NOLOGO
 # Always add debugging to the linker
 OPT_LFLAGS = /INCREMENTAL:NO /DEBUG
 !IF "$(BUILD)" == "RELEASE"
-OPT_LFLAGS = $(OPT_LFLAGS) /OPT:REF
+OPT_LFLAGS = $(OPT_LFLAGS) /OPT:REF /guard:cf
 !IF DEFINED(STATIC_CRT) && "$(STATIC_CRT)" == "Hybrid"
 OPT_LFLAGS = $(OPT_LFLAGS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
 !ENDIF

Reply via email to