summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2015-08-19 11:36:41 -0400
committerMichal Marek <mmarek@suse.com>2015-09-04 07:14:10 -0400
commit5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 (patch)
treef0424c4fe42eb83bf35a0cda4204aff097a8b192 /arch/powerpc
parentd179e22762fd38414c4108acedd5feca4cf7e0d8 (diff)
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')
-rw-r--r--arch/powerpc/Makefile8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 05f464eb6952..dfe88896b06c 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -67,7 +67,7 @@ UTS_MACHINE := $(OLDARCH)
67 67
68ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) 68ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
69override CC += -mlittle-endian 69override CC += -mlittle-endian
70ifneq ($(COMPILER),clang) 70ifneq ($(cc-name),clang)
71override CC += -mno-strict-align 71override CC += -mno-strict-align
72endif 72endif
73override AS += -mlittle-endian 73override AS += -mlittle-endian
@@ -333,7 +333,7 @@ TOUT := .tmp_gas_check
333# - Require gcc 4.0 or above on 64-bit 333# - Require gcc 4.0 or above on 64-bit
334# - gcc-4.2.0 has issues compiling modules on 64-bit 334# - gcc-4.2.0 has issues compiling modules on 64-bit
335checkbin: 335checkbin:
336 @if test "${COMPILER}" != "clang" \ 336 @if test "$(cc-name)" != "clang" \
337 && test "$(cc-version)" = "0304" ; then \ 337 && test "$(cc-version)" = "0304" ; then \
338 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 338 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
339 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ 339 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
@@ -342,14 +342,14 @@ checkbin:
342 false; \ 342 false; \
343 fi ; \ 343 fi ; \
344 fi 344 fi
345 @if test "${COMPILER}" != "clang" \ 345 @if test "$(cc-name)" != "clang" \
346 && test "$(cc-version)" -lt "0400" \ 346 && test "$(cc-version)" -lt "0400" \
347 && test "x${CONFIG_PPC64}" = "xy" ; then \ 347 && test "x${CONFIG_PPC64}" = "xy" ; then \
348 echo -n "Sorry, GCC v4.0 or above is required to build " ; \ 348 echo -n "Sorry, GCC v4.0 or above is required to build " ; \
349 echo "the 64-bit powerpc kernel." ; \ 349 echo "the 64-bit powerpc kernel." ; \
350 false ; \ 350 false ; \
351 fi 351 fi
352 @if test "${COMPILER}" != "clang" \ 352 @if test "$(cc-name)" != "clang" \
353 && test "$(cc-fullversion)" = "040200" \ 353 && test "$(cc-fullversion)" = "040200" \
354 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ 354 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
355 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ 355 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \