-
Notifications
You must be signed in to change notification settings - Fork 1
Create and link against libllvmlibc-sparse #40
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8373a2d
Create and link against libllvmlibc-sparse
nickdesaulniers 16299fb
appease shellcheck
nickdesaulniers be1d8df
remove commented out debugging lines
nickdesaulniers 6b3ca6d
shfmt appeasement
nickdesaulniers ee00a4d
update comment
nickdesaulniers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
llvm-project/0001-libc-Fix-build-when-__FE_DENORM-is-defined.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| From 122da690b39a67cd6e6bce4b9ad3ac1470cc1ed5 Mon Sep 17 00:00:00 2001 | ||
| From: Alex Brachet <abrachet@google.com> | ||
| Date: Wed, 8 Jun 2022 16:21:53 +0000 | ||
| Subject: [PATCH] [libc] Fix build when __FE_DENORM is defined | ||
|
|
||
| [nd: drop hunk that doesn't apply to 14.0.1 due to missing | ||
| commit 805899e68a83 ("[libc] Change FEnv to use MXCSR as source of truth")] | ||
|
|
||
| Differential revision: https://reviews.llvm.org/D127222 | ||
| --- | ||
| libc/src/__support/FPUtil/x86_64/FEnvImpl.h | 10 +++++----- | ||
| 1 file changed, 5 insertions(+), 5 deletions(-) | ||
|
|
||
| diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h | ||
| index 846996ec93af..6bac3e9e6a0f 100644 | ||
| --- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h | ||
| +++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h | ||
| @@ -73,7 +73,7 @@ static inline uint16_t get_status_value_for_except(int excepts) { | ||
| // bit flags in the control registers. | ||
| return (excepts & FE_INVALID ? ExceptionFlags::INVALID : 0) | | ||
| #ifdef __FE_DENORM | ||
| - (excepts & __FE_DENORM ? ExceptionFlags::Denormal : 0) | | ||
| + (excepts & __FE_DENORM ? ExceptionFlags::DENORMAL : 0) | | ||
| #endif // __FE_DENORM | ||
| (excepts & FE_DIVBYZERO ? ExceptionFlags::DIV_BY_ZERO : 0) | | ||
| (excepts & FE_OVERFLOW ? ExceptionFlags::OVERFLOW : 0) | | ||
| @@ -84,7 +84,7 @@ static inline uint16_t get_status_value_for_except(int excepts) { | ||
| static inline int exception_status_to_macro(uint16_t status) { | ||
| return (status & ExceptionFlags::INVALID ? FE_INVALID : 0) | | ||
| #ifdef __FE_DENORM | ||
| - (status & ExceptionFlags::Denormal ? __FE_DENORM : 0) | | ||
| + (status & ExceptionFlags::DENORMAL ? __FE_DENORM : 0) | | ||
| #endif // __FE_DENORM | ||
| (status & ExceptionFlags::DIV_BY_ZERO ? FE_DIVBYZERO : 0) | | ||
| (status & ExceptionFlags::OVERFLOW ? FE_OVERFLOW : 0) | | ||
| @@ -273,8 +273,8 @@ static inline int raise_except(int excepts) { | ||
| if (status_value & internal::ExceptionFlags::INEXACT) | ||
| raise_helper(internal::ExceptionFlags::INEXACT); | ||
| #ifdef __FE_DENORM | ||
| - if (statusValue & internal::ExceptionFlags::Denormal) { | ||
| - raiseHelper(internal::ExceptionFlags::Denormal); | ||
| + if (status_value & internal::ExceptionFlags::DENORMAL) { | ||
| + raise_helper(internal::ExceptionFlags::DENORMAL); | ||
| } | ||
| #endif // __FE_DENORM | ||
|
|
||
| -- | ||
| 2.37.0.144.g8ac04bfd2-goog | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/usr/bin/env sh | ||
|
|
||
| LLVM_LIBC=$(find . -name libllvmlibc.a) | ||
| for i in strlen memcmp memset memcpy; do | ||
| llvm-ar x "${LLVM_LIBC}" $i.cpp.o | ||
| done | ||
| rm -f libllvmlibc-sparse.a | ||
| llvm-ar qc libllvmlibc-sparse.a memcmp.cpp.o memcpy.cpp.o memset.cpp.o strlen.cpp.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I tend to prefer
-Xlinker --allow-multiple-definition. However, this is gross either way.