Skip to content

Commit

Permalink
Add -xregs=no%appl for SunCC on Sparc
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Sep 9, 2018
1 parent 9a8b4a8 commit 03297cd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

###########################################################
##### System Attributes and Programs #####
###########################################################
Expand Down Expand Up @@ -51,8 +52,8 @@ IS_PPC32 := $(shell echo "$(HOSTX)" | $(GREP) -v "64" | $(GREP) -i -c -E 'ppc|po
IS_PPC64 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'ppc64|power64')
IS_ARM32 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'arm|armhf|arm7l|eabihf')
IS_ARMV8 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'aarch32|aarch64')
IS_SPARC32 := $(shell echo "$(HOSTX)" | $(GREP) -v "64" | $(GREP) -i -c 'sparc')
IS_SPARC64 := $(shell echo "$(HOSTX)" | $(GREP) -i -c 'sparc64')
IS_SPARC32 := $(shell echo "$(HOSTX)" | $(GREP) -v "64" | $(GREP) -i -c -E 'sun|sparc')
IS_SPARC64 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'sun|sparc64')

IS_NEON := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | $(GREP) -i -c -E 'armv7|armhf|arm7l|eabihf|armv8|aarch32|aarch64')

Expand Down Expand Up @@ -562,8 +563,19 @@ endif # CXXFLAGS
# Remove -fPIC if present. SunCC use -KPIC
ifeq ($(SUN_COMPILER),1)
CXXFLAGS := $(subst -fPIC,-KPIC,$(CXXFLAGS))
CXXFLAGS := $(subst -fpic,-Kpic,$(CXXFLAGS))
endif

# For SunOS and SunCC Sun wants folks to use -xregs=no%appl
# https://docs.oracle.com/cd/E18659_01/html/821-1383/bkamt.html
ifeq ($(IS_SUN)$(SUN_COMPILER),11)
ifneq ($(IS_SPARC32)$(IS_SPARC64),00)
ifeq ($(findstring -xregs=no%appl,$(CXXFLAGS)),)
CXXFLAGS += -xregs=no%appl
endif # -xregs
endif # Sparc
endif # SunOS

# Remove -fPIC if present. IBM XL C/C++ use -qpic
ifeq ($(XLC_COMPILER),1)
CXXFLAGS := $(subst -fPIC,-qpic,$(CXXFLAGS))
Expand Down

0 comments on commit 03297cd

Please sign in to comment.