Skip to content

Commit

Permalink
risc-v:Unify module compilation options
Browse files Browse the repository at this point in the history
Signed-off-by: anjiahao <[email protected]>
  • Loading branch information
anjiahao1 authored and xiaoxiang781216 committed Oct 11, 2024
1 parent 4685175 commit 5076b0c
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 53 deletions.
6 changes: 6 additions & 0 deletions arch/risc-v/src/common/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,12 @@ CELFFLAGS = $(CFLAGS) -fvisibility=hidden
CXXELFFLAGS = $(CXXFLAGS) -fvisibility=hidden

LDELFFLAGS = -r -e main
ifeq ($(CONFIG_ARCH_RV32),y)
LDELFFLAGS += --oformat elf32-littleriscv
else
LDELFFLAGS += --oformat elf64-littleriscv
endif

LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld)

# Zig toolchain
Expand Down
9 changes: 0 additions & 9 deletions boards/risc-v/bl808/ox64/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,3 @@ CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)

LDELFFLAGS = --oformat elf64-littleriscv
LDELFFLAGS += -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
4 changes: 0 additions & 4 deletions boards/risc-v/jh7110/star64/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

LDELFFLAGS += --oformat elf64-littleriscv
10 changes: 0 additions & 10 deletions boards/risc-v/k230/canmv230/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)

LDELFFLAGS = --oformat elf64-littleriscv
ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
LDELFFLAGS += -r
endif

# POSTBUILD management

# KERNEL builds need real ROMFS and even OpenSBI wrapping
Expand Down
6 changes: 0 additions & 6 deletions boards/risc-v/litex/arty_a7/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

LDELFFLAGS += --oformat elf32-littleriscv

ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
LDELFFLAGS += -r
endif
15 changes: 0 additions & 15 deletions boards/risc-v/qemu-rv/rv-virt/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)

ifeq ($(CONFIG_ARCH_RV32),y)
LDELFFLAGS = --oformat elf32-littleriscv
else
LDELFFLAGS = --oformat elf64-littleriscv
endif

ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
LDELFFLAGS += -r
endif

# POSTBUILD management

# KERNEL builds need real ROMFS
Expand Down
9 changes: 0 additions & 9 deletions boards/risc-v/sg2000/milkv_duos/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,3 @@ CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)

LDELFFLAGS = --oformat elf64-littleriscv
LDELFFLAGS += -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)

0 comments on commit 5076b0c

Please sign in to comment.