Skip to content

Commit 823852b

Browse files
vladandrewunikraft-bot
authored andcommitted
build: Add LLVM_TARGET_ARCH
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 <[email protected]> Reviewed-by: Simon Kuenzer <[email protected]> Tested-by: Unikraft CI <[email protected]> GitHub-Pull-Request: unikraft#241
1 parent dedd3d4 commit 823852b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Config.uk

+9
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ config CROSS_COMPILE
168168
need to set this unless you want the configured build
169169
directory to select the cross-compiler automatically.
170170

171+
172+
config LLVM_TARGET_ARCH
173+
string "Custom cross-compiler LLVM target (optional)"
174+
help
175+
Same as running 'make LLVM_TARGET_ARCH=target' but stored for
176+
default make runs in this build directory. You don't
177+
need to set this unless you want the configured build
178+
directory to select the cross-compiler automatically.
179+
This is used for LLVM based compilers such as clang or rustc.
171180
#config PARALLEL_JOBS
172181
# int "Number of jobs to run simultaneously (0 for auto)"
173182
# default "0"

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ ifeq ($(sub_make_exec), 1)
515515
ifeq ($(UK_HAVE_DOT_CONFIG),y)
516516
# Hide troublesome environment variables from sub processes
517517
unexport CONFIG_CROSS_COMPILE
518+
unexport CONFIG_LLVM_TARGET_ARCH
518519
unexport CONFIG_COMPILER
519520
#unexport CC
520521
#unexport LD
@@ -548,6 +549,10 @@ ifneq ("$(origin CROSS_COMPILE)","undefined")
548549
CONFIG_CROSS_COMPILE := $(CROSS_COMPILE:"%"=%)
549550
endif
550551

552+
ifneq ("$(origin LLVM_TARGET_ARCH)","undefined")
553+
CONFIG_LLVM_TARGET_ARCH := $(LLVM_TARGET_ARCH:"%"=%)
554+
endif
555+
551556
ifneq ("$(origin COMPILER)","undefined")
552557
CONFIG_COMPILER := $(COMPILER:"%"=%)
553558
else

0 commit comments

Comments
 (0)