Rustc uses the LLVM format for specifying the cross
compiler target: <arch><sub>-<vendor>-<sys>-<abi>.
This is different from GCC, in order to not have
to mantain a translation script, we provide the user
with an option to specify himself the target via
LLVM_TARGET_ARCH which is similar to CROSS_COMPILE.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #241
need to set this unless you want the configured build
directory to select the cross-compiler automatically.
+
+config LLVM_TARGET_ARCH
+ string "Custom cross-compiler LLVM target (optional)"
+ help
+ Same as running 'make LLVM_TARGET_ARCH=target' but stored for
+ default make runs in this build directory. You don't
+ need to set this unless you want the configured build
+ directory to select the cross-compiler automatically.
+ This is used for LLVM based compilers such as clang or rustc.
#config PARALLEL_JOBS
# int "Number of jobs to run simultaneously (0 for auto)"
# default "0"
ifeq ($(UK_HAVE_DOT_CONFIG),y)
# Hide troublesome environment variables from sub processes
unexport CONFIG_CROSS_COMPILE
+unexport CONFIG_LLVM_TARGET_ARCH
unexport CONFIG_COMPILER
#unexport CC
#unexport LD
CONFIG_CROSS_COMPILE := $(CROSS_COMPILE:"%"=%)
endif
+ifneq ("$(origin LLVM_TARGET_ARCH)","undefined")
+CONFIG_LLVM_TARGET_ARCH := $(LLVM_TARGET_ARCH:"%"=%)
+endif
+
ifneq ("$(origin COMPILER)","undefined")
CONFIG_COMPILER := $(COMPILER:"%"=%)
else