Skip to content

Commit

Permalink
Makefile: be precise about clang target
Browse files Browse the repository at this point in the history
While CROSS can be set to a ppc64le toolchian, we don't want to build
for that target. Hardcode the target to powerpc64-linux-gnu.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
shenki authored and stewartsmith committed May 9, 2018
1 parent a565a28 commit 09c19b9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Makefile.main
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,15 @@ AFLAGS += $(call try-cflag,$(CC),-mabi=elfv1)
endif

ifeq ($(cc-name),clang)
ifneq ($(CROSS),)
CLANG_TARGET := --target=$(notdir $(CROSS:%-=%))
CLANG_TARGET := --target=powerpc64-linux-gnu -mcpu=pwr8
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
CFLAGS += $(call cc-option, -no-integrated-as)
AFLAGS += $(call cc-option, -no-integrated-as)

LDFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)

CFLAGS += -mcpu=pwr8
LDFLAGS += -mcpu=pwr8
ASFLAGS += -mcpu=pwr8

# Workarounds
# TODO: Fix the issues these hide, and remove them
CFLAGS += -Wno-cast-align \
Expand Down

0 comments on commit 09c19b9

Please sign in to comment.