software: use a single crt0 (deprecate crt0-ctr/crt0-xip) and avoid unnecessary defines.
Since https://github.com/enjoy-digital/litex/issues/566, crt0-ctr and crt0-xip are now similiar so we can get back to a single crt0 and remove the defines that were generated to distinguish the different cases. Since LiteX/MiSoC have diverged and are no longer compatible, we also no longer need to generate the LiteX flag.
This commit is contained in:
parent
384646c6be
commit
d59cec5acc
|
@ -91,20 +91,6 @@ class Builder:
|
|||
|
||||
for k, v in export.get_cpu_mak(self.soc.cpu, self.compile_software):
|
||||
define(k, v)
|
||||
# Distinguish between LiteX and MiSoC.
|
||||
define("LITEX", "1")
|
||||
# Distinguish between applications running from main RAM and
|
||||
# flash for user-provided software packages.
|
||||
exec_profiles = {
|
||||
"COPY_TO_MAIN_RAM" : "0",
|
||||
"EXECUTE_IN_PLACE" : "0"
|
||||
}
|
||||
if "main_ram" in self.soc.mem_regions.keys():
|
||||
exec_profiles["COPY_TO_MAIN_RAM"] = "1"
|
||||
else:
|
||||
exec_profiles["EXECUTE_IN_PLACE"] = "1"
|
||||
for k, v in exec_profiles.items():
|
||||
define(k, v)
|
||||
define(
|
||||
"COMPILER_RT_DIRECTORY",
|
||||
get_data_mod("software", "compiler_rt").data_location)
|
||||
|
|
|
@ -58,7 +58,7 @@ endif
|
|||
bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)
|
||||
|
||||
|
||||
%.elf: ../libbase/crt0-ctr.o \
|
||||
%.elf: ../libbase/crt0.o \
|
||||
../libcompiler_rt/libcompiler_rt.a \
|
||||
../libbase/libbase-nofloat.a \
|
||||
../liblitedram/liblitedram.a \
|
||||
|
@ -66,7 +66,7 @@ bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)
|
|||
../liblitespi/liblitespi.a \
|
||||
../liblitesdcard/liblitesdcard.a
|
||||
$(LD) $(LDFLAGS) -T $(BIOS_DIRECTORY)/linker.ld -N -o $@ \
|
||||
../libbase/crt0-ctr.o \
|
||||
../libbase/crt0.o \
|
||||
$(OBJECTS) \
|
||||
-L../libcompiler_rt \
|
||||
-L../libbase \
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
include ../include/generated/variables.mak
|
||||
include $(SOC_DIRECTORY)/software/common.mak
|
||||
|
||||
OBJECTS = exception.o libc.o errno.o crc16.o crc32.o console.o \
|
||||
system.o id.o uart.o time.o qsort.o strtod.o spiflash.o strcasecmp.o i2c.o \
|
||||
div64.o progress.o
|
||||
OBJECTS = exception.o \
|
||||
libc.o \
|
||||
errno.o \
|
||||
crc16.o \
|
||||
crc32.o \
|
||||
console.o \
|
||||
system.o \
|
||||
id.o \
|
||||
uart.o \
|
||||
time.o \
|
||||
qsort.o \
|
||||
strtod.o \
|
||||
spiflash.o \
|
||||
strcasecmp.o \
|
||||
i2c.o \
|
||||
div64.o \
|
||||
progress.o
|
||||
|
||||
all: crt0-ctr.o crt0-xip.o libbase.a libbase-nofloat.a
|
||||
all: crt0.o libbase.a libbase-nofloat.a
|
||||
|
||||
libbase.a: $(OBJECTS) vsnprintf.o
|
||||
$(AR) crs libbase.a $(OBJECTS) vsnprintf.o
|
||||
|
@ -25,14 +39,11 @@ vsnprintf-nofloat.o: $(LIBBASE_DIRECTORY)/vsnprintf.c
|
|||
%.o: $(LIBBASE_DIRECTORY)/%.S
|
||||
$(assemble)
|
||||
|
||||
crt0-ctr.o: $(CPU_DIRECTORY)/crt0.S
|
||||
crt0.o: $(CPU_DIRECTORY)/crt0.S
|
||||
$(assemble)
|
||||
|
||||
crt0-xip.o: $(CPU_DIRECTORY)/crt0.S
|
||||
$(CC) -c -DEXECUTE_IN_PLACE $(CFLAGS) -o $@ $<
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJECTS) crt0-$(CPU).o crt0-$(CPU)-flash.o vsnprintf.o vsnprintf-nofloat.o
|
||||
$(RM) $(OBJECTS) crt0.o vsnprintf.o vsnprintf-nofloat.o
|
||||
$(RM) libbase.a libbase-nofloat.a .*~ *~
|
||||
|
|
Loading…
Reference in New Issue