rust/mk/cfg/x86_64-unknown-linux-musl.mk
Alex Crichton cd980b3bee 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.
2015-04-27 10:11:15 -07:00

28 lines
1.3 KiB
Makefile

# 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