build: use heap trampolines instead of stack based trampolines#905
Open
VincentVanlaer wants to merge 1 commit intomainfrom
Open
build: use heap trampolines instead of stack based trampolines#905VincentVanlaer wants to merge 1 commit intomainfrom
VincentVanlaer wants to merge 1 commit intomainfrom
Conversation
The world is moving towards stacks that are not executable. Fixes #866
Contributor
|
Surely these changes should be implemented upstream in ForUM and GYRE, not in MESA?
… On Dec 26, 2025, at 6:22 PM, Vincent Vanlaer ***@***.***> wrote:
The world is moving towards stacks that are not executable.
Fixes #866
Note: this requires some testing on multiple platforms since these trampolines are architecture dependent
You can view, comment on, or merge this pull request online at:
#905
Commit Summary
• 58612e9 build: use heap trampolines instead of stack based trampolines
File Changes
(3 files)
• M forum/Makefile (2)
• M gyre/Makefile (2)
• M make/compile-settings-gnu.mk (2)
Patch Links:
• https://github.com/MESAHub/mesa/pull/905.patch
• https://github.com/MESAHub/mesa/pull/905.diff
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
Contributor
|
Also, from reading the docs for -ftrampoline-impl=heap, it seems it is intended for gcc >= 14. But the SDK is still gcc 13.3.0.
… On Dec 26, 2025, at 6:30 PM, Richard Townsend ***@***.***> wrote:
Surely these changes should be implemented upstream in ForUM and GYRE, not in MESA?
> On Dec 26, 2025, at 6:22 PM, Vincent Vanlaer ***@***.***> wrote:
>
> The world is moving towards stacks that are not executable.
> Fixes #866
> Note: this requires some testing on multiple platforms since these trampolines are architecture dependent
> You can view, comment on, or merge this pull request online at:
> #905
> Commit Summary
> • 58612e9 build: use heap trampolines instead of stack based trampolines
> File Changes
> (3 files)
> • M forum/Makefile (2)
> • M gyre/Makefile (2)
> • M make/compile-settings-gnu.mk (2)
> Patch Links:
> • https://github.com/MESAHub/mesa/pull/905.patch
> • https://github.com/MESAHub/mesa/pull/905.diff
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
Member
Author
|
Good catch, indeed it requires GCC 14 at least (I usually develop on newer GCC versions for practical reasons). In any case, we do require the flags in MESA itself, but sure these flags can also be applied in forum/gyre instead of passing them in. |
Contributor
|
We could also use -Wl,-z,noexecstack — see conda-forge/ctng-compiler-activation-feedstock#143
… On Dec 26, 2025, at 6:36 PM, Vincent Vanlaer ***@***.***> wrote:
VincentVanlaer left a comment (MESAHub/mesa#905)
Good catch, indeed it requires GCC 14 at least (I usually develop on newer GCC versions for practical reasons). In any case, we do require the flags in MESA itself, but sure these flags can also be applied in forum/gyre instead of passing them in.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
Member
Author
|
Unfortunately, that only works if none of the code that requires a trampoline is used at runtime. The eos unit tests hit this, which causes a segfault (as it's trying to execute non-executable stack memory). |
Contributor
|
Fair enough.
What are thoughts on upgrading the SDK to gcc 14, and then going with Vincent’s solution?
… On Dec 26, 2025, at 6:53 PM, Vincent Vanlaer ***@***.***> wrote:
VincentVanlaer left a comment (MESAHub/mesa#905)
Unfortunately, that only works if none of the code that requires a trampoline is used at runtime. The eos unit tests hit this, which causes a segfault (as it's trying to executable non-executable stack memory).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
Contributor
|
The new build system is already going to be a big change, so I say we take the opportunity to leap ahead in GCC version. Why not go straight to GCC 15.2, which seems to be the latest version? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The world is moving towards stacks that are not executable.
Fixes #866
Note: this requires some testing on multiple platforms since these trampolines are architecture dependent