<div dir="auto"><div dir="auto">On Fri, Dec 20, 2024, 11:22 AM Sam James <<a href="mailto:sam@gentoo.org">sam@gentoo.org</a>> wrote:</div><div class="gmail_quote gmail_quote_container" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"H.J. Lu" <<a href="mailto:hjl.tools@gmail.com" target="_blank" rel="noreferrer">hjl.tools@gmail.com</a>> writes:<br>
<br>
> Since Clang doesn't support nested function which is required to test<br>
> execstack, disable execstack tests for Clang.<br>
><br>
<br>
LGTM. It could maybe be simplified with the -Wl,z,execstack bits but I'm<br>
not going to worry about it for now.<br></blockquote></div><div dir="auto"><br></div><div dir="auto">I am working on v2 of all my clang patches. Will send out new ones soon.</div><div dir="auto"><br></div><div class="gmail_quote gmail_quote_container" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> Signed-off-by: H.J. Lu <<a href="mailto:hjl.tools@gmail.com" target="_blank" rel="noreferrer">hjl.tools@gmail.com</a>><br>
> ---<br>
> elf/Makefile | 6 ++++++<br>
> nptl/Makefile | 11 ++++++++++-<br>
> 2 files changed, 16 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/elf/Makefile b/elf/Makefile<br>
> index 9172d7306e..68fde4f226 100644<br>
> --- a/elf/Makefile<br>
> +++ b/elf/Makefile<br>
> @@ -557,12 +557,16 @@ endif<br>
> selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)<br>
> <br>
> ifneq ($(selinux-enabled),1)<br>
> +# NB: Clang doesn't support nested function which is needed to test<br>
> +# execstack.<br>
> +ifneq ($(have-test-clang),yes)<br>
> tests-execstack-yes = \<br>
> tst-execstack \<br>
> tst-execstack-needed \<br>
> tst-execstack-prog \<br>
> # tests-execstack-yes<br>
> endif<br>
> +endif<br>
> ifeq ($(have-depaudit),yes)<br>
> tests += \<br>
> tst-audit14 \<br>
> @@ -1146,7 +1150,9 @@ tests-pie += vismain<br>
> CFLAGS-vismain.c += $(PIE-ccflag)<br>
> endif<br>
> endif<br>
> +ifneq ($(have-test-clang),yes)<br>
> modules-execstack-yes = tst-execstack-mod<br>
> +endif<br>
> extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))<br>
> <br>
> # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special<br>
> diff --git a/nptl/Makefile b/nptl/Makefile<br>
> index 88077e27bb..ca112f684f 100644<br>
> --- a/nptl/Makefile<br>
> +++ b/nptl/Makefile<br>
> @@ -475,15 +475,18 @@ tests-internal += \<br>
> tst-tls5 \<br>
> # tests-internal<br>
> ifeq ($(have-z-execstack),yes)<br>
> +# NB: Clang doesn't support nested function which is needed to test<br>
> +# execstack.<br>
> +ifneq ($(have-test-clang),yes)<br>
> tests += tst-execstack-threads<br>
> endif<br>
> endif<br>
> +endif<br>
> <br>
> modules-names = \<br>
> tst-audit-threads-mod1 \<br>
> tst-audit-threads-mod2 \<br>
> tst-compat-forwarder-mod \<br>
> - tst-execstack-threads-mod \<br>
> tst-stack4mod \<br>
> tst-tls3mod \<br>
> tst-tls5mod \<br>
> @@ -504,6 +507,12 @@ test-extras += \<br>
> tst-cleanupx4aux \<br>
> # test-extras<br>
> <br>
> +ifneq ($(have-test-clang),yes)<br>
> +modules-names += \<br>
> + tst-execstack-threads-mod \<br>
> + # modules-names<br>
> +endif<br>
> +<br>
> # This test exercises compat symbols removed in glibc 2.34.<br>
> ifdef have-GLIBC_2.33<br>
> tests += tst-cleanup4<br><br>
</blockquote></div></div>