From eb891a99ad7044cd2309e23db3e08e5dc51a5898 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sun, 16 Oct 2022 00:16:07 +0200 Subject: [PATCH] test whether linker supports --reduce-memory-overheads before enabling it --- llvm.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm.spec b/llvm.spec index 92e1572..c0aef8b 100644 --- a/llvm.spec +++ b/llvm.spec @@ -735,7 +735,9 @@ CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64" %if %{with lowmem} export CFLAGS="%{rpmcflags} -g0" export CXXFLAGS="%{rpmcxxflags} -g0" +if echo 'int main(){}' | %{__cc} -x c %{rpmldflags} -Wl,--reduce-memory-overheads -o /dev/null - > /dev/null 2>&1; then export LDFLAGS="%{rpmldflags} -Wl,--reduce-memory-overheads" +fi %endif %cmake .. \ -- 2.43.0