summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-09-12 15:48:17 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-14 21:53:56 +0000
commit0edfb40368b0fba0238f21bc6151a15aa3152bac (patch)
tree567346c95ade3216ae8f78f2dfffe99fa41622ed
parentded9307b7919a6b5b074e2e9d3394038888b8a9e (diff)
downloadchrome-ec-0edfb40368b0fba0238f21bc6151a15aa3152bac.tar.gz
Makefile.toolchain: Pass sysroot flag for host builds
When compiling with clang, the host build fails to find dependencies when linking (libftdi/libusb) unless sysroot is specified. BRANCH=none BUG=b:246424843 TEST=emerge-hatch chromeos-ec Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0407853a1dee55666f2c1768d6a981101feba691 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894405 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--Makefile.toolchain3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index c89777ae7e..647bef90ed 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -202,6 +202,9 @@ MEMSIZE_FLAGS+=-Wl,--print-memory-usage
endif
BUILD_LDFLAGS=$(LIBFTDIUSB_LDLIBS)
HOST_LDFLAGS=$(LIBFTDIUSB_LDLIBS)
+ifneq (${HOST_SYSROOT},)
+ HOST_LDFLAGS+=--sysroot=${HOST_SYSROOT}
+endif
HOST_TEST_LDFLAGS=-Wl,-T core/host/host_exe.lds -lrt -pthread -rdynamic -lm\
-fuse-ld=bfd -no-pie \
$(if $(TEST_COVERAGE), --coverage,) \