Use -fno-common consistently in ARM builds
GCC 8.5 emits COMMON globals by default. Apply -fno-common in the shared Make and CMake flags so it covers the OS, bootrom and PM5 armlib. Also remove bootrom archives on clean to avoid reusing old library objects. Built OS and bootrom for PM5/RDV4 with GCC 8.5/13.3 using Make and CMake. No COMMON object symbols remain; PM5 CDC state is inside BSS. Existing build warnings remain. No hardware was flashed.
This commit is contained in:
1 parent
d596fe6b04
commit
121b14ddd8
3 files changed
+3
-1
No files matched your search
@@ -137,6 +137,7 @@ $(OBJDIR)/bootrom.elf: $(VERSIONOBJ) $(ASMOBJ) $(ARMOBJ) $(THUMBOBJ) $(ARMLIB_OB
|
||||
|
||||
clean:
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.o
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.a
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.elf
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.s19
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.map
|
||||
|
||||
@@ -106,6 +106,7 @@ set(CROSS_CFLAGS ${CROSS_CFLAGS}
|
||||
${INCLUDE}
|
||||
# -std=c99 TODO 暂时切换为c11标准,因为新的平台需要c11标准,AT32的官方库一堆c11写法,不这么做的话改起来很麻烦
|
||||
-std=c11
|
||||
-fno-common
|
||||
-DON_DEVICE
|
||||
${APP_CFLAGS})
|
||||
set(CROSS_LDFLAGS ${CROSS_LDFLAGS}
|
||||
|
||||
@@ -97,7 +97,7 @@ ifeq ($(NOERROR),1)
|
||||
endif
|
||||
|
||||
CROSS_CFLAGS ?= $(DEFCFLAGS)
|
||||
CROSS_CFLAGS += -c -std=c99 -mthumb-interwork -fno-builtin -ffunction-sections -fdata-sections
|
||||
CROSS_CFLAGS += -c -std=c99 -mthumb-interwork -fno-builtin -fno-common -ffunction-sections -fdata-sections
|
||||
# stack-protect, no-pie reduces size on Gentoo Hardened 8.2 gcc
|
||||
CROSS_CFLAGS += -fno-stack-protector -fno-pie
|
||||
CROSS_CFLAGS += -DON_DEVICE $(INCLUDE) $(APP_CFLAGS)
|
||||
|
||||
Reference in new issue
Block a user