-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Driver][UEFI] Enable Microsoft extensions #121875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libc @llvm/pr-subscribers-clang-driver Author: Prabhuk (Prabhuk) Changes
Full diff: https://github.com/llvm/llvm-project/pull/121875.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index a0002371da2f1b..03fdd92e00e316 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5109,6 +5109,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const llvm::Triple *AuxTriple =
(IsCuda || IsHIP) ? TC.getAuxTriple() : nullptr;
bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment();
+ bool IsUEFI = RawTriple.isUEFI();
bool IsIAMCU = RawTriple.isOSIAMCU();
// Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
@@ -7252,7 +7253,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// -fms-extensions=0 is default.
if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions,
- IsWindowsMSVC))
+ IsWindowsMSVC || IsUEFI))
CmdArgs.push_back("-fms-extensions");
// -fms-compatibility=0 is default.
diff --git a/libc/config/baremetal/config.json b/libc/config/baremetal/config.json
index 85e80879d498e6..08c581d1c68226 100644
--- a/libc/config/baremetal/config.json
+++ b/libc/config/baremetal/config.json
@@ -30,10 +30,5 @@
"LIBC_CONF_MATH_OPTIMIZATIONS": {
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)"
}
- },
- "codegen": {
- "LIBC_CONF_KEEP_FRAME_POINTER": {
- "value": false
- }
}
}
|
@llvm/pr-subscribers-clang Author: Prabhuk (Prabhuk) Changes
Full diff: https://github.com/llvm/llvm-project/pull/121875.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index a0002371da2f1b..03fdd92e00e316 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5109,6 +5109,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const llvm::Triple *AuxTriple =
(IsCuda || IsHIP) ? TC.getAuxTriple() : nullptr;
bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment();
+ bool IsUEFI = RawTriple.isUEFI();
bool IsIAMCU = RawTriple.isOSIAMCU();
// Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
@@ -7252,7 +7253,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// -fms-extensions=0 is default.
if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions,
- IsWindowsMSVC))
+ IsWindowsMSVC || IsUEFI))
CmdArgs.push_back("-fms-extensions");
// -fms-compatibility=0 is default.
diff --git a/libc/config/baremetal/config.json b/libc/config/baremetal/config.json
index 85e80879d498e6..08c581d1c68226 100644
--- a/libc/config/baremetal/config.json
+++ b/libc/config/baremetal/config.json
@@ -30,10 +30,5 @@
"LIBC_CONF_MATH_OPTIMIZATIONS": {
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)"
}
- },
- "codegen": {
- "LIBC_CONF_KEEP_FRAME_POINTER": {
- "value": false
- }
}
}
|
Why is the libc patch included in this one? |
Thank you! It was a mistake. I'll upload the right version and marking this PR as draft until then. |
Enable microsoft extensions for UEFI targets.
8294d83
to
d0377d3
Compare
Can you include a test as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given a driver test as Petr mentioned.
@RossComputerGuy FYI |
@petrhosek Updated the test to check for "-fms-extensions" flag. PTAL |
Already have seen this, I'm not sure I understand what the flag does exactly. I've got LLVM libc PR subscriptions so I'll see any future PR's. |
This flag enables support for PECOFF specific pragmas. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/7886 Here is the relevant piece of the build log for the reference
|
Set "-fms-extensions" for UEFI targets.