From c6632dc9a8ee77ad66a8d62d736a9112de9e41c7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 8 Sep 2020 05:54:56 -0700 Subject: [PATCH] libphobos: Include to generate the CET marker for -fcf-protection Include 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 to generate the CET marker for -fcf-protection. --- libphobos/libdruntime/config/x86/switchcontext.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libphobos/libdruntime/config/x86/switchcontext.S b/libphobos/libdruntime/config/x86/switchcontext.S index 85f2e00d186..f2f8efa218e 100644 --- a/libphobos/libdruntime/config/x86/switchcontext.S +++ b/libphobos/libdruntime/config/x86/switchcontext.S @@ -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 +#endif + #if defined(__i386__) && !defined(__CET__) .text -- 2.43.5