Skip to content

Commit

Permalink
Fixes #414: Use the linker's '-no-pie' option when available
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpalter committed Jun 2, 2022
1 parent ca107b9 commit 68b1516
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lisp-kernel/linuxx8664/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ else
HASH_STYLE="-Wl,--hash-style=sysv"
endif

# If the linker supports a "-no-pie" option, use it
NO_PIE = $(shell ($(LD) --help 2>&1 | grep -q -e "-no-pie") && /bin/echo "-Wl,-no-pie")

.s.o:
$(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
Expand Down Expand Up @@ -74,7 +76,7 @@ LINK_MAP = ./elf_x86_64.x
USE_LINK_MAP = # -T ./elf_x86_64.x

../../lx86cl64: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile $(LINK_MAP)
$(CC) -m64 $(CDEBUG) -Wl,--export-dynamic $(HASH_STYLE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) -Wl,--no-as-needed $(OSLIBS)
$(CC) -m64 $(CDEBUG) -Wl,--export-dynamic $(HASH_STYLE) $(NO_PIE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) -Wl,--no-as-needed $(OSLIBS)


$(SPOBJ): $(SPINC)
Expand Down

0 comments on commit 68b1516

Please sign in to comment.