[packages/llvm] test whether linker supports --reduce-memory-overheads before enabling it

atler atler at pld-linux.org
Sun Oct 16 00:27:12 CEST 2022


commit eb891a99ad7044cd2309e23db3e08e5dc51a5898
Author: Jan Palus <atler at pld-linux.org>
Date:   Sun Oct 16 00:16:07 2022 +0200

    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 .. \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/llvm.git/commitdiff/eb891a99ad7044cd2309e23db3e08e5dc51a5898



More information about the pld-cvs-commit mailing list