From 681fc824569cc2d37522b9927b9a6ecbfffee3eb Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 15:38:00 -0700 Subject: [PATCH 01/10] mk: Remove a bunch of unused directives --- mk/cfg/aarch64-apple-ios.mk | 4 ---- mk/cfg/aarch64-linux-android.mk | 4 ---- mk/cfg/aarch64-unknown-linux-gnu.mk | 4 ---- mk/cfg/arm-linux-androideabi.mk | 4 ---- mk/cfg/arm-unknown-linux-gnueabi.mk | 4 ---- mk/cfg/arm-unknown-linux-gnueabihf.mk | 4 ---- mk/cfg/armv7-apple-ios.mk | 4 ---- mk/cfg/armv7s-apple-ios.mk | 4 ---- mk/cfg/i386-apple-ios.mk | 4 ---- mk/cfg/i686-apple-darwin.mk | 4 ---- mk/cfg/i686-pc-windows-gnu.mk | 4 ---- mk/cfg/i686-unknown-linux-gnu.mk | 4 ---- mk/cfg/mips-unknown-linux-gnu.mk | 4 ---- mk/cfg/mipsel-unknown-linux-gnu.mk | 4 ---- mk/cfg/powerpc-unknown-linux-gnu.mk | 4 ---- mk/cfg/x86_64-apple-darwin.mk | 4 ---- mk/cfg/x86_64-apple-ios.mk | 4 ---- mk/cfg/x86_64-pc-windows-gnu.mk | 4 ---- mk/cfg/x86_64-unknown-bitrig.mk | 4 ---- mk/cfg/x86_64-unknown-dragonfly.mk | 4 ---- mk/cfg/x86_64-unknown-freebsd.mk | 4 ---- mk/cfg/x86_64-unknown-linux-gnu.mk | 4 ---- mk/cfg/x86_64-unknown-openbsd.mk | 4 ---- mk/rustllvm.mk | 2 -- 24 files changed, 94 deletions(-) diff --git a/mk/cfg/aarch64-apple-ios.mk b/mk/cfg/aarch64-apple-ios.mk index 0219ab96057..7767129a5e2 100644 --- a/mk/cfg/aarch64-apple-ios.mk +++ b/mk/cfg/aarch64-apple-ios.mk @@ -20,16 +20,12 @@ CFG_GCCISH_CFLAGS_aarch64-apple-ios := -Wall -Werror -fPIC $(CFG_IOS_SDK_FLAGS_a CFG_GCCISH_CXXFLAGS_aarch64-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_aarch64-apple-ios) -I$(CFG_IOS_SDK_aarch64-apple-ios)/usr/include/c++/4.2.1 CFG_GCCISH_LINK_FLAGS_aarch64-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_aarch64-apple-ios) -Wl,-no_compact_unwind CFG_GCCISH_DEF_FLAG_aarch64-apple-ios := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_aarch64-apple-ios := -CFG_GCCISH_POST_LIB_FLAGS_aarch64-apple-ios := -CFG_DEF_SUFFIX_aarch64-apple-ios := .darwin.def CFG_LLC_FLAGS_aarch64-apple-ios := -mattr=+neon,+cyclone,+fp-armv8 CFG_INSTALL_NAME_aarch64-apple-ios = -Wl,-install_name,@rpath/$(1) CFG_LIBUV_LINK_FLAGS_aarch64-apple-ios = CFG_EXE_SUFFIX_aarch64-apple-ios := CFG_WINDOWSY_aarch64-apple-ios := CFG_UNIXY_aarch64-apple-ios := 1 -CFG_PATH_MUNGE_aarch64-apple-ios := true CFG_LDPATH_aarch64-apple-ios := CFG_RUN_aarch64-apple-ios = $(2) CFG_RUN_TARG_aarch64-apple-ios = $(call CFG_RUN_aarch64-apple-ios,,$(2)) diff --git a/mk/cfg/aarch64-linux-android.mk b/mk/cfg/aarch64-linux-android.mk index a6f7f2ba1d6..d7a1405c3d0 100644 --- a/mk/cfg/aarch64-linux-android.mk +++ b/mk/cfg/aarch64-linux-android.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_aarch64-linux-android := -Wall -g -fPIC -D__aarch64__ -DANDROI CFG_GCCISH_CXXFLAGS_aarch64-linux-android := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_aarch64-linux-android := -shared -fPIC -ldl -g -lm -lsupc++ CFG_GCCISH_DEF_FLAG_aarch64-linux-android := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_aarch64-linux-android := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_aarch64-linux-android := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_aarch64-linux-android := .android.def CFG_LLC_FLAGS_aarch64-linux-android := CFG_INSTALL_NAME_aarch64-linux-android = CFG_EXE_SUFFIX_aarch64-linux-android := CFG_WINDOWSY_aarch64-linux-android := CFG_UNIXY_aarch64-linux-android := 1 -CFG_PATH_MUNGE_aarch64-linux-android := true CFG_LDPATH_aarch64-linux-android := CFG_RUN_aarch64-linux-android= CFG_RUN_TARG_aarch64-linux-android= diff --git a/mk/cfg/aarch64-unknown-linux-gnu.mk b/mk/cfg/aarch64-unknown-linux-gnu.mk index fade0266549..6637423e495 100644 --- a/mk/cfg/aarch64-unknown-linux-gnu.mk +++ b/mk/cfg/aarch64-unknown-linux-gnu.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_aarch64-unknown-linux-gnu := -Wall -g -fPIC -D__aarch64__ $(CF CFG_GCCISH_CXXFLAGS_aarch64-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_aarch64-unknown-linux-gnu := -shared -fPIC -g CFG_GCCISH_DEF_FLAG_aarch64-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_aarch64-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_aarch64-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_aarch64-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_aarch64-unknown-linux-gnu := CFG_INSTALL_NAME_aarch64-unknown-linux-gnu = CFG_EXE_SUFFIX_aarch64-unknown-linux-gnu := CFG_WINDOWSY_aarch64-unknown-linux-gnu := CFG_UNIXY_aarch64-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_aarch64-unknown-linux-gnu := true CFG_LDPATH_aarch64-unknown-linux-gnu := CFG_RUN_aarch64-unknown-linux-gnu=$(2) CFG_RUN_TARG_aarch64-unknown-linux-gnu=$(call CFG_RUN_aarch64-unknown-linux-gnu,,$(2)) diff --git a/mk/cfg/arm-linux-androideabi.mk b/mk/cfg/arm-linux-androideabi.mk index 471220e2b66..fdd38ba75fe 100644 --- a/mk/cfg/arm-linux-androideabi.mk +++ b/mk/cfg/arm-linux-androideabi.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_arm-linux-androideabi := -Wall -g -fPIC -D__arm__ -DANDROID -D CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++ CFG_GCCISH_DEF_FLAG_arm-linux-androideabi := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_arm-linux-androideabi := .android.def CFG_LLC_FLAGS_arm-linux-androideabi := CFG_INSTALL_NAME_arm-linux-androideabi = CFG_EXE_SUFFIX_arm-linux-androideabi := CFG_WINDOWSY_arm-linux-androideabi := CFG_UNIXY_arm-linux-androideabi := 1 -CFG_PATH_MUNGE_arm-linux-androideabi := true CFG_LDPATH_arm-linux-androideabi := CFG_RUN_arm-linux-androideabi= CFG_RUN_TARG_arm-linux-androideabi= diff --git a/mk/cfg/arm-unknown-linux-gnueabi.mk b/mk/cfg/arm-unknown-linux-gnueabi.mk index b4c604b26ba..9a91097458e 100644 --- a/mk/cfg/arm-unknown-linux-gnueabi.mk +++ b/mk/cfg/arm-unknown-linux-gnueabi.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabi := -Wall -g -fPIC -D__arm__ -mfpu=vf CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabi := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabi := -shared -fPIC -g CFG_GCCISH_DEF_FLAG_arm-unknown-linux-gnueabi := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-linux-gnueabi := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-linux-gnueabi := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_arm-unknown-linux-gnueabi := .linux.def CFG_LLC_FLAGS_arm-unknown-linux-gnueabi := CFG_INSTALL_NAME_arm-unknown-linux-gnueabi = CFG_EXE_SUFFIX_arm-unknown-linux-gnueabi := CFG_WINDOWSY_arm-unknown-linux-gnueabi := CFG_UNIXY_arm-unknown-linux-gnueabi := 1 -CFG_PATH_MUNGE_arm-unknown-linux-gnueabi := true CFG_LDPATH_arm-unknown-linux-gnueabi := CFG_RUN_arm-unknown-linux-gnueabi=$(2) CFG_RUN_TARG_arm-unknown-linux-gnueabi=$(call CFG_RUN_arm-unknown-linux-gnueabi,,$(2)) diff --git a/mk/cfg/arm-unknown-linux-gnueabihf.mk b/mk/cfg/arm-unknown-linux-gnueabihf.mk index 4f02de0f6b5..0bd661ea00d 100644 --- a/mk/cfg/arm-unknown-linux-gnueabihf.mk +++ b/mk/cfg/arm-unknown-linux-gnueabihf.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLA CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabihf := -shared -fPIC -g CFG_GCCISH_DEF_FLAG_arm-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_arm-unknown-linux-gnueabihf := .linux.def CFG_LLC_FLAGS_arm-unknown-linux-gnueabihf := CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf = CFG_EXE_SUFFIX_arm-unknown-linux-gnueabihf := CFG_WINDOWSY_arm-unknown-linux-gnueabihf := CFG_UNIXY_arm-unknown-linux-gnueabihf := 1 -CFG_PATH_MUNGE_arm-unknown-linux-gnueabihf := true CFG_LDPATH_arm-unknown-linux-gnueabihf := CFG_RUN_arm-unknown-linux-gnueabihf=$(2) CFG_RUN_TARG_arm-unknown-linux-gnueabihf=$(call CFG_RUN_arm-unknown-linux-gnueabihf,,$(2)) diff --git a/mk/cfg/armv7-apple-ios.mk b/mk/cfg/armv7-apple-ios.mk index aee4e64addf..d4696976574 100644 --- a/mk/cfg/armv7-apple-ios.mk +++ b/mk/cfg/armv7-apple-ios.mk @@ -19,15 +19,11 @@ CFG_GCCISH_CFLAGS_armv7-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_ CFG_GCCISH_CXXFLAGS_armv7-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_armv7-apple-ios) -I$(CFG_IOS_SDK_armv7-apple-ios)/usr/include/c++/4.2.1 CFG_GCCISH_LINK_FLAGS_armv7-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7-apple-ios) -Wl,-no_compact_unwind CFG_GCCISH_DEF_FLAG_armv7-apple-ios := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_armv7-apple-ios := -CFG_GCCISH_POST_LIB_FLAGS_armv7-apple-ios := -CFG_DEF_SUFFIX_armv7-apple-ios := .darwin.def CFG_LLC_FLAGS_armv7-apple-ios := -mattr=+vfp3,+v7,+neon -march=arm CFG_INSTALL_NAME_armv7-apple-ios = -Wl,-install_name,@rpath/$(1) CFG_EXE_SUFFIX_armv7-apple-ios := CFG_WINDOWSY_armv7-apple-ios := CFG_UNIXY_armv7-apple-ios := 1 -CFG_PATH_MUNGE_armv7-apple-ios := true CFG_LDPATH_armv7-apple-ios := CFG_RUN_armv7-apple-ios = $(2) CFG_RUN_TARG_armv7-apple-ios = $(call CFG_RUN_armv7-apple-ios,,$(2)) diff --git a/mk/cfg/armv7s-apple-ios.mk b/mk/cfg/armv7s-apple-ios.mk index 7540bd44de8..96ca0764894 100644 --- a/mk/cfg/armv7s-apple-ios.mk +++ b/mk/cfg/armv7s-apple-ios.mk @@ -19,15 +19,11 @@ CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS CFG_GCCISH_CXXFLAGS_armv7s-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -I$(CFG_IOS_SDK_armv7s-apple-ios)/usr/include/c++/4.2.1 CFG_GCCISH_LINK_FLAGS_armv7s-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7s-apple-ios) -Wl,-no_compact_unwind CFG_GCCISH_DEF_FLAG_armv7s-apple-ios := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_armv7s-apple-ios := -CFG_GCCISH_POST_LIB_FLAGS_armv7s-apple-ios := -CFG_DEF_SUFFIX_armv7s-apple-ios := .darwin.def CFG_LLC_FLAGS_armv7s-apple-ios := -mattr=+vfp4,+v7,+neon CFG_INSTALL_NAME_armv7s-apple-ios = -Wl,-install_name,@rpath/$(1) CFG_EXE_SUFFIX_armv7s-apple-ios := CFG_WINDOWSY_armv7s-apple-ios := CFG_UNIXY_armv7s-apple-ios := 1 -CFG_PATH_MUNGE_armv7s-apple-ios := true CFG_LDPATH_armv7s-apple-ios := CFG_RUN_armv7s-apple-ios = $(2) CFG_RUN_TARG_armv7s-apple-ios = $(call CFG_RUN_armv7s-apple-ios,,$(2)) diff --git a/mk/cfg/i386-apple-ios.mk b/mk/cfg/i386-apple-ios.mk index e84bf49d407..373e2e3b65d 100644 --- a/mk/cfg/i386-apple-ios.mk +++ b/mk/cfg/i386-apple-ios.mk @@ -18,15 +18,11 @@ CFG_GCCISH_CFLAGS_i386-apple-ios := -Wall -Werror -g -fPIC -m32 $(CFG_IOSSIM_FLA CFG_GCCISH_CXXFLAGS_i386-apple-ios := -fno-rtti $(CFG_IOSSIM_FLAGS_i386-apple-ios) -I$(CFG_IOSSIM_SDK_i386-apple-ios)/usr/include/c++/4.2.1 CFG_GCCISH_LINK_FLAGS_i386-apple-ios := -lpthread -m32 -Wl,-no_compact_unwind -m32 -Wl,-syslibroot $(CFG_IOSSIM_SDK_i386-apple-ios) CFG_GCCISH_DEF_FLAG_i386-apple-ios := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_i386-apple-ios := -CFG_GCCISH_POST_LIB_FLAGS_i386-apple-ios := -CFG_DEF_SUFFIX_i386-apple-ios := .darwin.def CFG_LLC_FLAGS_i386-apple-ios = CFG_INSTALL_NAME_i386-apple-ios = -Wl,-install_name,@rpath/$(1) CFG_EXE_SUFFIX_i386-apple-ios := CFG_WINDOWSY_i386-apple-ios := CFG_UNIXY_i386-apple-ios := 1 -CFG_PATH_MUNGE_i386-apple-ios = :true CFG_LDPATH_i386-apple-ios = CFG_RUN_i386-apple-ios = $(2) CFG_RUN_TARG_i386-apple-ios = $(call CFG_RUN_i386-apple-ios,,$(2)) diff --git a/mk/cfg/i686-apple-darwin.mk b/mk/cfg/i686-apple-darwin.mk index e935ce053e0..7ebb492bb21 100644 --- a/mk/cfg/i686-apple-darwin.mk +++ b/mk/cfg/i686-apple-darwin.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_i686-apple-darwin := -Wall -Werror -g -fPIC -m32 -arch i386 $( CFG_GCCISH_CXXFLAGS_i686-apple-darwin := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-apple-darwin := -dynamiclib -pthread -framework CoreServices -m32 CFG_GCCISH_DEF_FLAG_i686-apple-darwin := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_i686-apple-darwin := -CFG_GCCISH_POST_LIB_FLAGS_i686-apple-darwin := -CFG_DEF_SUFFIX_i686-apple-darwin := .darwin.def CFG_LLC_FLAGS_i686-apple-darwin := CFG_INSTALL_NAME_i686-apple-darwin = -Wl,-install_name,@rpath/$(1) CFG_EXE_SUFFIX_i686-apple-darwin := CFG_WINDOWSY_i686-apple-darwin := CFG_UNIXY_i686-apple-darwin := 1 -CFG_PATH_MUNGE_i686-apple-darwin := true CFG_LDPATH_i686-apple-darwin := CFG_RUN_i686-apple-darwin=$(2) CFG_RUN_TARG_i686-apple-darwin=$(call CFG_RUN_i686-apple-darwin,,$(2)) diff --git a/mk/cfg/i686-pc-windows-gnu.mk b/mk/cfg/i686-pc-windows-gnu.mk index 357a321688b..174671a9a88 100644 --- a/mk/cfg/i686-pc-windows-gnu.mk +++ b/mk/cfg/i686-pc-windows-gnu.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_i686-pc-windows-gnu := -Wall -Werror -g -m32 -D_WIN32_WINNT=0x CFG_GCCISH_CXXFLAGS_i686-pc-windows-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-pc-windows-gnu := -shared -g -m32 CFG_GCCISH_DEF_FLAG_i686-pc-windows-gnu := -CFG_GCCISH_PRE_LIB_FLAGS_i686-pc-windows-gnu := -CFG_GCCISH_POST_LIB_FLAGS_i686-pc-windows-gnu := -CFG_DEF_SUFFIX_i686-pc-windows-gnu := .windows.def CFG_LLC_FLAGS_i686-pc-windows-gnu := CFG_INSTALL_NAME_i686-pc-windows-gnu = CFG_EXE_SUFFIX_i686-pc-windows-gnu := .exe CFG_WINDOWSY_i686-pc-windows-gnu := 1 CFG_UNIXY_i686-pc-windows-gnu := -CFG_PATH_MUNGE_i686-pc-windows-gnu := CFG_LDPATH_i686-pc-windows-gnu := CFG_RUN_i686-pc-windows-gnu=$(2) CFG_RUN_TARG_i686-pc-windows-gnu=$(call CFG_RUN_i686-pc-windows-gnu,,$(2)) diff --git a/mk/cfg/i686-unknown-linux-gnu.mk b/mk/cfg/i686-unknown-linux-gnu.mk index 1cc9c143e8d..88c0907f63b 100644 --- a/mk/cfg/i686-unknown-linux-gnu.mk +++ b/mk/cfg/i686-unknown-linux-gnu.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_i686-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32 CFG_GCCISH_DEF_FLAG_i686-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_i686-unknown-linux-gnu := CFG_INSTALL_NAME_i686-unknown-linux-gnu = CFG_EXE_SUFFIX_i686-unknown-linux-gnu = CFG_WINDOWSY_i686-unknown-linux-gnu := CFG_UNIXY_i686-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_i686-unknown-linux-gnu := true CFG_LDPATH_i686-unknown-linux-gnu := CFG_RUN_i686-unknown-linux-gnu=$(2) CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2)) diff --git a/mk/cfg/mips-unknown-linux-gnu.mk b/mk/cfg/mips-unknown-linux-gnu.mk index c5d84966f85..ba5f6d0e756 100644 --- a/mk/cfg/mips-unknown-linux-gnu.mk +++ b/mk/cfg/mips-unknown-linux-gnu.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_mips-unknown-linux-gnu := -Wall -g -fPIC -mips32r2 -msoft-floa CFG_GCCISH_CXXFLAGS_mips-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_mips-unknown-linux-gnu := -shared -fPIC -g -mips32r2 -msoft-float -mabi=32 CFG_GCCISH_DEF_FLAG_mips-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_mips-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_mips-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_mips-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_mips-unknown-linux-gnu := CFG_INSTALL_NAME_mips-unknown-linux-gnu = CFG_EXE_SUFFIX_mips-unknown-linux-gnu := CFG_WINDOWSY_mips-unknown-linux-gnu := CFG_UNIXY_mips-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_mips-unknown-linux-gnu := true CFG_LDPATH_mips-unknown-linux-gnu := CFG_RUN_mips-unknown-linux-gnu= CFG_RUN_TARG_mips-unknown-linux-gnu= diff --git a/mk/cfg/mipsel-unknown-linux-gnu.mk b/mk/cfg/mipsel-unknown-linux-gnu.mk index eb2f300abff..539038c7434 100644 --- a/mk/cfg/mipsel-unknown-linux-gnu.mk +++ b/mk/cfg/mipsel-unknown-linux-gnu.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_mipsel-unknown-linux-gnu := -Wall -g -fPIC -mips32 -mabi=32 $( CFG_GCCISH_CXXFLAGS_mipsel-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_mipsel-unknown-linux-gnu := -shared -fPIC -g -mips32 CFG_GCCISH_DEF_FLAG_mipsel-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_mipsel-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_mipsel-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_mipsel-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_mipsel-unknown-linux-gnu := CFG_INSTALL_NAME_mipsel-unknown-linux-gnu = CFG_EXE_SUFFIX_mipsel-unknown-linux-gnu := CFG_WINDOWSY_mipsel-unknown-linux-gnu := CFG_UNIXY_mipsel-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_mipsel-unknown-linux-gnu := true CFG_LDPATH_mipsel-unknown-linux-gnu := CFG_RUN_mipsel-unknown-linux-gnu= CFG_RUN_TARG_mipsel-unknown-linux-gnu= diff --git a/mk/cfg/powerpc-unknown-linux-gnu.mk b/mk/cfg/powerpc-unknown-linux-gnu.mk index fd37bd663f7..dda957673eb 100644 --- a/mk/cfg/powerpc-unknown-linux-gnu.mk +++ b/mk/cfg/powerpc-unknown-linux-gnu.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_powerpc-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFL CFG_GCCISH_CXXFLAGS_powerpc-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_powerpc-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32 CFG_GCCISH_DEF_FLAG_powerpc-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_powerpc-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_powerpc-unknown-linux-gnu := CFG_INSTALL_NAME_powerpc-unknown-linux-gnu = CFG_EXE_SUFFIX_powerpc-unknown-linux-gnu = CFG_WINDOWSY_powerpc-unknown-linux-gnu := CFG_UNIXY_powerpc-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_powerpc-unknown-linux-gnu := true CFG_LDPATH_powerpc-unknown-linux-gnu := CFG_RUN_powerpc-unknown-linux-gnu=$(2) CFG_RUN_TARG_powerpc-unknown-linux-gnu=$(call CFG_RUN_powerpc-unknown-linux-gnu,,$(2)) diff --git a/mk/cfg/x86_64-apple-darwin.mk b/mk/cfg/x86_64-apple-darwin.mk index dbd67542ab7..4c68d3dcf37 100644 --- a/mk/cfg/x86_64-apple-darwin.mk +++ b/mk/cfg/x86_64-apple-darwin.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_6 CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -m64 CFG_GCCISH_DEF_FLAG_x86_64-apple-darwin := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-apple-darwin := -CFG_GCCISH_POST_LIB_FLAGS_x86_64-apple-darwin := -CFG_DEF_SUFFIX_x86_64-apple-darwin := .darwin.def CFG_LLC_FLAGS_x86_64-apple-darwin := CFG_INSTALL_NAME_x86_64-apple-darwin = -Wl,-install_name,@rpath/$(1) CFG_EXE_SUFFIX_x86_64-apple-darwin := CFG_WINDOWSY_x86_64-apple-darwin := CFG_UNIXY_x86_64-apple-darwin := 1 -CFG_PATH_MUNGE_x86_64-apple-darwin := true CFG_LDPATH_x86_64-apple-darwin := CFG_RUN_x86_64-apple-darwin=$(2) CFG_RUN_TARG_x86_64-apple-darwin=$(call CFG_RUN_x86_64-apple-darwin,,$(2)) diff --git a/mk/cfg/x86_64-apple-ios.mk b/mk/cfg/x86_64-apple-ios.mk index b3f05a895a4..dd6080fdb0b 100644 --- a/mk/cfg/x86_64-apple-ios.mk +++ b/mk/cfg/x86_64-apple-ios.mk @@ -20,16 +20,12 @@ CFG_GCCISH_CFLAGS_x86_64-apple-ios := -Wall -Werror -fPIC $(CFG_IOSSIM_FLAGS_x86 CFG_GCCISH_CXXFLAGS_x86_64-apple-ios := -fno-rtti $(CFG_IOSSIM_FLAGS_x86_64-apple-ios) -I$(CFG_IOSSIM_SDK_x86_64-apple-ios)/usr/include/c++/4.2.1 CFG_GCCISH_LINK_FLAGS_x86_64-apple-ios := -lpthread -Wl,-no_compact_unwind -m64 -Wl,-syslibroot $(CFG_IOSSIM_SDK_x86_64-apple-ios) CFG_GCCISH_DEF_FLAG_x86_64-apple-ios := -Wl,-exported_symbols_list, -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-apple-ios := -CFG_GCCISH_POST_LIB_FLAGS_x86_64-apple-ios := -CFG_DEF_SUFFIX_x86_64-apple-ios := .darwin.def CFG_LLC_FLAGS_x86_64-apple-ios := CFG_INSTALL_NAME_x86_64-apple-ios = -Wl,-install_name,@rpath/$(1) CFG_LIBUV_LINK_FLAGS_x86_64-apple-ios := CFG_EXE_SUFFIX_x86_64-apple-ios := CFG_WINDOWSY_x86_64-apple-ios := CFG_UNIXY_x86_64-apple-ios := 1 -CFG_PATH_MUNGE_x86_64-apple-ios := true CFG_LDPATH_x86_64-apple-ios := CFG_RUN_x86_64-apple-ios = $(2) CFG_RUN_TARG_x86_64-apple-ios = $(call CFG_RUN_x86_64-apple-ios,,$(2)) diff --git a/mk/cfg/x86_64-pc-windows-gnu.mk b/mk/cfg/x86_64-pc-windows-gnu.mk index e9e5f04ea54..4118ea26c07 100644 --- a/mk/cfg/x86_64-pc-windows-gnu.mk +++ b/mk/cfg/x86_64-pc-windows-gnu.mk @@ -13,15 +13,11 @@ CFG_GCCISH_CFLAGS_x86_64-pc-windows-gnu := -Wall -Werror -g -m64 -D_WIN32_WINNT= CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-pc-windows-gnu := -shared -g -m64 CFG_GCCISH_DEF_FLAG_x86_64-pc-windows-gnu := -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-pc-windows-gnu := -CFG_GCCISH_POST_LIB_FLAGS_x86_64-pc-windows-gnu := -CFG_DEF_SUFFIX_x86_64-pc-windows-gnu := .windows.def CFG_LLC_FLAGS_x86_64-pc-windows-gnu := CFG_INSTALL_NAME_x86_64-pc-windows-gnu = CFG_EXE_SUFFIX_x86_64-pc-windows-gnu := .exe CFG_WINDOWSY_x86_64-pc-windows-gnu := 1 CFG_UNIXY_x86_64-pc-windows-gnu := -CFG_PATH_MUNGE_x86_64-pc-windows-gnu := CFG_LDPATH_x86_64-pc-windows-gnu := CFG_RUN_x86_64-pc-windows-gnu=$(2) CFG_RUN_TARG_x86_64-pc-windows-gnu=$(call CFG_RUN_x86_64-pc-windows-gnu,,$(2)) diff --git a/mk/cfg/x86_64-unknown-bitrig.mk b/mk/cfg/x86_64-unknown-bitrig.mk index ad34988cb1b..dd6d19f7491 100644 --- a/mk/cfg/x86_64-unknown-bitrig.mk +++ b/mk/cfg/x86_64-unknown-bitrig.mk @@ -11,15 +11,11 @@ CFG_JEMALLOC_CFLAGS_x86_64-unknown-bitrig := -m64 -I/usr/include $(CFLAGS) CFG_GCCISH_CFLAGS_x86_64-unknown-bitrig := -Wall -Werror -fPIC -m64 -I/usr/include $(CFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-unknown-bitrig := -shared -pic -pthread -m64 $(LDFLAGS) CFG_GCCISH_DEF_FLAG_x86_64-unknown-bitrig := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-bitrig := -Wl,-pic -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-bitrig := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_x86_64-unknown-bitrig := .bsd.def CFG_LLC_FLAGS_x86_64-unknown-bitrig := CFG_INSTALL_NAME_x86_64-unknown-bitrig = CFG_EXE_SUFFIX_x86_64-unknown-bitrig := CFG_WINDOWSY_x86_64-unknown-bitrig := CFG_UNIXY_x86_64-unknown-bitrig := 1 -CFG_PATH_MUNGE_x86_64-unknown-bitrig := CFG_LDPATH_x86_64-unknown-bitrig := CFG_RUN_x86_64-unknown-bitrig=$(2) CFG_RUN_TARG_x86_64-unknown-bitrig=$(call CFG_RUN_x86_64-unknown-bitrig,,$(2)) diff --git a/mk/cfg/x86_64-unknown-dragonfly.mk b/mk/cfg/x86_64-unknown-dragonfly.mk index 9665b5c7802..4015293826e 100644 --- a/mk/cfg/x86_64-unknown-dragonfly.mk +++ b/mk/cfg/x86_64-unknown-dragonfly.mk @@ -11,15 +11,11 @@ CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -m64 -I/usr/include -I/usr/local CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -m64 -I/usr/include -I/usr/local/include $(CFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt -m64 CFG_GCCISH_DEF_FLAG_x86_64-unknown-dragonfly := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_x86_64-unknown-dragonfly := .bsd.def CFG_LLC_FLAGS_x86_64-unknown-dragonfly := CFG_INSTALL_NAME_x86_64-unknown-dragonfly = CFG_EXE_SUFFIX_x86_64-unknown-dragonfly := CFG_WINDOWSY_x86_64-unknown-dragonfly := CFG_UNIXY_x86_64-unknown-dragonfly := 1 -CFG_PATH_MUNGE_x86_64-unknown-dragonfly := CFG_LDPATH_x86_64-unknown-dragonfly := CFG_RUN_x86_64-unknown-dragonfly=$(2) CFG_RUN_TARG_x86_64-unknown-dragonfly=$(call CFG_RUN_x86_64-unknown-dragonfly,,$(2)) diff --git a/mk/cfg/x86_64-unknown-freebsd.mk b/mk/cfg/x86_64-unknown-freebsd.mk index 4e847ea78a7..1bd43168b4f 100644 --- a/mk/cfg/x86_64-unknown-freebsd.mk +++ b/mk/cfg/x86_64-unknown-freebsd.mk @@ -11,15 +11,11 @@ CFG_JEMALLOC_CFLAGS_x86_64-unknown-freebsd := -I/usr/local/include $(CFLAGS) CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-unknown-freebsd := -shared -fPIC -g -pthread -lrt CFG_GCCISH_DEF_FLAG_x86_64-unknown-freebsd := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-freebsd := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-freebsd := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_x86_64-unknown-freebsd := .bsd.def CFG_LLC_FLAGS_x86_64-unknown-freebsd := CFG_INSTALL_NAME_x86_64-unknown-freebsd = CFG_EXE_SUFFIX_x86_64-unknown-freebsd := CFG_WINDOWSY_x86_64-unknown-freebsd := CFG_UNIXY_x86_64-unknown-freebsd := 1 -CFG_PATH_MUNGE_x86_64-unknown-freebsd := CFG_LDPATH_x86_64-unknown-freebsd := CFG_RUN_x86_64-unknown-freebsd=$(2) CFG_RUN_TARG_x86_64-unknown-freebsd=$(call CFG_RUN_x86_64-unknown-freebsd,,$(2)) diff --git a/mk/cfg/x86_64-unknown-linux-gnu.mk b/mk/cfg/x86_64-unknown-linux-gnu.mk index e5866094ee8..044c687c9fc 100644 --- a/mk/cfg/x86_64-unknown-linux-gnu.mk +++ b/mk/cfg/x86_64-unknown-linux-gnu.mk @@ -12,15 +12,11 @@ CFG_GCCISH_CFLAGS_x86_64-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64 CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-gnu := -fno-rtti CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m64 CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def CFG_LLC_FLAGS_x86_64-unknown-linux-gnu := CFG_INSTALL_NAME_x86_64-unknown-linux-gnu = CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu = CFG_WINDOWSY_x86_64-unknown-linux-gnu := CFG_UNIXY_x86_64-unknown-linux-gnu := 1 -CFG_PATH_MUNGE_x86_64-unknown-linux-gnu := true CFG_LDPATH_x86_64-unknown-linux-gnu := CFG_RUN_x86_64-unknown-linux-gnu=$(2) CFG_RUN_TARG_x86_64-unknown-linux-gnu=$(call CFG_RUN_x86_64-unknown-linux-gnu,,$(2)) diff --git a/mk/cfg/x86_64-unknown-openbsd.mk b/mk/cfg/x86_64-unknown-openbsd.mk index 582d75c3eaf..261616ecf1f 100644 --- a/mk/cfg/x86_64-unknown-openbsd.mk +++ b/mk/cfg/x86_64-unknown-openbsd.mk @@ -11,15 +11,11 @@ CFG_JEMALLOC_CFLAGS_x86_64-unknown-openbsd := -m64 -I/usr/include $(CFLAGS) CFG_GCCISH_CFLAGS_x86_64-unknown-openbsd := -Wall -Werror -g -fPIC -m64 -I/usr/include $(CFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-unknown-openbsd := -shared -fPIC -g -pthread -m64 CFG_GCCISH_DEF_FLAG_x86_64-unknown-openbsd := -Wl,--export-dynamic,--dynamic-list= -CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-whole-archive -CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-no-whole-archive -CFG_DEF_SUFFIX_x86_64-unknown-openbsd := .bsd.def CFG_LLC_FLAGS_x86_64-unknown-openbsd := CFG_INSTALL_NAME_x86_64-unknown-openbsd = CFG_EXE_SUFFIX_x86_64-unknown-openbsd := CFG_WINDOWSY_x86_64-unknown-openbsd := CFG_UNIXY_x86_64-unknown-openbsd := 1 -CFG_PATH_MUNGE_x86_64-unknown-openbsd := CFG_LDPATH_x86_64-unknown-openbsd := CFG_RUN_x86_64-unknown-openbsd=$(2) CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2)) diff --git a/mk/rustllvm.mk b/mk/rustllvm.mk index 44225020811..363022e8781 100644 --- a/mk/rustllvm.mk +++ b/mk/rustllvm.mk @@ -25,8 +25,6 @@ endif RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, \ ExecutionEngineWrapper.cpp RustWrapper.cpp PassWrapper.cpp) -RUSTLLVM_DEF_$(1) := $(1)/rustllvm/rustllvm$(CFG_DEF_SUFFIX_$(1)) - RUSTLLVM_INCS_$(1) = $$(LLVM_EXTRA_INCDIRS_$(1)) \ -iquote $$(LLVM_INCDIR_$(1)) \ -iquote $$(S)src/rustllvm/include From ba2380d7b328ae59261d134970593c2a2668c690 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 15:53:32 -0700 Subject: [PATCH 02/10] rustc: Add target_env for triples by default This adds a new `#[cfg]` matcher against the `target_env` property of the destination target triple. For example all windows triples today end with `-gnu` but we will also hopefully support non-`gnu` targets for Windows, at which point we'll need to differentiate between the two. This new `target_env` matches is provided and filled in with the target's environment name. Currently the only non-empty value of this name is `gnu`, but `musl` will be shortly added for the linux triples. --- src/librustc/session/config.rs | 5 +++-- src/librustc_back/target/aarch64_apple_ios.rs | 1 + src/librustc_back/target/aarch64_linux_android.rs | 1 + src/librustc_back/target/aarch64_unknown_linux_gnu.rs | 1 + src/librustc_back/target/arm_linux_androideabi.rs | 1 + src/librustc_back/target/arm_unknown_linux_gnueabi.rs | 1 + src/librustc_back/target/arm_unknown_linux_gnueabihf.rs | 1 + src/librustc_back/target/armv7_apple_ios.rs | 1 + src/librustc_back/target/armv7s_apple_ios.rs | 1 + src/librustc_back/target/i386_apple_ios.rs | 1 + src/librustc_back/target/i686_apple_darwin.rs | 1 + src/librustc_back/target/i686_pc_windows_gnu.rs | 1 + src/librustc_back/target/i686_unknown_dragonfly.rs | 1 + src/librustc_back/target/i686_unknown_linux_gnu.rs | 1 + src/librustc_back/target/mips_unknown_linux_gnu.rs | 1 + src/librustc_back/target/mipsel_unknown_linux_gnu.rs | 1 + src/librustc_back/target/mod.rs | 4 ++++ src/librustc_back/target/powerpc_unknown_linux_gnu.rs | 1 + src/librustc_back/target/x86_64_apple_darwin.rs | 1 + src/librustc_back/target/x86_64_apple_ios.rs | 1 + src/librustc_back/target/x86_64_pc_windows_gnu.rs | 1 + src/librustc_back/target/x86_64_unknown_bitrig.rs | 1 + src/librustc_back/target/x86_64_unknown_dragonfly.rs | 1 + src/librustc_back/target/x86_64_unknown_freebsd.rs | 1 + src/librustc_back/target/x86_64_unknown_linux_gnu.rs | 1 + src/librustc_back/target/x86_64_unknown_openbsd.rs | 1 + 26 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 050ccd64712..072761f2754 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -621,6 +621,7 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig { let arch = &sess.target.target.arch; let wordsz = &sess.target.target.target_pointer_width; let os = &sess.target.target.target_os; + let env = &sess.target.target.target_env; let fam = match sess.target.target.options.is_like_windows { true => InternedString::new("windows"), @@ -634,8 +635,8 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig { mk(InternedString::new("target_family"), fam), mk(InternedString::new("target_arch"), intern(arch)), mk(InternedString::new("target_endian"), intern(end)), - mk(InternedString::new("target_pointer_width"), - intern(wordsz)) + mk(InternedString::new("target_pointer_width"), intern(wordsz)), + mk(InternedString::new("target_env"), intern(env)), ]; if sess.opts.debug_assertions { ret.push(attr::mk_word_item(InternedString::new("debug_assertions"))); diff --git a/src/librustc_back/target/aarch64_apple_ios.rs b/src/librustc_back/target/aarch64_apple_ios.rs index 2ceb34e68b7..dd6bc672a03 100644 --- a/src/librustc_back/target/aarch64_apple_ios.rs +++ b/src/librustc_back/target/aarch64_apple_ios.rs @@ -22,6 +22,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "aarch64".to_string(), target_os: "ios".to_string(), + target_env: "".to_string(), options: TargetOptions { features: "+neon,+fp-armv8,+cyclone".to_string(), eliminate_frame_pointer: false, diff --git a/src/librustc_back/target/aarch64_linux_android.rs b/src/librustc_back/target/aarch64_linux_android.rs index 64b0e0cfd6b..fcc901fc81f 100644 --- a/src/librustc_back/target/aarch64_linux_android.rs +++ b/src/librustc_back/target/aarch64_linux_android.rs @@ -24,6 +24,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "aarch64".to_string(), target_os: "android".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/aarch64_unknown_linux_gnu.rs b/src/librustc_back/target/aarch64_unknown_linux_gnu.rs index a3ef6372f06..18e67d066d0 100644 --- a/src/librustc_back/target/aarch64_unknown_linux_gnu.rs +++ b/src/librustc_back/target/aarch64_unknown_linux_gnu.rs @@ -19,6 +19,7 @@ pub fn target() -> Target { llvm_target: "aarch64-unknown-linux-gnu".to_string(), target_endian: "little".to_string(), target_pointer_width: "64".to_string(), + target_env: "gnu".to_string(), arch: "aarch64".to_string(), target_os: "linux".to_string(), options: base, diff --git a/src/librustc_back/target/arm_linux_androideabi.rs b/src/librustc_back/target/arm_linux_androideabi.rs index fad93441431..57712d18cba 100644 --- a/src/librustc_back/target/arm_linux_androideabi.rs +++ b/src/librustc_back/target/arm_linux_androideabi.rs @@ -31,6 +31,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "arm".to_string(), target_os: "android".to_string(), + target_env: "gnu".to_string(), options: base, } } diff --git a/src/librustc_back/target/arm_unknown_linux_gnueabi.rs b/src/librustc_back/target/arm_unknown_linux_gnueabi.rs index 32eccaf54b0..30015c4a7e6 100644 --- a/src/librustc_back/target/arm_unknown_linux_gnueabi.rs +++ b/src/librustc_back/target/arm_unknown_linux_gnueabi.rs @@ -23,6 +23,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "arm".to_string(), target_os: "linux".to_string(), + target_env: "gnueabi".to_string(), options: TargetOptions { features: "+v6".to_string(), diff --git a/src/librustc_back/target/arm_unknown_linux_gnueabihf.rs b/src/librustc_back/target/arm_unknown_linux_gnueabihf.rs index eff3601250f..8f8c7114e6e 100644 --- a/src/librustc_back/target/arm_unknown_linux_gnueabihf.rs +++ b/src/librustc_back/target/arm_unknown_linux_gnueabihf.rs @@ -23,6 +23,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "arm".to_string(), target_os: "linux".to_string(), + target_env: "gnueabihf".to_string(), options: TargetOptions { features: "+v6,+vfp2".to_string(), diff --git a/src/librustc_back/target/armv7_apple_ios.rs b/src/librustc_back/target/armv7_apple_ios.rs index 41376421886..3b55993659d 100644 --- a/src/librustc_back/target/armv7_apple_ios.rs +++ b/src/librustc_back/target/armv7_apple_ios.rs @@ -19,6 +19,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "arm".to_string(), target_os: "ios".to_string(), + target_env: "".to_string(), options: TargetOptions { features: "+v7,+vfp3,+neon".to_string(), .. opts(Arch::Armv7) diff --git a/src/librustc_back/target/armv7s_apple_ios.rs b/src/librustc_back/target/armv7s_apple_ios.rs index ef16aefdbd9..5a67e3fe127 100644 --- a/src/librustc_back/target/armv7s_apple_ios.rs +++ b/src/librustc_back/target/armv7s_apple_ios.rs @@ -19,6 +19,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "arm".to_string(), target_os: "ios".to_string(), + target_env: "".to_string(), options: TargetOptions { features: "+v7,+vfp4,+neon".to_string(), .. opts(Arch::Armv7s) diff --git a/src/librustc_back/target/i386_apple_ios.rs b/src/librustc_back/target/i386_apple_ios.rs index afe63d006cf..a9a073e2a8c 100644 --- a/src/librustc_back/target/i386_apple_ios.rs +++ b/src/librustc_back/target/i386_apple_ios.rs @@ -23,6 +23,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "x86".to_string(), target_os: "ios".to_string(), + target_env: "".to_string(), options: opts(Arch::I386) } } diff --git a/src/librustc_back/target/i686_apple_darwin.rs b/src/librustc_back/target/i686_apple_darwin.rs index fcea900283d..47b329982d4 100644 --- a/src/librustc_back/target/i686_apple_darwin.rs +++ b/src/librustc_back/target/i686_apple_darwin.rs @@ -26,6 +26,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "x86".to_string(), target_os: "macos".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/i686_pc_windows_gnu.rs b/src/librustc_back/target/i686_pc_windows_gnu.rs index 249f2d440e6..9e2aa20085c 100644 --- a/src/librustc_back/target/i686_pc_windows_gnu.rs +++ b/src/librustc_back/target/i686_pc_windows_gnu.rs @@ -30,6 +30,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "x86".to_string(), target_os: "windows".to_string(), + target_env: "gnu".to_string(), options: options, } } diff --git a/src/librustc_back/target/i686_unknown_dragonfly.rs b/src/librustc_back/target/i686_unknown_dragonfly.rs index 4450d8d6778..ecabe71ad4c 100644 --- a/src/librustc_back/target/i686_unknown_dragonfly.rs +++ b/src/librustc_back/target/i686_unknown_dragonfly.rs @@ -22,6 +22,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "x86".to_string(), target_os: "dragonfly".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/i686_unknown_linux_gnu.rs b/src/librustc_back/target/i686_unknown_linux_gnu.rs index f21f6adfb4c..21094ad905e 100644 --- a/src/librustc_back/target/i686_unknown_linux_gnu.rs +++ b/src/librustc_back/target/i686_unknown_linux_gnu.rs @@ -22,6 +22,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "x86".to_string(), target_os: "linux".to_string(), + target_env: "gnu".to_string(), options: base, } } diff --git a/src/librustc_back/target/mips_unknown_linux_gnu.rs b/src/librustc_back/target/mips_unknown_linux_gnu.rs index 8acc248e234..4662ff1958b 100644 --- a/src/librustc_back/target/mips_unknown_linux_gnu.rs +++ b/src/librustc_back/target/mips_unknown_linux_gnu.rs @@ -22,6 +22,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "mips".to_string(), target_os: "linux".to_string(), + target_env: "gnu".to_string(), options: super::linux_base::opts() } } diff --git a/src/librustc_back/target/mipsel_unknown_linux_gnu.rs b/src/librustc_back/target/mipsel_unknown_linux_gnu.rs index 604c62eb69f..80e38c5ddea 100644 --- a/src/librustc_back/target/mipsel_unknown_linux_gnu.rs +++ b/src/librustc_back/target/mipsel_unknown_linux_gnu.rs @@ -22,6 +22,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "mips".to_string(), target_os: "linux".to_string(), + target_env: "gnu".to_string(), options: super::linux_base::opts() } diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 07528df97f1..cf7499a337d 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -100,6 +100,8 @@ pub struct Target { pub target_pointer_width: String, /// OS name to use for conditional compilation. pub target_os: String, + /// Environment name to use for conditional compilation. + pub target_env: String, /// Architecture to use for ABI considerations. Valid options: "x86", "x86_64", "arm", /// "aarch64", "mips", and "powerpc". "mips" includes "mipsel". pub arch: String, @@ -250,6 +252,8 @@ pub fn from_json(obj: Json) -> Target { target_pointer_width: get_req_field("target-pointer-width"), arch: get_req_field("arch"), target_os: get_req_field("os"), + target_env: obj.find("env").and_then(|s| s.as_string()) + .map(|s| s.to_string()).unwrap_or(String::new()), options: Default::default(), }; diff --git a/src/librustc_back/target/powerpc_unknown_linux_gnu.rs b/src/librustc_back/target/powerpc_unknown_linux_gnu.rs index 5e0b7bcf3ef..3a2b4bd1606 100644 --- a/src/librustc_back/target/powerpc_unknown_linux_gnu.rs +++ b/src/librustc_back/target/powerpc_unknown_linux_gnu.rs @@ -21,6 +21,7 @@ pub fn target() -> Target { target_pointer_width: "32".to_string(), arch: "powerpc".to_string(), target_os: "linux".to_string(), + target_env: "gnu".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_apple_darwin.rs b/src/librustc_back/target/x86_64_apple_darwin.rs index 0b3b2bea62d..89a67da2d8b 100644 --- a/src/librustc_back/target/x86_64_apple_darwin.rs +++ b/src/librustc_back/target/x86_64_apple_darwin.rs @@ -25,6 +25,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "macos".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_apple_ios.rs b/src/librustc_back/target/x86_64_apple_ios.rs index 9df2ccca500..74491629ed8 100644 --- a/src/librustc_back/target/x86_64_apple_ios.rs +++ b/src/librustc_back/target/x86_64_apple_ios.rs @@ -21,6 +21,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "ios".to_string(), + target_env: "".to_string(), options: opts(Arch::X86_64) } } diff --git a/src/librustc_back/target/x86_64_pc_windows_gnu.rs b/src/librustc_back/target/x86_64_pc_windows_gnu.rs index 6b3054656fe..bea7d16e9df 100644 --- a/src/librustc_back/target/x86_64_pc_windows_gnu.rs +++ b/src/librustc_back/target/x86_64_pc_windows_gnu.rs @@ -27,6 +27,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "windows".to_string(), + target_env: "gnu".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_unknown_bitrig.rs b/src/librustc_back/target/x86_64_unknown_bitrig.rs index 7b7877c0c69..201c56b2e15 100644 --- a/src/librustc_back/target/x86_64_unknown_bitrig.rs +++ b/src/librustc_back/target/x86_64_unknown_bitrig.rs @@ -23,6 +23,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "bitrig".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_unknown_dragonfly.rs b/src/librustc_back/target/x86_64_unknown_dragonfly.rs index 676aaecc2fc..c590f0297b9 100644 --- a/src/librustc_back/target/x86_64_unknown_dragonfly.rs +++ b/src/librustc_back/target/x86_64_unknown_dragonfly.rs @@ -24,6 +24,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "dragonfly".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_unknown_freebsd.rs b/src/librustc_back/target/x86_64_unknown_freebsd.rs index 3275cb07b5a..0d8ea90a2ab 100644 --- a/src/librustc_back/target/x86_64_unknown_freebsd.rs +++ b/src/librustc_back/target/x86_64_unknown_freebsd.rs @@ -24,6 +24,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "freebsd".to_string(), + target_env: "".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_unknown_linux_gnu.rs b/src/librustc_back/target/x86_64_unknown_linux_gnu.rs index 49c4ad4aea9..ba945afc564 100644 --- a/src/librustc_back/target/x86_64_unknown_linux_gnu.rs +++ b/src/librustc_back/target/x86_64_unknown_linux_gnu.rs @@ -24,6 +24,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "linux".to_string(), + target_env: "gnu".to_string(), options: base, } } diff --git a/src/librustc_back/target/x86_64_unknown_openbsd.rs b/src/librustc_back/target/x86_64_unknown_openbsd.rs index d2667dcd1dd..7f64259adf9 100644 --- a/src/librustc_back/target/x86_64_unknown_openbsd.rs +++ b/src/librustc_back/target/x86_64_unknown_openbsd.rs @@ -23,6 +23,7 @@ pub fn target() -> Target { target_pointer_width: "64".to_string(), arch: "x86_64".to_string(), target_os: "openbsd".to_string(), + target_env: "".to_string(), options: base, } } From cd980b3bee5bd48e8a6cd4c0d7c8e0fb0fdb64dd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 15:42:05 -0700 Subject: [PATCH 03/10] mk: Add support for musl-based builds This commit adds support to the makefiles, configuration script, and build system to understand MUSL. This is broken up into a few parts: * Any target of the form `*-musl` requires the `--musl-root` option to `./configure` which will indicate the root of the MUSL installation. It is also expected that there is a libunwind build inside of that installation built against that MUSL. * Objects from MUSL are copied into the build tree for Rust to be statically linked into the appropriate Rust library. * Objects for binary startup and shutdown are included in each Rust installation by default for MUSL. This requires MUSL to only be installed on the machine compiling rust. Only a linker will be necessary for compiling against MUSL on a target machine. Eventually a MUSL and/or libunwind build may be integrated by default into the build but for now they are just always assumed to exist externally. --- configure | 8 ++++++++ mk/cfg/x86_64-unknown-linux-musl.mk | 27 +++++++++++++++++++++++++++ mk/crates.mk | 3 +++ mk/main.mk | 6 ++++-- mk/prepare.mk | 4 ++-- mk/rt.mk | 21 ++++++++++++++++++++- mk/target.mk | 13 ++++--------- 7 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 mk/cfg/x86_64-unknown-linux-musl.mk diff --git a/configure b/configure index 6d629bf9807..71d608fbdaa 100755 --- a/configure +++ b/configure @@ -583,6 +583,7 @@ valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located" valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple" valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path" valopt release-channel "dev" "the name of the release channel to build" +valopt musl-root "/usr/local" "MUSL root installation directory" # Many of these are saved below during the "writing configuration" step # (others are conditionally saved). @@ -1058,6 +1059,13 @@ do fi ;; + + *-musl) + if [ ! -f $CFG_MUSL_ROOT/lib/libc.a ] + then + err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found" + fi + ;; *) ;; esac diff --git a/mk/cfg/x86_64-unknown-linux-musl.mk b/mk/cfg/x86_64-unknown-linux-musl.mk new file mode 100644 index 00000000000..b3dea6f97cb --- /dev/null +++ b/mk/cfg/x86_64-unknown-linux-musl.mk @@ -0,0 +1,27 @@ +# x86_64-unknown-linux-musl configuration +CC_x86_64-unknown-linux-musl=$(CFG_MUSL_ROOT)/bin/musl-gcc +CXX_x86_64-unknown-linux-musl=notaprogram +CPP_x86_64-unknown-linux-musl=$(CFG_MUSL_ROOT)/bin/musl-gcc -E +AR_x86_64-unknown-linux-musl=$(AR) +CFG_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).so +CFG_STATIC_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).a +CFG_LIB_GLOB_x86_64-unknown-linux-musl=lib$(1)-*.so +CFG_JEMALLOC_CFLAGS_x86_64-unknown-linux-musl := -m64 +CFG_GCCISH_CFLAGS_x86_64-unknown-linux-musl := -Wall -Werror -g -fPIC -m64 +CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-musl := +CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-musl := +CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-musl := +CFG_LLC_FLAGS_x86_64-unknown-linux-musl := +CFG_INSTALL_NAME_x86_64-unknown-linux-musl = +CFG_EXE_SUFFIX_x86_64-unknown-linux-musl = +CFG_WINDOWSY_x86_64-unknown-linux-musl := +CFG_UNIXY_x86_64-unknown-linux-musl := 1 +CFG_LDPATH_x86_64-unknown-linux-musl := +CFG_RUN_x86_64-unknown-linux-musl=$(2) +CFG_RUN_TARG_x86_64-unknown-linux-musl=$(call CFG_RUN_x86_64-unknown-linux-musl,,$(2)) +CFG_GNU_TRIPLE_x86_64-unknown-linux-musl := x86_64-unknown-linux-musl + +NATIVE_DEPS_libc_T_x86_64-unknown-linux-musl += libc.a +NATIVE_DEPS_std_T_x86_64-unknown-linux-musl += libunwind.a \ + crt1.o crti.o crtn.o +INSTALLED_OBJECTS_x86_64-unknown-linux-musl += crt1.o crti.o crtn.o diff --git a/mk/crates.mk b/mk/crates.mk index e7c6a716f4c..367c25a8a6d 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -123,6 +123,9 @@ ONLY_RLIB_rustc_bitflags := 1 # Documented-by-default crates DOC_CRATES := std alloc collections core libc rustc_unicode +# Installed objects/libraries by default +INSTALLED_OBJECTS := libmorestack.a libcompiler-rt.a + ################################################################################ # You should not need to edit below this line ################################################################################ diff --git a/mk/main.mk b/mk/main.mk index c1ce1051d0a..9ac96aa90f6 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -399,8 +399,10 @@ endif # Prerequisites for using the stageN compiler to build target artifacts TSREQ$(1)_T_$(2)_H_$(3) = \ $$(HSREQ$(1)_H_$(3)) \ - $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a \ - $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a + $$(foreach obj,$$(INSTALLED_OBJECTS),\ + $$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) \ + $$(foreach obj,$$(INSTALLED_OBJECTS_$(2)),\ + $$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) # Prerequisites for a working stageN compiler and libraries, for a specific # target diff --git a/mk/prepare.mk b/mk/prepare.mk index 4ded8a7916b..1382d160e13 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -140,8 +140,8 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \ $$(if $$(findstring $(2),$$(CFG_HOST)), \ $$(foreach crate,$$(HOST_CRATES), \ $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),) \ - $$(call PREPARE_LIB,libmorestack.a) \ - $$(call PREPARE_LIB,libcompiler-rt.a),),),) + $$(foreach object,$$(INSTALLED_OBJECTS) $$(INSTALLED_OBJECTS_$(2)),\ + $$(call PREPARE_LIB,$$(object))),),),) endef define INSTALL_GDB_DEBUGGER_SCRIPTS_COMMANDS diff --git a/mk/rt.mk b/mk/rt.mk index 70abce8b460..6ca14456441 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -74,7 +74,8 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \ @mkdir -p $$(@D) @$$(call E, compile: $$@) $$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \ - -filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$< + -filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) \ + -relocation-model=pic -o $$@ $$< $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS) @mkdir -p $$(@D) @@ -110,6 +111,11 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1)) @$$(call E, link: $$@) $$(Q)$$(AR_$(1)) rcs $$@ $$^ +ifeq ($$(findstring windows,$(1)),windows) +$$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)) + $$(Q)cp $$< $$^ +endif + endef $(foreach target,$(CFG_TARGET), \ @@ -312,6 +318,19 @@ endif # endif for windowsy endif # endif for ios endif # endif for darwin +################################################################################ +# libc/libunwind for musl +# +# When we're building a musl-like target we're going to link libc/libunwind +# statically into the standard library and liblibc, so we need to make sure +# they're in a location that we can find +################################################################################ + +ifeq ($$(findstring musl,$(1)),musl) +$$(RT_OUTPUT_DIR_$(1))/%: $$(CFG_MUSL_ROOT)/lib/% + cp $$^ $$@ +endif + endef # Instantiate template for all stages/targets diff --git a/mk/target.mk b/mk/target.mk index 8cc74a9cbfb..319f44fd35b 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -35,7 +35,9 @@ CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4) := \ $$(foreach dep,$$(RUST_DEPS_$(4)), \ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \ $$(foreach dep,$$(NATIVE_DEPS_$(4)), \ - $$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),$$(dep))) + $$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),$$(dep))) \ + $$(foreach dep,$$(NATIVE_DEPS_$(4)_T_$(2)), \ + $$(RT_OUTPUT_DIR_$(2))/$$(dep)) endef $(foreach host,$(CFG_HOST), \ @@ -143,14 +145,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/: $$(TLIB$(1)_T_$(2)_H_$(3))/: mkdir -p $$@ -$$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a: \ - $$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),compiler-rt) \ - | $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP) - @$$(call E, cp: $$@) - $$(Q)cp $$< $$@ - -$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \ - $$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),morestack) \ +$$(TLIB$(1)_T_$(2)_H_$(3))/%: $$(RT_OUTPUT_DIR_$(2))/% \ | $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP) @$$(call E, cp: $$@) $$(Q)cp $$< $$@ From 22da16a4c5b22feac0be1fe34795c5781392bb33 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 15:59:32 -0700 Subject: [PATCH 04/10] rustc_back: Add x86_64-unknown-linux-musl as a target This commit adds support for x86_64-unknown-linux-musl as a target of the compiler. There's some comments in the commit about some of the more flavorful flags passed to the linker as it's not quite as trivial as the normal specs. --- src/librustc_back/target/linux_base.rs | 14 +-- src/librustc_back/target/mod.rs | 28 +----- .../target/x86_64_unknown_linux_musl.rs | 85 +++++++++++++++++++ 3 files changed, 96 insertions(+), 31 deletions(-) create mode 100644 src/librustc_back/target/x86_64_unknown_linux_musl.rs diff --git a/src/librustc_back/target/linux_base.rs b/src/librustc_back/target/linux_base.rs index d267bc77e49..823a4a81fa4 100644 --- a/src/librustc_back/target/linux_base.rs +++ b/src/librustc_back/target/linux_base.rs @@ -19,12 +19,16 @@ pub fn opts() -> TargetOptions { morestack: true, linker_is_gnu: true, has_rpath: true, - pre_link_args: vec!( - // GNU-style linkers will use this to omit linking to libraries which - // don't actually fulfill any relocations, but only for libraries which - // follow this flag. Thus, use it before specifying libraries to link to. + pre_link_args: vec![ + // We want to be able to strip as much executable code as possible + // from the linker command line, and this flag indicates to the + // linker that it can avoid linking in dynamic libraries that don't + // actually satisfy any symbols up to that point (as with many other + // resolutions the linker does). This option only applies to all + // following libraries so we're sure to pass it as one of the first + // arguments. "-Wl,--as-needed".to_string(), - ), + ], position_independent_executables: true, .. Default::default() } diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index cf7499a337d..c32eacda2a2 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -59,32 +59,6 @@ mod bitrig_base; mod openbsd_base; -mod armv7_apple_ios; -mod armv7s_apple_ios; -mod i386_apple_ios; - -mod arm_linux_androideabi; -mod arm_unknown_linux_gnueabi; -mod arm_unknown_linux_gnueabihf; -mod aarch64_apple_ios; -mod aarch64_linux_android; -mod aarch64_unknown_linux_gnu; -mod i686_apple_darwin; -mod i686_pc_windows_gnu; -mod i686_unknown_dragonfly; -mod i686_unknown_linux_gnu; -mod mips_unknown_linux_gnu; -mod mipsel_unknown_linux_gnu; -mod powerpc_unknown_linux_gnu; -mod x86_64_apple_darwin; -mod x86_64_apple_ios; -mod x86_64_pc_windows_gnu; -mod x86_64_unknown_freebsd; -mod x86_64_unknown_dragonfly; -mod x86_64_unknown_bitrig; -mod x86_64_unknown_linux_gnu; -mod x86_64_unknown_openbsd; - /// Everything `rustc` knows about how to compile for a specific target. /// /// Every field here must be specified, and has no default value. @@ -333,6 +307,7 @@ fn load_file(path: &Path) -> Result { macro_rules! load_specific { ( $($name:ident),+ ) => ( { + $(mod $name;)* let target = target.replace("-", "_"); if false { } $( @@ -362,6 +337,7 @@ macro_rules! load_specific { arm_unknown_linux_gnueabi, arm_unknown_linux_gnueabihf, aarch64_unknown_linux_gnu, + x86_64_unknown_linux_musl, arm_linux_androideabi, aarch64_linux_android, diff --git a/src/librustc_back/target/x86_64_unknown_linux_musl.rs b/src/librustc_back/target/x86_64_unknown_linux_musl.rs new file mode 100644 index 00000000000..74d61e90f67 --- /dev/null +++ b/src/librustc_back/target/x86_64_unknown_linux_musl.rs @@ -0,0 +1,85 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use target::Target; + +pub fn target() -> Target { + let mut base = super::linux_base::opts(); + base.cpu = "x86-64".to_string(); + base.linker = "musl-gcc".to_string(); + base.pre_link_args.push("-m64".to_string()); + + // Make sure that the linker/gcc really don't pull in anything, including + // default objects, libs, etc. + base.pre_link_args.push("-nostdlib".to_string()); + base.pre_link_args.push("-static".to_string()); + + // At least when this was tested, the linker would not add the + // `GNU_EH_FRAME` program header to executables generated, which is required + // when unwinding to locate the unwinding information. I'm not sure why this + // argument is *not* necessary for normal builds, but it can't hurt! + base.pre_link_args.push("-Wl,--eh-frame-hdr".to_string()); + + // There's a whole bunch of circular dependencies when dealing with MUSL + // unfortunately. To put this in perspective libc is statically linked to + // liblibc and libunwind is statically linked to libstd: + // + // * libcore depends on `fmod` which is in libc (transitively in liblibc). + // liblibc, however, depends on libcore. + // * compiler-rt has personality symbols that depend on libunwind, but + // libunwind is in libstd which depends on compiler-rt. + // + // Recall that linkers discard libraries and object files as much as + // possible, and with all the static linking and archives flying around with + // MUSL the linker is super aggressively stripping out objects. For example + // the first case has fmod stripped from liblibc (it's in its own object + // file) so it's not there when libcore needs it. In the second example all + // the unused symbols from libunwind are stripped (each is in its own object + // file in libstd) before we end up linking compiler-rt which depends on + // those symbols. + // + // To deal with these circular dependencies we just force the compiler to + // link everything as a group, not stripping anything out until everything + // is processed. The linker will still perform a pass to strip out object + // files but it won't do so until all objects/archives have been processed. + base.pre_link_args.push("-Wl,-(".to_string()); + base.post_link_args.push("-Wl,-)".to_string()); + + // When generating a statically linked executable there's generally some + // small setup needed which is listed in these files. These are provided by + // a musl toolchain and are linked by default by the `musl-gcc` script. Note + // that `gcc` also does this by default, it just uses some different files. + // + // Each target directory for musl has these object files included in it so + // they'll be included from there. + base.pre_link_objects.push("crt1.o".to_string()); + base.pre_link_objects.push("crti.o".to_string()); + base.post_link_objects.push("crtn.o".to_string()); + + // MUSL support doesn't currently include dynamic linking, so there's no + // need for dylibs or rpath business. Additionally `-pie` is incompatible + // with `-static`, so we can't pass `-pie`. + base.dynamic_linking = false; + base.has_rpath = false; + base.position_independent_executables = false; + + Target { + data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\ + f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\ + s0:64:64-f80:128:128-n8:16:32:64-S128".to_string(), + llvm_target: "x86_64-unknown-linux-musl".to_string(), + target_endian: "little".to_string(), + target_pointer_width: "64".to_string(), + arch: "x86_64".to_string(), + target_os: "linux".to_string(), + target_env: "musl".to_string(), + options: base, + } +} From d09851730c47f49555c84b76dd6e71d91b0555ed Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 18:00:16 -0700 Subject: [PATCH 05/10] rustc: Add support for linking arbitrary objects MUSL for example provides its own start/end objects in place of the standard ones shipped by gcc. --- src/librustc_back/target/mod.rs | 20 ++++++++++++++----- .../target/x86_64_unknown_linux_musl.rs | 1 - src/librustc_trans/back/link.rs | 10 +++++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index c32eacda2a2..3a79ae3e7c0 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -91,14 +91,22 @@ pub struct Target { pub struct TargetOptions { /// Linker to invoke. Defaults to "cc". pub linker: String, - /// Linker arguments that are unconditionally passed *before* any user-defined libraries. + /// Linker arguments that are unconditionally passed *before* any + /// user-defined libraries. pub pre_link_args: Vec, - /// Linker arguments that are unconditionally passed *after* any user-defined libraries. + /// Linker arguments that are unconditionally passed *after* any + /// user-defined libraries. pub post_link_args: Vec, - /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults to "default". + /// Objects to link before and after all others, always found within the + /// sysroot folder. + pub pre_link_objects: Vec, + pub post_link_objects: Vec, + /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults + /// to "default". pub cpu: String, - /// Default target features to pass to LLVM. These features will *always* be passed, and cannot - /// be disabled even via `-C`. Corresponds to `llc -mattr=$features`. + /// Default target features to pass to LLVM. These features will *always* be + /// passed, and cannot be disabled even via `-C`. Corresponds to `llc + /// -mattr=$features`. pub features: String, /// Whether dynamic linking is available on this target. Defaults to false. pub dynamic_linking: bool, @@ -183,6 +191,8 @@ fn default() -> TargetOptions { has_rpath: false, no_compiler_rt: false, position_independent_executables: false, + pre_link_objects: Vec::new(), + post_link_objects: Vec::new(), } } } diff --git a/src/librustc_back/target/x86_64_unknown_linux_musl.rs b/src/librustc_back/target/x86_64_unknown_linux_musl.rs index 74d61e90f67..3debad2e8f2 100644 --- a/src/librustc_back/target/x86_64_unknown_linux_musl.rs +++ b/src/librustc_back/target/x86_64_unknown_linux_musl.rs @@ -13,7 +13,6 @@ pub fn target() -> Target { let mut base = super::linux_base::opts(); base.cpu = "x86-64".to_string(); - base.linker = "musl-gcc".to_string(); base.pre_link_args.push("-m64".to_string()); // Make sure that the linker/gcc really don't pull in anything, including diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index b53be98a06c..c72072f0696 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -794,13 +794,21 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool, let pname = get_cc_prog(sess); let mut cmd = Command::new(&pname[..]); + let root = sess.target_filesearch(PathKind::Native).get_lib_path(); cmd.args(&sess.target.target.options.pre_link_args); + for obj in &sess.target.target.options.pre_link_objects { + cmd.arg(root.join(obj)); + } + link_args(&mut cmd, sess, dylib, tmpdir.path(), trans, obj_filename, out_filename); - cmd.args(&sess.target.target.options.post_link_args); if !sess.target.target.options.no_compiler_rt { cmd.arg("-lcompiler-rt"); } + for obj in &sess.target.target.options.post_link_objects { + cmd.arg(root.join(obj)); + } + cmd.args(&sess.target.target.options.post_link_args); if sess.opts.debugging_opts.print_link_args { println!("{:?}", &cmd); From 6c048723f83fad6c96c2e19d6dfa1db547371c11 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 15:56:55 -0700 Subject: [PATCH 06/10] std: Prepare for linking to musl This commit modifies the standard library and its dependencies to link correctly when built against MUSL. This primarily ensures that the right libraries are linked against and when they're linked against they're linked against statically. --- src/liballoc/heap.rs | 4 +++- src/liblibc/lib.rs | 6 +++++- src/libstd/dynamic_lib.rs | 4 +++- src/libstd/rt/libunwind.rs | 7 ++++++- src/libstd/rtdeps.rs | 2 +- src/libstd/sys/unix/time.rs | 3 ++- src/libstd/thread/local.rs | 1 + 7 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 9d1d8a7ac24..86a04a0687a 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -211,7 +211,9 @@ fn je_malloc_stats_print(write_cb: Option Date: Tue, 21 Apr 2015 20:00:55 -0700 Subject: [PATCH 07/10] compiletest: Don't force dylibs on musl MUSL support is currently only with static builds, so building a dylib will always fail. --- src/compiletest/runtest.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 3d4aebad9d6..33d4f761eea 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -1233,7 +1233,20 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps, let mut crate_type = if aux_props.no_prefer_dynamic { Vec::new() } else { - vec!("--crate-type=dylib".to_string()) + // We primarily compile all auxiliary libraries as dynamic libraries + // to avoid code size bloat and large binaries as much as possible + // for the test suite (otherwise including libstd statically in all + // executables takes up quite a bit of space). + // + // For targets like MUSL, however, there is no support for dynamic + // libraries so we just go back to building a normal library. Note, + // however, that if the library is built with `force_host` then it's + // ok to be a dylib as the host should always support dylibs. + if config.target.contains("musl") && !aux_props.force_host { + vec!("--crate-type=lib".to_string()) + } else { + vec!("--crate-type=dylib".to_string()) + } }; crate_type.extend(extra_link_args.clone().into_iter()); let aux_args = From 7dd62155d85e9556c2b2b70c03acce9910896696 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 20:01:34 -0700 Subject: [PATCH 08/10] std: Don't assume dlopen() works on yourself Statically linked executables do not succeed (aka MUSL-based executables). --- src/libstd/sys/unix/thread.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs index 281ac37e671..cfab9d1c51a 100644 --- a/src/libstd/sys/unix/thread.rs +++ b/src/libstd/sys/unix/thread.rs @@ -342,7 +342,10 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { static mut __pthread_get_minstack: Option = None; INIT.call_once(|| { - let lib = DynamicLibrary::open(None).unwrap(); + let lib = match DynamicLibrary::open(None) { + Ok(l) => l, + Err(..) => return, + }; unsafe { if let Ok(f) = lib.symbol("__pthread_get_minstack") { __pthread_get_minstack = Some(mem::transmute::<*const (), F>(f)); From 60f8f6bde9be62554a850c31c770357e7d3e576e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 23 Apr 2015 18:40:54 -0700 Subject: [PATCH 09/10] compiletest: Add support for `// ignore-musl` Add the ability to ignore a test based on the environment of the triple being used. --- src/compiletest/header.rs | 4 ++++ src/compiletest/util.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index f5505b6e83a..a648e51497e 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -170,6 +170,9 @@ fn ignore_stage(config: &Config) -> String { format!("ignore-{}", config.stage_id.split('-').next().unwrap()) } + fn ignore_env(config: &Config) -> String { + format!("ignore-{}", util::get_env(&config.target).unwrap_or("")) + } fn ignore_gdb(config: &Config, line: &str) -> bool { if config.mode != common::DebugInfoGdb { return false; @@ -231,6 +234,7 @@ fn ignore_lldb(config: &Config, line: &str) -> bool { !parse_name_directive(ln, &ignore_target(config)) && !parse_name_directive(ln, &ignore_architecture(config)) && !parse_name_directive(ln, &ignore_stage(config)) && + !parse_name_directive(ln, &ignore_env(config)) && !(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) && !(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) && !ignore_gdb(config, ln) && diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index a8b26cb3ef7..184d62db451 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -60,6 +60,10 @@ pub fn get_arch(triple: &str) -> &'static str { panic!("Cannot determine Architecture from triple"); } +pub fn get_env(triple: &str) -> Option<&str> { + triple.split('-').nth(3) +} + pub fn make_new_path(path: &str) -> String { assert!(cfg!(windows)); // Windows just uses PATH as the library search path, so we have to From 247842b741db380fbd0e0d73f37e86f6c561ca9d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 23 Apr 2015 18:41:37 -0700 Subject: [PATCH 10/10] test: Fix some tests to run with musl There were a few test cases to fix: * Dynamic libraries are not supported with MUSL right now, so all of those related test which force or require dylibs are ignored. * Looks like the default stack for MUSL is smaller than glibc, so a few stack allocations in benchmarks were boxed up (shouldn't have a perf impact). * Some small linkage tweaks here and there * Out-of-stack detection does not currently work with MUSL --- mk/rt.mk | 4 ++-- src/test/bench/noise.rs | 4 ++-- src/test/bench/shootout-reverse-complement.rs | 8 ++++---- src/test/run-pass-fulldeps/issue-13560.rs | 1 + src/test/run-pass/issue-12133-3.rs | 1 + src/test/run-pass/linkage-visibility.rs | 1 + src/test/run-pass/out-of-stack-new-thread-no-split.rs | 11 ++++++----- src/test/run-pass/sepcomp-extern.rs | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/mk/rt.mk b/mk/rt.mk index 6ca14456441..bd6578d3b72 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -113,7 +113,7 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1)) ifeq ($$(findstring windows,$(1)),windows) $$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)) - $$(Q)cp $$< $$^ + $$(Q)cp $$^ $$@ endif endef @@ -227,7 +227,7 @@ COMPRT_DEPS := $(wildcard \ $(S)src/compiler-rt/*/*/*/*) endif -COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) +COMPRT_NAME_$(1) := libcompiler-rt.a COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1)) COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index efbb5dfb549..81a6fb8ff6d 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -101,8 +101,8 @@ fn get(&self, x: f32, y: f32) -> f32 { fn main() { let symbols = [' ', '░', '▒', '▓', '█', '█']; - let mut pixels = [0f32; 256*256]; - let n2d = Noise2DContext::new(); + let mut pixels = Box::new([0f32; 256*256]); + let n2d = Box::new(Noise2DContext::new()); for _ in 0..100 { for y in 0..256 { diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index 7c9f33678a3..55b2b1e2e32 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -50,17 +50,17 @@ use std::thread; struct Tables { - table8: [u8; 1 << 8], - table16: [u16; 1 << 16] + table8: Box<[u8; 1 << 8]>, + table16: Box<[u16; 1 << 16]>, } impl Tables { fn new() -> Tables { - let mut table8 = [0;1 << 8]; + let mut table8 = Box::new([0;1 << 8]); for (i, v) in table8.iter_mut().enumerate() { *v = Tables::computed_cpl8(i as u8); } - let mut table16 = [0;1 << 16]; + let mut table16 = Box::new([0;1 << 16]); for (i, v) in table16.iter_mut().enumerate() { *v = (table8[i & 255] as u16) << 8 | table8[i >> 8] as u16; diff --git a/src/test/run-pass-fulldeps/issue-13560.rs b/src/test/run-pass-fulldeps/issue-13560.rs index 1541e809b61..fc9f241af7f 100644 --- a/src/test/run-pass-fulldeps/issue-13560.rs +++ b/src/test/run-pass-fulldeps/issue-13560.rs @@ -12,6 +12,7 @@ // aux-build:issue-13560-2.rs // aux-build:issue-13560-3.rs // ignore-stage1 +// ignore-musl // Regression test for issue #13560, the test itself is all in the dependent // libraries. The fail which previously failed to compile is the one numbered 3. diff --git a/src/test/run-pass/issue-12133-3.rs b/src/test/run-pass/issue-12133-3.rs index 79a53078545..66201ff901f 100644 --- a/src/test/run-pass/issue-12133-3.rs +++ b/src/test/run-pass/issue-12133-3.rs @@ -11,6 +11,7 @@ // aux-build:issue-12133-rlib.rs // aux-build:issue-12133-dylib.rs // aux-build:issue-12133-dylib2.rs +// ignore-musl // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/linkage-visibility.rs b/src/test/run-pass/linkage-visibility.rs index 74da4273b6a..98a7ce55540 100644 --- a/src/test/run-pass/linkage-visibility.rs +++ b/src/test/run-pass/linkage-visibility.rs @@ -11,6 +11,7 @@ // aux-build:linkage-visibility.rs // ignore-android: FIXME(#10379) // ignore-windows: std::dynamic_lib does not work on Windows well +// ignore-musl #![feature(std_misc)] diff --git a/src/test/run-pass/out-of-stack-new-thread-no-split.rs b/src/test/run-pass/out-of-stack-new-thread-no-split.rs index 0d0a5bee8a4..2c6e55b57b0 100644 --- a/src/test/run-pass/out-of-stack-new-thread-no-split.rs +++ b/src/test/run-pass/out-of-stack-new-thread-no-split.rs @@ -8,11 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//ignore-android -//ignore-freebsd -//ignore-ios -//ignore-dragonfly -//ignore-bitrig +// ignore-android +// ignore-freebsd +// ignore-ios +// ignore-dragonfly +// ignore-bitrig +// ignore-musl #![feature(asm)] diff --git a/src/test/run-pass/sepcomp-extern.rs b/src/test/run-pass/sepcomp-extern.rs index 973c61712c3..f21b787dab7 100644 --- a/src/test/run-pass/sepcomp-extern.rs +++ b/src/test/run-pass/sepcomp-extern.rs @@ -14,8 +14,8 @@ // Test accessing external items from multiple compilation units. +extern crate sepcomp_extern_lib; -#[link(name = "sepcomp_extern_lib")] extern { #[allow(ctypes)] fn foo() -> usize;