Use build_cflags when setting ASMFLAGS

While the current implementation works on Fedora, on c9s/rhel
the CFLAGS haven't been set at this point yet, so we are missing
the -fcfprotection flag in ASMFLAGS. Using build_cflags avoids
this ordering problem.

Additionally, add -Wl,-z,cet-report=error to the libLLVM.so linker
flags, so we can detect such issues earlier in the future.
This commit is contained in:
Nikita Popov 2023-08-01 09:37:56 +02:00 committed by tuliom
parent dd44fc12ea
commit 2abc096557

View file

@ -253,7 +253,7 @@ mv %{third_party_srcdir} third-party
%endif
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
export ASMFLAGS=$CFLAGS
export ASMFLAGS="%{build_cflags}"
# force off shared libs as cmake macros turns it on.
%cmake -G Ninja \
@ -329,6 +329,7 @@ export ASMFLAGS=$CFLAGS
-DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,cet-report=error" \
-DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0"
# Build libLLVM.so first. This ensures that when libLLVM.so is linking, there