ARM: tidy compilation flags

This commit is contained in:
Philippe Teuwen
2026-04-28 13:00:42 +02:00
parent 294b656af1
commit 6efff9a6ae
3 changed files with 12 additions and 10 deletions
+2 -4
View File
@@ -31,8 +31,7 @@ endif
#remove one of the following defines and comment out the relevant line
#in the next section to remove that particular feature from compilation.
# NO space,TABs after the "\" sign.
APP_CFLAGS = $(PLATFORM_DEFS) \
-ffunction-sections -fdata-sections
APP_CFLAGS = $(PLATFORM_DEFS)
SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c lfadc.c
SRC_HF = hfops.c
@@ -115,8 +114,7 @@ APP_CFLAGS += $(LZ4_CFLAGS)
APP_CFLAGS += -I../common/lz4
# stdint.h provided locally until GCC 4.5 becomes C99 compliant,
# stack-protect , no-pie reduces size on Gentoo Hardened 8.2 gcc
APP_CFLAGS += -I. -fno-stack-protector -fno-pie
APP_CFLAGS += -I.
# Compile these in thumb mode (small size)
THUMBSRC = start.c \
+3 -3
View File
@@ -34,10 +34,10 @@ VERSIONSRC = version_pm3.c
# THUMBSRC :=
# stdint.h provided locally until GCC 4.5 becomes C99 compliant
APP_CFLAGS = -I. -ffunction-sections -fdata-sections -DAS_BOOTROM
APP_CFLAGS = -I. -DAS_BOOTROM
# stack-protect , no-pie reduces size on Gentoo Hardened 8.2 gcc, no-common makes sure uninitialized vars don't end up in COMMON area
APP_CFLAGS += -fno-stack-protector -fno-pie -fno-common
# no-common makes sure uninitialized vars don't end up in COMMON area
APP_CFLAGS += -fno-common
ifneq (,$(findstring WITH_FLASH,$(PLATFORM_DEFS)))
APP_CFLAGS += -DWITH_FLASH
+7 -3
View File
@@ -48,7 +48,6 @@ VPATH = . ../common_arm ../common ../common/crapto1 ../common/mbedtls ../common/
INCLUDES = ../include/proxmark3_arm.h ../include/at91sam7s512.h ../include/config_gpio.h ../include/pm3_cmd.h
ARMCFLAGS = -mthumb-interwork -fno-builtin
DEFCFLAGS = -Wall -Werror -Os -pedantic -fstrict-aliasing -pipe
# Some more warnings we want as errors:
@@ -99,9 +98,14 @@ ifeq ($(NOERROR),1)
endif
CROSS_CFLAGS ?= $(DEFCFLAGS)
CROSS_CFLAGS += $(ARMCFLAGS) -c $(INCLUDE) -std=c99 -DON_DEVICE $(APP_CFLAGS)
CROSS_CFLAGS += -c -std=c99 -mthumb-interwork -fno-builtin -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)
CROSS_LDFLAGS += -nostartfiles -nodefaultlibs -Wl,--gc-sections -Wl,--build-id=none -Wl,--nmagic
#CROSS_LDFLAGS += -Wl,--print-gc-sections
CROSS_LDFLAGS += -nostartfiles -nodefaultlibs -Wl,-gc-sections -Wl,--build-id=none -n
LIBS = -lgcc
# Flags to generate temporary dependency files