Commit d824ee00 authored by jD91mZM2's avatar jD91mZM2

Don't overwrite CC and friends

The environment variables with the same name are being overwritten when
non-empty. This works around that.
parent af8ca4eb
Pipeline #2309 passed with stage
in 56 minutes and 13 seconds
......@@ -26,17 +26,17 @@ export XARGO_HOME=$(ROOT)/build/xargo
export XARGO_RUST_SRC=$(ROOT)/rust/src
# 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=$(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
# Rust cross compile variables
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
......
......@@ -12,20 +12,20 @@ build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src
build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
export PATH="$(PREFIX_PATH):$$PATH" && \
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel.a && \
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
$(_LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel.a && \
$(_OBJCOPY) --only-keep-debug $@ $@.sym && \
$(_OBJCOPY) --strip-debug $@
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
export PATH="$(PREFIX_PATH):$$PATH" && \
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
$(_LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
$(_OBJCOPY) --only-keep-debug $@ $@.sym && \
$(_OBJCOPY) --strip-debug $@
build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH)
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
$(_OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment