diff options
author | Allen Webb <allenwebb@google.com> | 2018-12-05 09:33:51 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-06 22:06:48 -0800 |
commit | de73abca39bb953411cb0906deb7b60a0f064f73 (patch) | |
tree | 7215898e5943f5926363390f12d709e09b3be4e3 /Makefile.toolchain | |
parent | d05de0f1791121ff80a852ecd610139c9dfadb57 (diff) | |
download | chrome-ec-de73abca39bb953411cb0906deb7b60a0f064f73.tar.gz |
Makefile.toolchain: Set sysroot correctly when linking.
This fixes cross compilation by setting --sysroot=${SYSROOT} when
applicable so that targets that depend on outside libraries link
correctly.
BRANCH=None
BUG=chromium:911310
TEST=USE="ubsan asan fuzzer" ./build_packages \
--board=amd64-generic --skip_chroot_upgrade chromeos-ec &&
(cd ../platform/ec && unset BOARD && make -j buildall)
Change-Id: I6b0d3554d91460a9bca58e800c9e1cea9c3caf7a
Signed-off-by: Allen Webb <allenwebb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1363674
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r-- | Makefile.toolchain | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain index 7cb8e212d1..9ef5ef8699 100644 --- a/Makefile.toolchain +++ b/Makefile.toolchain @@ -118,6 +118,9 @@ endif BUILD_CFLAGS= $(LIBFTDI_CFLAGS) $(BUILD_CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN) HOST_CFLAGS=$(HOST_CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN) -DHOST_TOOLS_BUILD +ifneq (${SYSROOT},) + LDFLAGS_EXTRA+=--sysroot=${SYSROOT} +endif LDFLAGS=-nostdlib -g -Wl,-X -Wl,--gc-sections -Wl,--build-id=none \ $(LDFLAGS_EXTRA) $(CFLAGS_CPU) BUILD_LDFLAGS=$(LIBFTDI_LDLIBS) |