build: use heap trampolines instead of stack based trampolines#905
build: use heap trampolines instead of stack based trampolines#905VincentVanlaer merged 1 commit intomainfrom
Conversation
|
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: ***@***.***
|
|
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: ***@***.***
|
|
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. |
|
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: ***@***.***
|
|
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). |
|
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: ***@***.***
|
|
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? |
The world is moving towards stacks that are not executable. Fixes #866
58612e9 to
e01298a
Compare
|
@rhdtownsend I have removed the special handling for forum and gyre for now. That means that this PR doesn't actually fix the issue yet until forum and gyre get updated. How do you prefer to handle this? |
|
I've updated forum to 1.2.3 (on main), and this brings with it the -ftrampoline-impl=heap compilation flag. The same flag will be in the next public release of GYRE (9.1), which will be occurring soon. |
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