Verified Commit bb9d2a52 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 32aacdd1
Pipeline #4561 failed with stage
in 20 minutes and 27 seconds
......@@ -44,17 +44,17 @@ BUILD=build/userspace
EFI_TARGET=$(ARCH)-efi-pe
## 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
......
......@@ -18,9 +18,9 @@ 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_coreboot: kernel/linkers/$(ARCH).ld build/libkernel_coreboot.a build/live.o
export PATH="$(PREFIX_PATH):$$PATH" && \
......@@ -30,14 +30,14 @@ build/kernel_coreboot: kernel/linkers/$(ARCH).ld build/libkernel_coreboot.a buil
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