-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
[rc] Add patches for WASM support #67
Draft
h-vetinari
wants to merge
6
commits into
conda-forge:rc
Choose a base branch
from
h-vetinari:wasm
base: rc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8ccecca
Add WASM patches
IsabelParedes e45115b
Update build instructions
IsabelParedes f84ffd6
rebase patches to v19.1.0.rc1
h-vetinari 4d03da8
add back default architecture; remove default triple
h-vetinari e1f7fe2
Split up patches
IsabelParedes f8adeb4
rebase patches on v19.1.0.rc2
h-vetinari 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
This file contains 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
4 changes: 2 additions & 2 deletions
4
recipe/patches/0001-Instructions-for-building-a-functional-Flang-cross-c.patch
This file contains 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 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 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
28 changes: 28 additions & 0 deletions
28
recipe/patches/0004-Fix-implicit-conversion-warning-when-targeting-32bit.patch
This file contains 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,28 @@ | ||
From 4c2b2fac044fb1b0ad1c3fda3dc5547eda9a22f9 Mon Sep 17 00:00:00 2001 | ||
From: serge-sans-paille <sguelton@mozilla.com> | ||
Date: Fri, 9 Aug 2024 07:51:07 +0200 | ||
Subject: [PATCH 4/7] Fix implicit conversion warning when targeting 32bit | ||
|
||
See https://github.com/llvm/llvm-project/pull/99465 | ||
--- | ||
flang/runtime/derived.cpp | 7 +++---- | ||
1 file changed, 3 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/flang/runtime/derived.cpp b/flang/runtime/derived.cpp | ||
index 0d9e033df4e2..659f54fa344b 100644 | ||
--- a/flang/runtime/derived.cpp | ||
+++ b/flang/runtime/derived.cpp | ||
@@ -23,10 +23,9 @@ static RT_API_ATTRS void GetComponentExtents(SubscriptValue (&extents)[maxRank], | ||
const typeInfo::Component &comp, const Descriptor &derivedInstance) { | ||
const typeInfo::Value *bounds{comp.bounds()}; | ||
for (int dim{0}; dim < comp.rank(); ++dim) { | ||
- SubscriptValue lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)}; | ||
- SubscriptValue ub{ | ||
- bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)}; | ||
- extents[dim] = ub >= lb ? ub - lb + 1 : 0; | ||
+ auto lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)}; | ||
+ auto ub{bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)}; | ||
+ extents[dim] = ub >= lb ? static_cast<SubscriptValue>(ub - lb + 1) : 0; | ||
} | ||
} | ||
|
193 changes: 0 additions & 193 deletions
193
recipe/patches/0004-Patches-to-build-flang-runtime-with-emcc.patch
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
recipe/patches/0005-Explicitly-convert-shift-value-to-SubscriptValue.patch
This file contains 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,33 @@ | ||
From 2b7c94446934e5c473f4577fd78c9a16cb225e31 Mon Sep 17 00:00:00 2001 | ||
From: serge-sans-paille <sguelton@mozilla.com> | ||
Date: Fri, 9 Aug 2024 07:57:36 +0200 | ||
Subject: [PATCH 5/7] Explicitly convert shift value to SubscriptValue | ||
|
||
See https://github.com/llvm/llvm-project/pull/99822 | ||
--- | ||
flang/runtime/transformational.cpp | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/flang/runtime/transformational.cpp b/flang/runtime/transformational.cpp | ||
index cf1e61c0844d..b6b204be4418 100644 | ||
--- a/flang/runtime/transformational.cpp | ||
+++ b/flang/runtime/transformational.cpp | ||
@@ -508,7 +508,8 @@ void RTDEF(CshiftVector)(Descriptor &result, const Descriptor &source, | ||
SubscriptValue lb{sourceDim.LowerBound()}; | ||
for (SubscriptValue j{0}; j < extent; ++j) { | ||
SubscriptValue resultAt{1 + j}; | ||
- SubscriptValue sourceAt{lb + (j + shift) % extent}; | ||
+ SubscriptValue sourceAt{ | ||
+ lb + static_cast<SubscriptValue>(j + shift) % extent}; | ||
if (sourceAt < lb) { | ||
sourceAt += extent; | ||
} | ||
@@ -619,7 +620,7 @@ void RTDEF(EoshiftVector)(Descriptor &result, const Descriptor &source, | ||
} | ||
SubscriptValue lb{source.GetDimension(0).LowerBound()}; | ||
for (SubscriptValue j{1}; j <= extent; ++j) { | ||
- SubscriptValue sourceAt{lb + j - 1 + shift}; | ||
+ SubscriptValue sourceAt{lb + j - 1 + static_cast<SubscriptValue>(shift)}; | ||
if (sourceAt >= lb && sourceAt < lb + extent) { | ||
CopyElement(result, &j, source, &sourceAt, terminator); | ||
} else if (boundary) { |
Oops, something went wrong.
Oops, something went wrong.
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.
So llvm/llvm-project@6db2465 already landed before 19.1.0.rc1 (so it needs to be dropped), while the commits for patch 0006 don't apply on the 19.x branch (due to llvm/llvm-project@4cdc19b). I'm tentatively adding that patch as a backport as well for now, even though it's larger than I'd normally be comfortable with.