Skip to content

[flang] Fix building on aarch64 *BSD and musl libc after 9d8dc45d17088300e9e2086594ca581b119193c8 #125183

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

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Jan 31, 2025

The fpu_control.h header appears to be GLIBC specific.

@brad0 brad0 requested a review from vdonaldson January 31, 2025 08:22
@llvmbot llvmbot added flang:runtime flang Flang issues not falling into any other category labels Jan 31, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 31, 2025

@llvm/pr-subscribers-flang-runtime

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/125183.diff

1 Files Affected:

  • (modified) flang/runtime/exceptions.cpp (+1-1)
diff --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp
index 257c71b51edb3d..344e7216cfaae8 100644
--- a/flang/runtime/exceptions.cpp
+++ b/flang/runtime/exceptions.cpp
@@ -11,7 +11,7 @@
 #include "flang/Runtime/exceptions.h"
 #include "terminator.h"
 #include <cfenv>
-#if defined(__aarch64__) && !defined(_WIN32)
+#if defined(__aarch64__) && defined(__GLIBC__)
 #include <fpu_control.h>
 #elif defined(__x86_64__) && !defined(_WIN32)
 #include <xmmintrin.h>

Copy link
Contributor

@luporl luporl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fpu_control.h is also absent on macOS. This PR fixes the build on it.

@brad0 brad0 merged commit e31c6c9 into llvm:main Jan 31, 2025
11 checks passed
@brad0 brad0 deleted the flang_fpu_control branch January 31, 2025 16:49
Copy link
Contributor

@vdonaldson vdonaldson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@vdonaldson
Copy link
Contributor

[There is no "request for changes". Thanks for the fix!]

swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 1, 2025
…m#125183)

The fpu_control.h header appears to be GLIBC specific.

(cherry picked from commit e31c6c9)
@DavidTruby
Copy link
Member

This also fixes macOS builds. Can we cherry pick this onto the release branch? Builds for all the mentioned targets are broken there at the moment.

@DavidTruby DavidTruby added this to the LLVM 20.X Release milestone Feb 3, 2025
@DavidTruby
Copy link
Member

You already did... never mind! I didn't know there was a different way to do it except for the cherry-pick command 👍

@DavidTruby DavidTruby removed this from the LLVM 20.X Release milestone Feb 3, 2025
@brad0
Copy link
Contributor Author

brad0 commented Feb 3, 2025

You already did... never mind! I didn't know there was a different way to do it except for the cherry-pick command 👍

That is the way of doing things. But I opened another issue under the milestone and then did a cherry-pick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:runtime flang Flang issues not falling into any other category
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

5 participants