Skip to content

Commit

Permalink
software: revert LTO changes (Disable it).
Browse files Browse the repository at this point in the history
It seems LTO is not yet fully working with all configurations, so it's better
reverting the changes for now.
- cause issues with LM32 available compilers.
- seems to cause issues with min/lite variant of VexRiscv.
- seems to cause issues with some litex-buildenv configurations. (see #417).
  • Loading branch information
enjoy-digital committed Mar 11, 2020
1 parent bb8905f commit 979f98e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion litex/soc/software/bios/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)


%.elf: ../libbase/crt0-$(CPU)-ctr.o ../libnet/libnet.a ../libbase/libbase-nofloat.a ../libcompiler_rt/libcompiler_rt.a
$(CC) $(LDFLAGS) -T $(BIOS_DIRECTORY)/linker.ld -N -o $@ \
$(LD) $(LDFLAGS) -T $(BIOS_DIRECTORY)/linker.ld -N -o $@ \
../libbase/crt0-$(CPU)-ctr.o \
$(OBJECTS) \
-L../libnet \
Expand Down
24 changes: 5 additions & 19 deletions litex/soc/software/common.mak
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@ endif
RM ?= rm -f
PYTHON ?= python3

ifeq ($(CPU), lm32)
LTO = 0
else
LTO = 1
endif

ifeq ($(CLANG), 1)
ifeq ($(CLANG),1)
CC_normal := clang -target $(TRIPLE) -integrated-as
CX_normal := clang++ -target $(TRIPLE) -integrated-as
else
CC_normal := $(TARGET_PREFIX)gcc -std=gnu99
CX_normal := $(TARGET_PREFIX)g++
endif
ifeq ($(LTO), 1)
AR_normal := $(TARGET_PREFIX)gcc-ar
else
AR_normal := $(TARGET_PREFIX)ar
endif
LD_normal := $(TARGET_PREFIX)ld
OBJCOPY_normal := $(TARGET_PREFIX)objcopy

Expand All @@ -34,7 +24,7 @@ AR_quiet = @echo " AR " $@ && $(AR_normal)
LD_quiet = @echo " LD " $@ && $(LD_normal)
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(OBJCOPY_normal)

ifeq ($(V), 1)
ifeq ($(V),1)
CC = $(CC_normal)
CX = $(CX_normal)
AR = $(AR_normal)
Expand All @@ -55,15 +45,11 @@ DEPFLAGS += -MD -MP

# Toolchain options
#
INCLUDES = -I$(SOC_DIRECTORY)/software/include/base -I$(SOC_DIRECTORY)/software/include -I$(SOC_DIRECTORY)/common -I$(BUILDINC_DIRECTORY)
INCLUDES = -I$(SOC_DIRECTORY)/software/include/base -I$(SOC_DIRECTORY)/software/include -I$(SOC_DIRECTORY)/common -I$(BUILDINC_DIRECTORY)
COMMONFLAGS = $(DEPFLAGS) -Os $(CPUFLAGS) -g3 -fomit-frame-pointer -Wall -fno-builtin -nostdinc $(INCLUDES)
COMMONFLAGS += -ffunction-sections -fdata-sections -nostartfiles -nostdlib -nodefaultlibs
ifeq ($(LTO), 1)
COMMONFLAGS += -flto -fuse-linker-plugin
endif
CFLAGS = $(COMMONFLAGS) -fexceptions -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
CFLAGS = $(COMMONFLAGS) -fexceptions -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
CXXFLAGS = $(COMMONFLAGS) -std=c++11 -I$(SOC_DIRECTORY)/software/include/basec++ -fexceptions -fno-rtti -ffreestanding
LDFLAGS = -nostdlib -nodefaultlibs -Os $(CPUFLAGS) -L$(BUILDINC_DIRECTORY)
LDFLAGS = -nostdlib -nodefaultlibs -L$(BUILDINC_DIRECTORY)

define compilexx
$(CX) -c $(CXXFLAGS) $(1) $< -o $@
Expand Down

0 comments on commit 979f98e

Please sign in to comment.