From: Jan Palus Date: Sat, 15 Oct 2022 22:16:07 +0000 (+0200) Subject: test whether linker supports --reduce-memory-overheads before enabling it X-Git-Tag: auto/th/llvm-15.0.2-1~4 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fllvm.git;a=commitdiff_plain;h=eb891a9 test whether linker supports --reduce-memory-overheads before enabling it --- 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 .. \