]> gcc.gnu.org Git - gcc.git/commitdiff
libphobos: Include <cet.h> to generate the CET marker for -fcf-protection
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 8 Sep 2020 12:54:56 +0000 (05:54 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 9 Sep 2020 17:37:54 +0000 (10:37 -0700)
Include <cet.h> to generate the CET marker for -fcf-protection to avoid

/bin/ld: ../libdruntime/.libs/libgdruntime_convenience.a(libgdruntime_convenience_la-switchcontext.o): error: missing IBT and SHSTK properties

when -z cet-report=error is passed to the linker to create libgphobos.so
and libgdruntime.so.

PR d/95680
* libdruntime/config/x86/switchcontext.S: Include <cet.h> to
generate the CET marker for -fcf-protection.

libphobos/libdruntime/config/x86/switchcontext.S

index 85f2e00d186650467cd38c5e70c2375401ddc3ef..f2f8efa218ecdb09f3f85ad65c6f10ef95eb22e4 100644 (file)
@@ -24,6 +24,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "../common/threadasm.S"
 
+/* NB: Generate the CET marker for -fcf-protection.  */
+#ifdef __CET__
+# include <cet.h>
+#endif
+
 #if defined(__i386__) && !defined(__CET__)
 
     .text
This page took 0.060378 seconds and 5 git commands to generate.