Executable stack warning from binutils >= 2.39
Describe the issue
I have been trying to install MESA in my local laptop, and I have been experiencing some issues from the binutils gnu-ld linker, after compiling the tutorial problem, with the following outcome:
gfortran -Wno-uninitialized -fno-range-check -fmax-errors=7 -fdiagnostics-color -fprotect-parens -fno-sign-zero -fbacktrace -ggdb -finit-real=snan -fopenmp -fbounds-check -Wuninitialized -Warray-bounds -ggdb -ffree-form -ffree-line-length-none -x f95-cpp-input -std=f2008 -Wno-error=tabs -I/home/asclark/mesa/include -I../src -c ../src/run_star_extras.f90
gfortran -Wno-uninitialized -fno-range-check -fmax-errors=7 -fdiagnostics-color -fprotect-parens -fno-sign-zero -fbacktrace -ggdb -finit-real=snan -fopenmp -fbounds-check -Wuninitialized -Warray-bounds -ggdb -ffree-form -ffree-line-length-none -x f95-cpp-input -std=f2008 -Wno-error=tabs -I/home/asclark/mesa/include -I../src -c /home/asclark/mesa/star/job/run_star.f90
gfortran -Wno-uninitialized -fno-range-check -fmax-errors=7 -fdiagnostics-color -fprotect-parens -fno-sign-zero -fbacktrace -ggdb -finit-real=snan -fopenmp -fbounds-check -Wuninitialized -Warray-bounds -ggdb -ffree-form -ffree-line-length-none -x f95-cpp-input -std=f2008 -Wno-error=tabs -I/home/asclark/mesa/include -I../src -c ../src/run.f90
gfortran -fopenmp -o ../star run_star_extras.o run_star.o run.o -L/home/asclark/mesa/lib -lstar -lstar_data -lgyre_mesa -lgyre -lionization -latm -lcolors -lturb -lnet -leos -lkap -lrates -lneu -lchem -linterp_2d -linterp_1d -lnum -lauto_diff -lforum -lmtx -lconst -lmath -lutils `mesasdk_crmath_link` `mesasdk_lapack95_link` `mesasdk_lapack_link` `mesasdk_blas_link` `mesasdk_hdf5_link` `mesasdk_pgplot_link` -lz
/home/asclark/mesasdk/bin/../lib/gcc/x86_64-pc-linux-gnu/13.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: atm_support.o: requires executable stack (because the .note.GNU-stack section is executable)
System information
- MESA version: da57bc6 (current
mainbranch) - MESA SDK version: 24.7.1
- Operating system: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal
Output from ./help
Run ./help from your MESA directory ($MESA_DIR) and include the output here.
MESA Version
da57bc6
uname -a
Linux asclark 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
gfortran -v
Using built-in specs.
COLLECT_GCC=/home/asclark/mesasdk/bin/gfortran.exec
COLLECT_LTO_WRAPPER=/home/asclark/mesasdk/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/user/sdk2-tmp/build/gcc/configure CC= CXX= --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --prefix=/home/user/sdk2-tmp/mesasdk --with-gmp=/home/user/sdk2-tmp/mesasdk --with-mpfr=/home/user/sdk2-tmp/mesasdk --with-mpc=/home/user/sdk2-tmp/mesasdk --enable-languages=c,c++,fortran --disable-multilib --disable-nls --enable-clocale=generic
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.3.0 (GCC)
$MESASDK_ROOT
/home/asclark/mesasdk
MESASDK version
x86_64-linux-24.7.1
$PATH
/home/asclark/mesasdk/bin:/usr/local/visit/bin:/home/asclark/julia-1.6.4/bin:/home/asclark/mambaforge/bin:/home/asclark/mambaforge/condabin:/home/asclark/.local/bin:/opt/node-v16.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/asclark/mesa/scripts/shmesa
$MESA_DIR
/home/asclark/mesa
Build log Attached to the issue.
Hi @aisclark91, thanks for the report. It isn't clear what the actual issue is here. Are you able to run MESA? Does the output match the tutorial?
If the issue is just the warning
/home/asclark/mesasdk/bin/../lib/gcc/x86_64-pc-linux-gnu/13.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: atm_support.o: requires executable stack (because the .note.GNU-stack section is executable)
I believe this is benign, though I can't remember offhand why it's started appearing at compile time.
I decided to reinstall binutils and now it works. The warnings still appear but the compilation does not stop there.
I believe this is benign, though I can't remember offhand why it's started appearing at compile time.
It was benign (e.g. see https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments) but recent glibc versions (2.41, released on 2025-01-30) may prevent dynamic loading of libraries (such as pymesa is doing) that require executable stacks. It seems that the -ftrampoline-impl=heap option fixes this, but we would need to test whether this does not cause issues on the various platforms we support.