Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: introduce ARCHCFLAGS for arch specific cflags #2288

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading