summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2015-08-19 17:36:41 +0200
committerMichal Marek <mmarek@suse.com>2015-09-04 13:14:10 +0200
commit5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 (patch)
treef0424c4fe42eb83bf35a0cda4204aff097a8b192 /arch/powerpc/Makefile
parentd179e22762fd38414c4108acedd5feca4cf7e0d8 (diff)
downloadop-kernel-dev-5631d9c429857194bd55d7bcd8fa5bdd1a9899a3.zip
op-kernel-dev-5631d9c429857194bd55d7bcd8fa5bdd1a9899a3.tar.gz
kbuild: Fix clang detection
We cannot detect clang before including the arch Makefile, because that can set the default cross compiler. We also cannot detect clang after including the arch Makefile, because powerpc wants to know about clang. Solve this by using an deferred variable. This costs us a few shell invocations, but this is only a constant number. Reported-by: Behan Webster <behanw@converseincode.com> Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 05f464e..dfe8889 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -67,7 +67,7 @@ UTS_MACHINE := $(OLDARCH)
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
override CC += -mlittle-endian
-ifneq ($(COMPILER),clang)
+ifneq ($(cc-name),clang)
override CC += -mno-strict-align
endif
override AS += -mlittle-endian
@@ -333,7 +333,7 @@ TOUT := .tmp_gas_check
# - Require gcc 4.0 or above on 64-bit
# - gcc-4.2.0 has issues compiling modules on 64-bit
checkbin:
- @if test "${COMPILER}" != "clang" \
+ @if test "$(cc-name)" != "clang" \
&& test "$(cc-version)" = "0304" ; then \
if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
@@ -342,14 +342,14 @@ checkbin:
false; \
fi ; \
fi
- @if test "${COMPILER}" != "clang" \
+ @if test "$(cc-name)" != "clang" \
&& test "$(cc-version)" -lt "0400" \
&& test "x${CONFIG_PPC64}" = "xy" ; then \
echo -n "Sorry, GCC v4.0 or above is required to build " ; \
echo "the 64-bit powerpc kernel." ; \
false ; \
fi
- @if test "${COMPILER}" != "clang" \
+ @if test "$(cc-name)" != "clang" \
&& test "$(cc-fullversion)" = "040200" \
&& test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
OpenPOWER on IntegriCloud