Skip to content

Commit

Permalink
Makefile: introduce ARCHCFLAGS for arch specific cflags
Browse files Browse the repository at this point in the history
Do not use $(USERCFLAGS) for anything other than what the user provide.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
  • Loading branch information
marcusfolkesson authored and avagin committed Oct 22, 2023
1 parent df24fe8 commit c474816
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ ifeq ($(ARCH),arm)
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')

ifeq ($(ARMV),6)
USERCFLAGS += -march=armv6
ARCHCFLAGS += -march=armv6
endif

ifeq ($(ARMV),7)
USERCFLAGS += -march=armv7-a+fp
ARCHCFLAGS += -march=armv7-a+fp
endif

ifeq ($(ARMV),8)
# Running 'setarch linux32 uname -m' returns armv8l on travis aarch64.
# This tells CRIU to handle armv8l just as armv7hf. Right now this is
# only used for compile testing. No further verification of armv8l exists.
USERCFLAGS += -march=armv7-a
ARCHCFLAGS += -march=armv7-a
ARMV := 7
endif

Expand Down Expand Up @@ -159,7 +159,7 @@ export GMON GMONLDOPT
endif

AFLAGS += -D__ASSEMBLY__
CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
export AFLAGS CFLAGS USERCLFAGS HOSTCFLAGS

Expand Down
8 changes: 4 additions & 4 deletions test/zdtm/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ ifeq ($(ARCH),arm)
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')

ifeq ($(ARMV),6)
USERCFLAGS += -march=armv6
ARCHCFLAGS += -march=armv6
else ifeq ($(ARMV),7)
USERCFLAGS += -march=armv7-a+fp
ARCHCFLAGS += -march=armv7-a+fp
else ifeq ($(ARMV),8)
# To build aarch32 on armv8 Travis-CI (see criu Makefile)
USERCFLAGS += -march=armv7-a
ARCHCFLAGS += -march=armv7-a
ARMV := 7
endif
endif
Expand All @@ -40,7 +40,7 @@ endif
PKG_CONFIG ?= pkg-config
CFLAGS += -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
CFLAGS += -Wdeclaration-after-statement -Wstrict-prototypes
CFLAGS += $(USERCFLAGS)
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS)
CFLAGS += -D_GNU_SOURCE
CPPFLAGS += -iquote $(LIBDIR)/arch/$(ARCH)/include

Expand Down
2 changes: 1 addition & 1 deletion test/zdtm/lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LIBDIR := .

CFLAGS += $(USERCFLAGS)
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS)

LIB := libzdtmtst.a

Expand Down

0 comments on commit c474816

Please sign in to comment.