Skip to content

Commit

Permalink
x86_64: Compile with fPIC for relocatable PEs for UEFI
Browse files Browse the repository at this point in the history
XXX: Note the XXX comment within the patch contents of this commit.
  • Loading branch information
AmaanC committed Jun 5, 2018
1 parent 6c80ac3 commit 547ef85
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bsps/x86_64/amd64/config/amd64.cfg
Expand Up @@ -6,4 +6,13 @@ RTEMS_CPU = x86_64
CFLAGS_OPTIMIZE_V += -O2 -g
CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections

CPU_CFLAGS = -fPIC
CPU_CFLAGS += -fno-stack-protector -fshort-wchar -mno-red-zone -DEFI_FUNCTION_WRAPPER

LDFLAGS = -Wl,--gc-sections
LDFLAGS += -Wl,-znocombreloc,-Bsymbolic

# XXX: This needs to be in LDFLAGS to prevent CPU_FLAGS from causing configure
# to mistakenly think that the compiler doesn't work normally because of
# unresolved symbols throwing errors when the "-shared" option is used.
LDFLAGS += -shared

0 comments on commit 547ef85

Please sign in to comment.