This is an archive of the discontinued LLVM Phabricator instance.

[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately
ClosedPublic

Authored by tambre on Dec 13 2020, 6:56 AM.

Details

Summary

Invoking the preprocessor ourselves is fragile and would require us to replicate CMake's handling of definitions, compiler flags, etc for proper compatibility.
In my toolchain builds this notably resulted in a bunch of warnings from unused flags as my CMAKE_C_FLAGS includes CPU-specific optimization options.
Notably this part was already duplicating the logic for VISIBILITY_HIDDEN define.

Instead, symlink the files and set the proper set of defines on each.
This should also be faster as we avoid invoking the compiler multiple times.

Fixes https://llvm.org/PR48494

Diff Detail

Event Timeline

tambre created this revision.Dec 13 2020, 6:56 AM
tambre requested review of this revision.Dec 13 2020, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2020, 6:56 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
tambre updated this revision to Diff 311445.Dec 13 2020, 6:58 AM

Fix HAS_ASM_LSE define

Harbormaster completed remote builds in B82181: Diff 311444.
tambre updated this revision to Diff 311458.Dec 13 2020, 10:04 AM

Fix HAS_ASM_LSE define

ilinpv accepted this revision.Dec 13 2020, 12:44 PM

Thanks for fix, creating symlinks is more elegant and firm solution indeed.

This revision is now accepted and ready to land.Dec 13 2020, 12:44 PM
This revision was landed with ongoing or failed builds.Dec 13 2020, 11:20 PM
This revision was automatically updated to reflect the committed changes.