[llvm] [flang-rt] Use -Wp to undefine macros (PR #156034)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 12:13:13 PDT 2025


nikic wrote:

```
FAILED: flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90-pp.f90 flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90.o.ddi
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/flang --target=x86_64-unknown-linux-gnu -cpp -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_NO_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/flang-rt/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/flang-rt/../flang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/flang-rt -O3 -module-dirflang-rt/lib/runtime -fno-lto -Wp,-U_GLIBCXX_ASSERTIONS -Wp,-U_LIBCPP_ENABLE_ASSERTIONS -E /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90 > flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90-pp.f90 && /usr/bin/cmake -E cmake_ninja_depends --tdi=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/FortranDependInfo.json --lang=Fortran --src=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90-pp.f90 --out=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90-pp.f90 --dep=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90-pp.f90.d --obj=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90.o --ddi=flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/home/gha/actions-runner/_work/llvm-project/llvm-project/flang/module/iso_fortran_env_impl.f90.o.ddi
error: Unknown diagnostic option: -Wp,-U_GLIBCXX_ASSERTIONS
error: Unknown diagnostic option: -Wp,-U_LIBCPP_ENABLE_ASSERTIONS
```
Looks like this does not work because these flags also get passed to `flang`, while they should only go to `clang`...

https://github.com/llvm/llvm-project/pull/156034


More information about the llvm-commits mailing list