Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dab3c3cc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull core kbuild updates from Michal Marek:
 - modpost portability fix
 - linker script fix
 - genksyms segfault fix
 - fixdep cleanup
 - fix for clang detection

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Fix clang detection
  kbuild: fixdep: drop meaningless hash table initialization
  kbuild: fixdep: optimize code slightly
  genksyms: Regenerate parser
  genksyms: Duplicate function pointer type definitions segfault
  kbuild: Fix .text.unlikely placement
  Avoid conflict with host definitions when cross-compiling
parents 59a47fff 5631d9c4
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -666,14 +666,7 @@ endif
endif
KBUILD_CFLAGS += $(stackp-flag)

ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
COMPILER := clang
else
COMPILER := gcc
endif
export COMPILER

ifeq ($(COMPILER),clang)
ifeq ($(cc-name),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
+4 −4
Original line number Diff line number Diff line
@@ -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
@@ -353,7 +353,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 '; \
@@ -362,14 +362,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 ' ; \
+1 −3
Original line number Diff line number Diff line
@@ -412,12 +412,10 @@
 * during second ld run in second ld pass when generating System.map */
#define TEXT_TEXT							\
		ALIGN_FUNCTION();					\
		*(.text.hot)						\
		*(.text .text.fixup)					\
		*(.text.hot .text .text.fixup .text.unlikely)		\
		*(.ref.text)						\
	MEM_KEEP(init.text)						\
	MEM_KEEP(exit.text)						\
		*(.text.unlikely)


/* sched.text is aling to function alignment to secure we have same
+4 −0
Original line number Diff line number Diff line
@@ -128,6 +128,10 @@ cc-option-align = $(subst -functions=0,,\
cc-disable-warning = $(call try-run,\
	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))

# cc-name
# Expands to either gcc or clang
cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)

# cc-version
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))

+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ endif
KBUILD_CFLAGS += $(warning)
else

ifeq ($(COMPILER),clang)
ifeq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
KBUILD_CFLAGS += $(call cc-disable-warning, format)
Loading