Module Name: src
Committed By: riastradh
Date: Tue Jul 16 17:15:44 UTC 2024
Modified Files:
src/tests/libexec/ld.elf_so: Makefile
Log Message:
tests/libexec/ld.elf_so/t_ifunc: Handle MKRELRO=no.
Just build t_ifunc and t_ifunc_now normally. If they wind up being
built with the same options as t_ifunc_norelro and
t_ifunc_norelro_now, so be it; easier to do it this way than to put
more conditionals into set lists.
Should resolve, e.g.:
/home/builds/ab/HEAD-llvm/evbarm-earmv7hf/202407141900Z-tools/bin/armv7--netbsdelf-eabihf-ld:
warning: -z relro ignored
armv7--netbsdelf-eabihf-clang: error: linker command failed with exit code 1
(use -v to see invocation)
--- t_ifunc ---
*** Failed target: t_ifunc
*** In directory: /home/source/ab/HEAD-llvm/src/tests/libexec/ld.elf_so
*** Failed commands:
${_MKTARGET_LINK}
=> @# " link " ld.elf_so/t_ifunc
${_CCLINK.${:Ut_ifunc}} ${_LDFLAGS.${:Ut_ifunc}}
${_LDSTATIC.${:Ut_ifunc}} -o ${.TARGET} ${OBJS.${:Ut_ifunc}} ${_PROGLDOPTS}
${_LDADD.${:Ut_ifunc}}
=>
/home/builds/ab/HEAD-llvm/evbarm-earmv7hf/202407141900Z-tools/bin/armv7--netbsdelf-eabihf-clang
--sysroot=/home/builds/ab/HEAD-llvm/evbarm-earmv7hf/202407141900Z-dest
-Wl,--fatal-warnings -Wl,--warn-shared-textrel -pie -o t_ifunc
t_ifunc.o
-Wl,-rpath-link,/home/builds/ab/HEAD-llvm/evbarm-earmv7hf/202407141900Z-dest/lib
-L=/lib -Wl,-z,relro -Wl,-rpath,/usr/tests/libexec/ld.elf_so -lutil
-latf-c
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${:Ut_ifunc}}
=>
/home/builds/ab/HEAD-llvm/evbarm-earmv7hf/202407141900Z-tools/bin/nbctfmerge -t
-g -L VERSION -g -o t_ifunc t_ifunc.o
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/libexec/ld.elf_so/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/libexec/ld.elf_so/Makefile
diff -u src/tests/libexec/ld.elf_so/Makefile:1.22 src/tests/libexec/ld.elf_so/Makefile:1.23
--- src/tests/libexec/ld.elf_so/Makefile:1.22 Sun Jul 7 17:37:33 2024
+++ src/tests/libexec/ld.elf_so/Makefile Tue Jul 16 17:15:44 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2024/07/07 17:37:33 riastradh Exp $
+# $NetBSD: Makefile,v 1.23 2024/07/16 17:15:44 riastradh Exp $
#
NOMAN= # defined
@@ -39,8 +39,8 @@ SRCS.t_ifunc_now= t_ifunc.c
SRCS.t_ifunc_norelro= t_ifunc.c
SRCS.t_ifunc_norelro_now= t_ifunc.c
-LDADD.t_ifunc+= -Wl,-z,relro
-LDADD.t_ifunc_now+= -Wl,-z,relro -Wl,-z,now
+LDADD.t_ifunc+= ${${MKRELRO} != "no":?-Wl,-z,relro:}
+LDADD.t_ifunc_now+= ${${MKRELRO} != "no":?-Wl,-z,relro:} -Wl,-z,now
LDADD.t_ifunc_norelro+= -Wl,-z,norelro
LDADD.t_ifunc_norelro_now+= -Wl,-z,norelro -Wl,-z,now