Riscv64gc support in the build scripts
This architecture is different from x86/aarch because its rust triplet (riscv64gc-...) differs from gcc/llvm/binutils triplet (more general riscv64-...). Therefore the build scripts have to bridge that mismatch. This introduces new build-time environment variable GNU_TARGET which corresponds to a target used by C world utilities whereas existing TARGET now describes rust target.
This commit is contained in:
parent
b1821fd8ea
commit
03633046cc
1 changed files with 139 additions and 49 deletions
34
mk/config.mk
34
mk/config.mk
|
|
@ -78,6 +78,11 @@ export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
|
|||
|
||||
## Userspace variables
|
||||
export TARGET=$(ARCH)-unknown-redox
|
||||
ifeq ($(ARCH),riscv64gc)
|
||||
export GNU_TARGET=riscv64-unknown-redox
|
||||
else
|
||||
export GNU_TARGET=$(TARGET)
|
||||
endif
|
||||
BUILD=build/$(ARCH)/$(CONFIG_NAME)
|
||||
INSTALLER=installer/target/release/redox_installer
|
||||
INSTALLER_OPTS=
|
||||
|
|
@ -95,23 +100,22 @@ FSTOOLS_TAG=build/fstools.tag
|
|||
export BOARD
|
||||
|
||||
## Cross compiler variables
|
||||
AR=$(TARGET)-gcc-ar
|
||||
AS=$(TARGET)-as
|
||||
CC=$(TARGET)-gcc
|
||||
CXX=$(TARGET)-g++
|
||||
LD=$(TARGET)-ld
|
||||
NM=$(TARGET)-gcc-nm
|
||||
OBJCOPY=$(TARGET)-objcopy
|
||||
OBJDUMP=$(TARGET)-objdump
|
||||
RANLIB=$(TARGET)-gcc-ranlib
|
||||
READELF=$(TARGET)-readelf
|
||||
STRIP=$(TARGET)-strip
|
||||
AR=$(GNU_TARGET)-gcc-ar
|
||||
AS=$(GNU_TARGET)-as
|
||||
CC=$(GNU_TARGET)-gcc
|
||||
CXX=$(GNU_TARGET)-g++
|
||||
LD=$(GNU_TARGET)-ld
|
||||
NM=$(GNU_TARGET)-gcc-nm
|
||||
OBJCOPY=$(GNU_TARGET)-objcopy
|
||||
OBJDUMP=$(GNU_TARGET)-objdump
|
||||
RANLIB=$(GNU_TARGET)-gcc-ranlib
|
||||
READELF=$(GNU_TARGET)-readelf
|
||||
STRIP=$(GNU_TARGET)-strip
|
||||
|
||||
## Rust cross compile variables
|
||||
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
|
||||
export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc
|
||||
export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++
|
||||
|
||||
export AR_$(subst -,_,$(TARGET)):=$(AR)
|
||||
export CC_$(subst -,_,$(TARGET)):=$(CC)
|
||||
export CXX_$(subst -,_,$(TARGET)):=$(CXX)
|
||||
|
||||
## If Podman is being used, a container is required
|
||||
ifeq ($(PODMAN_BUILD),1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue