aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2024-11-11 15:25:00 +0200
committerJani Välimaa <wally@mageia.org>2024-11-11 15:25:00 +0200
commit029c7edfcb1541a87db355184e969726c4d1ae3b (patch)
treede54bf97bcfeeef7eaa2e4940983fffc481f9ade
parent6ef9080904b39d3a2b4450660e3d88a2536fd16c (diff)
downloadrpm-setup-029c7edfcb1541a87db355184e969726c4d1ae3b.tar
rpm-setup-029c7edfcb1541a87db355184e969726c4d1ae3b.tar.gz
rpm-setup-029c7edfcb1541a87db355184e969726c4d1ae3b.tar.bz2
rpm-setup-029c7edfcb1541a87db355184e969726c4d1ae3b.tar.xz
rpm-setup-029c7edfcb1541a87db355184e969726c4d1ae3b.zip
macros: add redhat-hardened-clang-ld.cfg (from Fedora) to pass -pie when linking with clang
-rw-r--r--Makefile.am3
-rw-r--r--NEWS1
-rw-r--r--macros.in6
-rw-r--r--redhat-hardened-clang-ld.cfg1
4 files changed, 8 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index d745843..12e24a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,8 +52,9 @@ redhat_scripts = \
redhat_hardened = \
redhat-hardened-cc1 \
+ redhat-hardened-ld \
redhat-hardened-clang.cfg \
- redhat-hardened-ld
+ redhat-hardened-clang-ld.cfg
BUILT_SOURCES = macros-perarch make_arch_macrosfiles.sh rpmgenplatform
diff --git a/NEWS b/NEWS
index b1ace2b..f8c9e2f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- macros: add redhat-hardened-clang-ld.cfg (from Fedora) to pass -pie when linking with clang
- macros: add %dist_vendor (Mageia) and %dist_name (Mageia Linux) macros
Version 2.80 - 5 July 2024, by Jani Välimaa
diff --git a/macros.in b/macros.in
index 041f1ac..35168fa 100644
--- a/macros.in
+++ b/macros.in
@@ -222,10 +222,12 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} -
# ---- compiler flags.
%_hardening_gcc_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-%_hardening_clang_cflags --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg
+%_hardening_clang_cflags --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg
%_hardening_cflags %{expand:%%{_hardening_%{toolchain}_cflags}}
-%_hardening_ldflags %[ "%{toolchain}" == "gcc" ? "-specs=/usr/lib/rpm/redhat/redhat-hardened-ld" : "" ]
+%_hardening_gcc_ldflags -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
+%_hardening_clang_ldflags --config=/usr/lib/rpm/redhat/redhat-hardened-clang-ld.cfg
+%_hardening_ldflags %{expand:%%{_hardening_%{toolchain}_ldflags}}
# Use "%undefine _hardened_build" to disable.
%_hardened_build 1
diff --git a/redhat-hardened-clang-ld.cfg b/redhat-hardened-clang-ld.cfg
new file mode 100644
index 0000000..f31f324
--- /dev/null
+++ b/redhat-hardened-clang-ld.cfg
@@ -0,0 +1 @@
+-pie