Skip to content

Commit f01deb8

Browse files
nalimilanstaticfloat
authored andcommitted
Mark stack as non executable
The linker is unable to detect that executable stack is not required and so marks libblastrampoline.so as requiring it. Pass `-Wl,-z,noexecstack` to ensure that the stack is marked as not executable. This improves security and allows running on systems where SELinux has been configured to disallow executable stacks.
1 parent 582a271 commit f01deb8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Make.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ else
3535
endif
3636

3737
LBT_CFLAGS := -g -O2 -std=c99 -fPIC -DLIBRARY_EXPORTS -D_GNU_SOURCE $(CFLAGS)
38-
LBT_LDFLAGS := $(LDFLAGS)
38+
# Linker doesn't detect automatically executable stack isn't needed
39+
LBT_LDFLAGS := $(LDFLAGS) -Wl,-z,noexecstack
3940

4041
ifeq ($(OS),Linux)
4142
# On linux, we need to link `libdl` to get `dlopen`

0 commit comments

Comments
 (0)