Skip to content

Commit c474816

Browse files
marcusfolkessonavagin
authored andcommitted
Makefile: introduce ARCHCFLAGS for arch specific cflags
Do not use $(USERCFLAGS) for anything other than what the user provide. Signed-off-by: Marcus Folkesson <[email protected]>
1 parent df24fe8 commit c474816

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ ifeq ($(ARCH),arm)
3535
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
3636

3737
ifeq ($(ARMV),6)
38-
USERCFLAGS += -march=armv6
38+
ARCHCFLAGS += -march=armv6
3939
endif
4040

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

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

@@ -159,7 +159,7 @@ export GMON GMONLDOPT
159159
endif
160160

161161
AFLAGS += -D__ASSEMBLY__
162-
CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
162+
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
163163
HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
164164
export AFLAGS CFLAGS USERCLFAGS HOSTCFLAGS
165165

test/zdtm/Makefile.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ ifeq ($(ARCH),arm)
2323
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
2424

2525
ifeq ($(ARMV),6)
26-
USERCFLAGS += -march=armv6
26+
ARCHCFLAGS += -march=armv6
2727
else ifeq ($(ARMV),7)
28-
USERCFLAGS += -march=armv7-a+fp
28+
ARCHCFLAGS += -march=armv7-a+fp
2929
else ifeq ($(ARMV),8)
3030
# To build aarch32 on armv8 Travis-CI (see criu Makefile)
31-
USERCFLAGS += -march=armv7-a
31+
ARCHCFLAGS += -march=armv7-a
3232
ARMV := 7
3333
endif
3434
endif
@@ -40,7 +40,7 @@ endif
4040
PKG_CONFIG ?= pkg-config
4141
CFLAGS += -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
4242
CFLAGS += -Wdeclaration-after-statement -Wstrict-prototypes
43-
CFLAGS += $(USERCFLAGS)
43+
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS)
4444
CFLAGS += -D_GNU_SOURCE
4545
CPPFLAGS += -iquote $(LIBDIR)/arch/$(ARCH)/include
4646

test/zdtm/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LIBDIR := .
22

3-
CFLAGS += $(USERCFLAGS)
3+
CFLAGS += $(USERCFLAGS) $(ARCHCFLAGS)
44

55
LIB := libzdtmtst.a
66

0 commit comments

Comments
 (0)