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
TEST=emerge-hatch chromeos-ec
@@ -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,) \
