This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Compile assembly files as ASM, not C
ClosedPublic

Authored by mstorsjo on May 14 2023, 2:22 PM.

Details

Summary

Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.

Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.

Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.

Diff Detail

Event Timeline

mstorsjo created this revision.May 14 2023, 2:22 PM
mstorsjo requested review of this revision.May 14 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald Transcript

Ping, this is needed to unbreak my nightly builds

This revision is now accepted and ready to land.May 16 2023, 9:57 AM
This revision was automatically updated to reflect the committed changes.