From 20ce424e65ab227e3dc866ab6ac2d2b096f55fd8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 7 Jul 2016 00:41:13 +0000 Subject: [PATCH] disable build/install of temp sysroot headers for native compilers these are not needed since the cross toolchain being used to build the native compiler already has its own libc and headers. but more importantly, due to lack of certain dependency chains that would be present for a cross compiler build, it was possible for two invocations of musl's make process to occur in parallel (one for temp sysroot headers, one for actual libc build). this could (and was observed to) lead to a race condition where alltypes.h was momentarily truncated in the middle of the libc build. --- litecross/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litecross/Makefile b/litecross/Makefile index 899f7c7..e913506 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -63,7 +63,7 @@ SYSROOT = /$(TARGET) FULL_MUSL_CONFIG += CC="$(XGCC)" LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a" MUSL_VARS = AR=../obj_toolchain/binutils/ar RANLIB=../obj_toolchain/binutils/ranlib obj_musl/.lc_built: | obj_toolchain/$(TARGET)/libgcc/libgcc.a -obj_toolchain/.lc_built: | obj_sysroot/.lc_libs +obj_toolchain/.lc_built: | obj_sysroot/.lc_libs obj_sysroot/.lc_headers else SYSROOT = / FULL_TOOLCHAIN_CONFIG += --host=$(TARGET) @@ -177,7 +177,7 @@ obj_sysroot/.lc_libs: | obj_musl/.lc_built cd obj_musl && $(MAKE) $(MUSL_VARS) DESTDIR=$(PWD)/obj_sysroot install touch $@ -obj_toolchain/.lc_built: | obj_toolchain/.lc_configured obj_sysroot/.lc_headers +obj_toolchain/.lc_built: | obj_toolchain/.lc_configured cd obj_toolchain && $(MAKE) MAKE="$(MAKE)" LC_ROOT=$(PWD) touch $@