From cf85d768b49a38f89b85404ae9ef4db6183e9adc Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 21 May 2019 18:48:13 -0400 Subject: [PATCH] Fix armv8l-unknown-linux-gnueabihf yet again --- GNUmakefile | 27 ++++++++++++++------------- GNUmakefile-cross | 16 +++++++++++++--- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 73bcefba..02d6f87d 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -23,6 +23,7 @@ CP ?= cp MV ?= mv RM ?= rm -f GREP ?= grep +SED ?= sed CHMOD ?= chmod MKDIR ?= mkdir -p @@ -33,17 +34,17 @@ LDCONF ?= /sbin/ldconfig -n ifneq ($(wildcard /usr/xpg4/bin/grep),) GREP := /usr/xpg4/bin/grep endif +ifneq ($(wildcard /usr/xpg4/bin/sed),) + SED := /usr/xpg4/bin/sed +endif -# Attempt to determine target machine, fallback to "this" machine. -# The target machine is the one the package runs on. Most people -# call this the "target", but not Autotools. -HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-') # Yet another Clang hack. I think the LLVM devs are making the shit up # as they go. Also see https://github.com/weidai11/cryptopp/issues/831. -ifeq ($(HOSTX),armv8l-unknown-linux-gnueabihf) - HOSTX := armv7l-unknown-linux-gnueabihf +MACHINEX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null) +ifeq ($(MACHINEX),armv8l-unknown-linux-gnueabihf) + MACHINEX := armv7l-unknown-linux-gnueabihf endif -# Fallback +HOSTX := $(shell echo $(MACHINEX) | cut -f 1 -d '-') ifeq ($(HOSTX),) HOSTX := $(shell uname -m 2>/dev/null) endif @@ -1364,14 +1365,14 @@ endif .PHONY: trim trim: ifneq ($(IS_DARWIN),0) - sed -i '' -e's/[[:space:]]*$$//' *.supp *.txt *.sh .*.yml *.h *.cpp *.asm *.s *.S - sed -i '' -e's/[[:space:]]*$$//' *.sln *.vcxproj *.filters GNUmakefile GNUmakefile-cross - sed -i '' -e's/[[:space:]]*$$//' TestData/*.dat TestVectors/*.txt TestPrograms/*.cxx TestScripts/*.* + $(SED) -i '' -e's/[[:space:]]*$$//' *.supp *.txt *.sh .*.yml *.h *.cpp *.asm *.s *.S + $(SED) -i '' -e's/[[:space:]]*$$//' *.sln *.vcxproj *.filters GNUmakefile GNUmakefile-cross + $(SED) -i '' -e's/[[:space:]]*$$//' TestData/*.dat TestVectors/*.txt TestPrograms/*.cxx TestScripts/*.* make convert else - sed -i -e's/[[:space:]]*$$//' *.supp *.txt *.sh .*.yml *.h *.cpp *.asm *.s *.S - sed -i -e's/[[:space:]]*$$//' *.sln *.vcxproj *.filters GNUmakefile GNUmakefile-cross - sed -i -e's/[[:space:]]*$$//' TestData/*.dat TestVectors/*.txt TestPrograms/*.cxx TestScripts/*.* + $(SED) -i -e's/[[:space:]]*$$//' *.supp *.txt *.sh .*.yml *.h *.cpp *.asm *.s *.S + $(SED) -i -e's/[[:space:]]*$$//' *.sln *.vcxproj *.filters GNUmakefile GNUmakefile-cross + $(SED) -i -e's/[[:space:]]*$$//' TestData/*.dat TestVectors/*.txt TestPrograms/*.cxx TestScripts/*.* make convert endif diff --git a/GNUmakefile-cross b/GNUmakefile-cross index 95c1affa..42c944e2 100755 --- a/GNUmakefile-cross +++ b/GNUmakefile-cross @@ -22,6 +22,7 @@ MV ?= mv CHMOD ?= chmod MKDIR ?= mkdir -p GREP ?= grep +SED ?= sed LN ?= ln -sf LDCONF ?= /sbin/ldconfig -n @@ -31,9 +32,18 @@ IS_ANDROID ?= 0 IS_ARM_EMBEDDED ?= 0 IS_NEON ?= 0 -# Include Cryptogams AES and SHA on Linux, but not iOS. TODO: check Android. -HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-') -IS_LINUX := $(shell echo "$(HOSTX)" | $(GREP) -i -c "Linux") +# Yet another Clang hack. I think the LLVM devs are making the shit up +# as they go. Also see https://github.com/weidai11/cryptopp/issues/831. +MACHINEX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null) +ifeq ($(MACHINEX),armv8l-unknown-linux-gnueabihf) + MACHINEX := armv7l-unknown-linux-gnueabihf +endif +HOSTX := $(shell echo $(MACHINEX) | cut -f 1 -d '-') +ifeq ($(HOSTX),) + HOSTX := $(shell uname -m 2>/dev/null) +endif + +IS_LINUX := $(shell echo $(MACHINEX) | $(GREP) -i -c "Linux") # Can be used by Android and Embeeded cross-compiles. Disable by default because # Android and embedded users typically don't run this configuration.