mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
build: Use SUBARCH
Instead of doing additional `uname -m` - use provided $(SUBARCH) to detect what architecture flavour the build should produce the result for. Fixes two things: - zdtm make now correctly supplies $(USERCFLAGS) - subtly fixes cross compilation by providing a way to specify $(SUBARCH) Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
df66aa99b6
commit
1463c41119
6
Makefile
6
Makefile
@ -17,8 +17,6 @@ ifeq ($(origin HOSTCFLAGS), undefined)
|
|||||||
HOSTCFLAGS := $(CFLAGS) $(USERCFLAGS)
|
HOSTCFLAGS := $(CFLAGS) $(USERCFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
UNAME-M := $(shell uname -m)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Supported Architectures
|
# Supported Architectures
|
||||||
ifneq ($(filter-out x86 arm aarch64 ppc64 s390,$(ARCH)),)
|
ifneq ($(filter-out x86 arm aarch64 ppc64 s390,$(ARCH)),)
|
||||||
@ -27,14 +25,14 @@ endif
|
|||||||
|
|
||||||
# The PowerPC 64 bits architecture could be big or little endian.
|
# The PowerPC 64 bits architecture could be big or little endian.
|
||||||
# They are handled in the same way.
|
# They are handled in the same way.
|
||||||
ifeq ($(UNAME-M),ppc64)
|
ifeq ($(SUBARCH),ppc64)
|
||||||
error := $(error ppc64 big endian is not yet supported)
|
error := $(error ppc64 big endian is not yet supported)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Architecture specific options.
|
# Architecture specific options.
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
|
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
|
||||||
|
|
||||||
ifeq ($(ARMV),6)
|
ifeq ($(ARMV),6)
|
||||||
USERCFLAGS += -march=armv6
|
USERCFLAGS += -march=armv6
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
MAKEFLAGS += -r
|
MAKEFLAGS += -r
|
||||||
|
|
||||||
ARCH ?= $(shell uname -m | sed \
|
SUBARCH ?= $(shell uname -m)
|
||||||
|
ARCH ?= $(shell echo $(SUBARCH) | sed \
|
||||||
-e s/i.86/x86/ \
|
-e s/i.86/x86/ \
|
||||||
-e s/x86_64/x86/ \
|
-e s/x86_64/x86/ \
|
||||||
-e s/sun4u/sparc64/ \
|
-e s/sun4u/sparc64/ \
|
||||||
@ -19,7 +20,7 @@ ifeq ($(ARCH),arm64)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
|
ARMV := $(shell echo $(SUBARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
|
||||||
|
|
||||||
ifeq ($(ARMV),6)
|
ifeq ($(ARMV),6)
|
||||||
USERCFLAGS += -march=armv6
|
USERCFLAGS += -march=armv6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user