summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-12-01 11:41:57 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-03 00:11:17 +0000
commit03d6cc6106bd72503a669c8640335fe858ebeaf2 (patch)
tree8cb1f865814e951494de722595a1555459ce2fac
parent8f083896bd3df75dec79a099bb0fc2c57fea16ba (diff)
downloadvboot-03d6cc6106bd72503a669c8640335fe858ebeaf2.tar.gz
Makefile: use -fPIC instead of -fPIE
According to the gcc docs: -fPIE These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables Example failure when linking against shared library: FAILED: lib/libbrillo-core.so x86_64-cros-linux-gnu-clang++ -shared -Wl,-O2 -Wl,--as-needed -Wl,--gc-sections -Wl,--icf=all -Wl,-z,relro -Wl,-z,noexecstack -Wl,-z,now -Wl,--as-needed --sysroot=/build/hatch -o ./lib/libbrillo-core.so -Wl,-soname=libbrillo-core.so @lib/libbrillo-core.so.rsp ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol subprocess_stdin; recompile with -fPIC >>> defined in /build/hatch/usr/lib/../lib64/libvboot_host.a(subprocess.o) >>> referenced by subprocess.c:278 (host/lib/subprocess.c:278) >>> subprocess.o:(subprocess_run) in archive /build/hatch/usr/lib/../lib64/libvboot_host.a BRANCH=none BUG=b:174578361 TEST=FEATURES="test" emerge-hatch vboot_reference Change-Id: I5cda8dbe87d20d1b4b659459d861bc04f492e3e5 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2568259 Commit-Queue: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5de9f576..df7e4049 100644
--- a/Makefile
+++ b/Makefile
@@ -259,7 +259,7 @@ CFLAGS += -MMD -MF $@.d
ifeq (${FIRMWARE_ARCH},)
# Creates position independent code for non firmware target.
-CFLAGS += -fPIE
+CFLAGS += -fPIC
endif
CFLAGS += -D_GNU_SOURCE