Skip to contentSkip to conversation

powerpc patches for new Kconfig language

PATCH Applied Nicholas Piggin 4 participants 21 messages May 30, 2018 – Jun 4, 2018

Subsystems (3)
lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

v5 cover powerpc patches for new Kconfig language

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Thanks,
Nick

Nicholas Piggin (4):
powerpc/kbuild: set default generic machine type for 32-bit compile powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS powerpc/kbuild: move -mprofile-kernel check to Kconfig

 arch/powerpc/Kconfig                          | 16 +------
 arch/powerpc/Makefile                         | 44 ++++++++-----------
 arch/powerpc/boot/Makefile                    | 16 ++++---
 arch/powerpc/include/asm/module.h             |  2 +-
 arch/powerpc/kernel/module_64.c               |  4 +-
 arch/powerpc/kernel/trace/ftrace.c            |  6 +--
 arch/powerpc/kernel/vdso32/Makefile           | 15 +++++--
 .../tools/gcc-check-mprofile-kernel.sh        | 13 +++---
 scripts/recordmcount.pl                       | 18 +++++++-
 9 files changed, 72 insertions(+), 62 deletions(-)
Signature · 1 line
2.17.0
author reviewer
#1 lore raw

PATCH v5 1/4 powerpc/kbuild: set default generic machine type for 32-bit compile

Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit kernels, even with -m32. Debian's powerpc64le is one such case, and that is because it is built with --with-cpu=power8.

So when cross compiling a 32-bit kernel with a 64-bit toolchain, set -mcpu=powerpc initially, which is the generic 32-bit powerpc machine type and scheduling model. CPU and platform code can override this with subsequent -mcpu flags if necessary.

This is not done for 32-bit toolchains otherwise it would override their defaults, which are presumably set appropriately for the environment (moreso than a 64-bit cross compiler).

This fixes a lot of build failures due to incompatible assembly when compiling 32-bit kernel with th Debian powerpc64le 64-bit toolchain.

Cc Segher Boessenkool <[email protected]>

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

---
 arch/powerpc/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/powerpc/Makefile +8 -0
index 95813df90801..d628724087c6 100644
@@ -24,6 +24,14 @@ ifeq ($(HAS_BIARCH),y)
 ifeq ($(CROSS32_COMPILE),)
 CROSS32CC	:= $(CC) -m32
 KBUILD_ARFLAGS	+= --target=elf32-powerpc
+ifdef CONFIG_PPC32
+# These options will be overridden by any -mcpu option that the CPU
+# or platform code sets later on the command line, but they are needed
+# to set a sane 32-bit cpu target for the 64-bit cross compiler which
+# may default to the wrong ISA.
+KBUILD_CFLAGS		+= -mcpu=powerpc
+KBUILD_AFLAGS		+= -mcpu=powerpc
+endif
 endif
 endif
 
Signature · 1 line
2.17.0
#2 lore raw

Re: [PATCH v5 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-05-30 21:19 GMT+09:00 Nicholas Piggin <[email protected]>:

Quoted 47 lines

Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit kernels, even with -m32. Debian's powerpc64le is one such case, and that is because it is built with --with-cpu=power8.

So when cross compiling a 32-bit kernel with a 64-bit toolchain, set -mcpu=powerpc initially, which is the generic 32-bit powerpc machine type and scheduling model. CPU and platform code can override this with subsequent -mcpu flags if necessary.

This is not done for 32-bit toolchains otherwise it would override their defaults, which are presumably set appropriately for the environment (moreso than a 64-bit cross compiler).

This fixes a lot of build failures due to incompatible assembly when compiling 32-bit kernel with th Debian powerpc64le 64-bit toolchain.

Cc Segher Boessenkool <[email protected]>

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

---
 arch/powerpc/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/powerpc/Makefile +8 -1
index 95813df90801..d628724087c6 100644
@@ -24,6 +24,14 @@ ifeq ($(HAS_BIARCH),y)
 ifeq ($(CROSS32_COMPILE),)
 CROSS32CC      := $(CC) -m32
 KBUILD_ARFLAGS += --target=elf32-powerpc
+ifdef CONFIG_PPC32
+# These options will be overridden by any -mcpu option that the CPU
+# or platform code sets later on the command line, but they are needed
+# to set a sane 32-bit cpu target for the 64-bit cross compiler which
+# may default to the wrong ISA.
+KBUILD_CFLAGS          += -mcpu=powerpc
+KBUILD_AFLAGS          += -mcpu=powerpc
+endif
 endif
 endif
 
--

2.17.0

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

All applied to linux-kbuild/kconfig.
Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw

Re: [PATCH v5 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

In reply to Nicholas Piggin

2018-05-30 21:19 GMT+09:00 Nicholas Piggin <[email protected]>:

Quoted 9 lines

Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit kernels, even with -m32. Debian's powerpc64le is one such case, and that is because it is built with --with-cpu=power8.

So when cross compiling a 32-bit kernel with a 64-bit toolchain, set -mcpu=powerpc initially, which is the generic 32-bit powerpc machine type and scheduling model. CPU and platform code can override this with subsequent -mcpu flags if necessary.

Quoted 6 lines

This is not done for 32-bit toolchains otherwise it would override their defaults, which are presumably set appropriately for the environment (moreso than a 64-bit cross compiler).

This fixes a lot of build failures due to incompatible assembly when compiling 32-bit kernel with th Debian powerpc64le 64-bit toolchain.

When I applied this patch, I changed the following.

"th" -> "the"

Please let me know if my fix-up is bad.

Quoted 35 lines
Cc Segher Boessenkool <[email protected]>

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

---
 arch/powerpc/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/powerpc/Makefile +8 -1
index 95813df90801..d628724087c6 100644
@@ -24,6 +24,14 @@ ifeq ($(HAS_BIARCH),y)
 ifeq ($(CROSS32_COMPILE),)
 CROSS32CC      := $(CC) -m32
 KBUILD_ARFLAGS += --target=elf32-powerpc
+ifdef CONFIG_PPC32
+# These options will be overridden by any -mcpu option that the CPU
+# or platform code sets later on the command line, but they are needed
+# to set a sane 32-bit cpu target for the 64-bit cross compiler which
+# may default to the wrong ISA.
+KBUILD_CFLAGS          += -mcpu=powerpc
+KBUILD_AFLAGS          += -mcpu=powerpc
+endif
 endif
 endif
 
--

2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

Re: [v5, 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

In reply to Nicholas Piggin
Quoted 13 lines · Nicholas Piggin

Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit kernels, even with -m32. Debian's powerpc64le is one such case, and that is because it is built with --with-cpu=power8.

So when cross compiling a 32-bit kernel with a 64-bit toolchain, set -mcpu=powerpc initially, which is the generic 32-bit powerpc machine type and scheduling model. CPU and platform code can override this with subsequent -mcpu flags if necessary.

This is not done for 32-bit toolchains otherwise it would override their defaults, which are presumably set appropriately for the environment (moreso than a 64-bit cross compiler).

Quoted 5 lines

This fixes a lot of build failures due to incompatible assembly when compiling 32-bit kernel with th Debian powerpc64le 64-bit toolchain.

Cc Segher Boessenkool <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/4bf4f42a2febb449a5cc5d79e7c58e

cheers

author reviewer
#5 lore raw

PATCH v5 2/4 powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile

In reply to Nicholas Piggin

Switch VDSO32 build over to use CROSS32_COMPILE directly, and have it pass in -m32 after the standard c_flags. This allows endianness overrides to be removed and the endian and bitness flags moved into standard flags variables.

---
 arch/powerpc/Makefile               |  7 -------
 arch/powerpc/boot/Makefile          | 16 +++++++++++-----
 arch/powerpc/kernel/vdso32/Makefile | 15 +++++++++++----
 3 files changed, 22 insertions(+), 16 deletions(-)
arch/powerpc/Makefile +0 -7
index d628724087c6..167b26a0780c 100644
@@ -17,13 +17,8 @@ HAS_BIARCH	:= $(call cc-option-yn, -m32)
 # Set default 32 bits cross compilers for vdso and boot wrapper
 CROSS32_COMPILE ?=
 
-CROSS32CC		:= $(CROSS32_COMPILE)gcc
-CROSS32AR		:= $(CROSS32_COMPILE)ar
-
 ifeq ($(HAS_BIARCH),y)
 ifeq ($(CROSS32_COMPILE),)
-CROSS32CC	:= $(CC) -m32
-KBUILD_ARFLAGS	+= --target=elf32-powerpc
 ifdef CONFIG_PPC32
 # These options will be overridden by any -mcpu option that the CPU
 # or platform code sets later on the command line, but they are needed
@@ -35,8 +30,6 @@ endif
 endif
 endif
 
-export CROSS32CC CROSS32AR
-
 ifeq ($(CROSS_COMPILE),)
 KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
 else
arch/powerpc/boot/Makefile +11 -5
index 26d5d2a5b8e9..49767e06202c 100644
@@ -23,19 +23,23 @@ all: $(obj)/zImage
 compress-$(CONFIG_KERNEL_GZIP) := CONFIG_KERNEL_GZIP
 compress-$(CONFIG_KERNEL_XZ)   := CONFIG_KERNEL_XZ
 
+ifdef CROSS32_COMPILE
+    BOOTCC := $(CROSS32_COMPILE)gcc
+    BOOTAR := $(CROSS32_COMPILE)ar
+else
+    BOOTCC := $(CC)
+    BOOTAR := $(AR)
+endif
+
 BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		 -fno-strict-aliasing -Os -msoft-float -pipe \
 		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
 		 -D$(compress-y)
 
-BOOTCC := $(CC)
 ifdef CONFIG_PPC64_BOOT_WRAPPER
 BOOTCFLAGS	+= -m64
 else
 BOOTCFLAGS	+= -m32
-ifdef CROSS32_COMPILE
-    BOOTCC := $(CROSS32_COMPILE)gcc
-endif
 endif
 
 BOOTCFLAGS	+= -isystem $(shell $(BOOTCC) -print-file-name=include)
@@ -49,6 +53,8 @@ endif
 
 BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
 
+BOOTARFLAGS	:= -cr$(KBUILD_ARFLAGS)
+
 ifdef CONFIG_DEBUG_INFO
 BOOTCFLAGS	+= -g
 endif
@@ -202,7 +208,7 @@ quiet_cmd_bootas = BOOTAS  $@
       cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
 
 quiet_cmd_bootar = BOOTAR  $@
-      cmd_bootar = $(CROSS32AR) -cr$(KBUILD_ARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
+      cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
 
 $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
 	$(call if_changed_dep,bootcc)
arch/powerpc/kernel/vdso32/Makefile +11 -4
index b8c434d1d459..50112d4473bb 100644
@@ -8,8 +8,15 @@ obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \
 
 # Build rules
 
-ifeq ($(CONFIG_PPC32),y)
-CROSS32CC := $(CC)
+ifdef CROSS32_COMPILE
+    VDSOCC := $(CROSS32_COMPILE)gcc
+else
+    VDSOCC := $(CC)
+endif
+
+CC32FLAGS :=
+ifdef CONFIG_PPC64
+CC32FLAGS += -m32
 endif
 
 targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
@@ -45,9 +52,9 @@ $(obj-vdso32): %.o: %.S FORCE
 
 # actual build commands
 quiet_cmd_vdso32ld = VDSO32L $@
-      cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
+      cmd_vdso32ld = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
 quiet_cmd_vdso32as = VDSO32A $@
-      cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
+      cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $<
 
 # install commands for the unstripped file
 quiet_cmd_vdso_install = INSTALL $@
Signature · 1 line
2.17.0
#6 lore raw

Re: [v5, 2/4] powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile

Quoted 6 lines · Nicholas Piggin

Switch VDSO32 build over to use CROSS32_COMPILE directly, and have it pass in -m32 after the standard c_flags. This allows endianness overrides to be removed and the endian and bitness flags moved into standard flags variables.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/af3901cbbd3de182aafb8ee553c825

cheers

author reviewer
#7 lore raw

PATCH v5 3/4 powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

In reply to Nicholas Piggin

The powerpc toolchain can compile combinations of 32/64 bit and big/little endian, so it's convenient to consider, e.g.,

CC -m64 -mbig-endian

To be the C compiler for the purpose of invoking it to build target artifacts. So overriding the the CC variable to include thse flags works for this purpose.

Unfortunately that is not compatible with the way the proposed new Kconfig macro language will work.

After previous patches in this series, these flags can be carefully passed in using flags instead.

Since v1: removed extra -EB in the recordmcount script (thanks mpe)

---
 arch/powerpc/Makefile                          | 16 +++++++++-------
 .../powerpc/tools/gcc-check-mprofile-kernel.sh | 12 ++++++++----
 scripts/recordmcount.pl                        | 18 +++++++++++++++++-
 3 files changed, 34 insertions(+), 12 deletions(-)
arch/powerpc/Makefile +9 -7
index 167b26a0780c..6faf1d6ad9dd 100644
@@ -75,13 +75,15 @@ endif
 endif
 
 ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
-override LD	+= -EL
+KBUILD_CFLAGS	+= -mlittle-endian
+LDFLAGS		+= -EL
 LDEMULATION	:= lppc
 GNUTARGET	:= powerpcle
 MULTIPLEWORD	:= -mno-multiple
 KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
 else
-override LD	+= -EB
+KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
+LDFLAGS		+= -EB
 LDEMULATION	:= ppc
 GNUTARGET	:= powerpc
 MULTIPLEWORD	:= -mmultiple
@@ -94,19 +96,19 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
 aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
 endif
 
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mlittle-endian
-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mbig-endian)
 ifneq ($(cc-name),clang)
   cflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mno-strict-align
 endif
 
+cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mbig-endian)
+cflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mlittle-endian
 aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mbig-endian)
 aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mlittle-endian
 
 ifeq ($(HAS_BIARCH),y)
-override AS	+= -a$(BITS)
-override LD	+= -m elf$(BITS)$(LDEMULATION)
-override CC	+= -m$(BITS)
+KBUILD_CFLAGS	+= -m$(BITS)
+KBUILD_AFLAGS	+= -m$(BITS) -Wl,-a$(BITS)
+LDFLAGS		+= -m elf$(BITS)$(LDEMULATION)
 KBUILD_ARFLAGS	+= --target=elf$(BITS)-$(GNUTARGET)
 endif
 
arch/powerpc/tools/gcc-check-mprofile-kernel.sh +8 -4
index 061f8035bdbe..a7dd0e5d9f98 100755
@@ -7,17 +7,21 @@ set -o pipefail
 # To debug, uncomment the following line
 # set -x
 
+# -mprofile-kernel is only supported on 64le, so this should not be invoked
+# for other targets. Therefore we can pass in -m64 and -mlittle-endian
+# explicitly, to take care of toolchains defaulting to other targets.
+
 # Test whether the compile option -mprofile-kernel exists and generates
 # profiling code (ie. a call to _mcount()).
 echo "int func() { return 0; }" | \
-    $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
-    grep -q "_mcount"
+    $* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
+    2> /dev/null | grep -q "_mcount"
 
 # Test whether the notrace attribute correctly suppresses calls to _mcount().
 
 echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
-    $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
-    grep -q "_mcount" && \
+    $* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
+    2> /dev/null | grep -q "_mcount" && \
     exit 1
 
 echo "OK"
scripts/recordmcount.pl +17 -1
index 191eb949d52c..fe06e77c15eb 100755
@@ -266,13 +266,29 @@ if ($arch eq "x86_64") {
     $objcopy .= " -O elf32-sh-linux";
 
 } elsif ($arch eq "powerpc") {
+    my $ldemulation;
+
     $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
     # See comment in the sparc64 section for why we use '\w'.
     $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
 
+    if ($endian eq "big") {
+	    $cc .= " -mbig-endian ";
+	    $ld .= " -EB ";
+	    $ldemulation = "ppc"
+    } else {
+	    $cc .= " -mlittle-endian ";
+	    $ld .= " -EL ";
+	    $ldemulation = "lppc"
+    }
     if ($bits == 64) {
-	$type = ".quad";
+        $type = ".quad";
+        $cc .= " -m64 ";
+        $ld .= " -m elf64".$ldemulation." ";
+    } else {
+        $cc .= " -m32 ";
+        $ld .= " -m elf32".$ldemulation." ";
     }
 
 } elsif ($arch eq "arm") {
Signature · 1 line
2.17.0
#8 lore raw

Re: [PATCH v5 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

2018-05-30 21:19 GMT+09:00 Nicholas Piggin <[email protected]>:

Quoted 8 lines

The powerpc toolchain can compile combinations of 32/64 bit and big/little endian, so it's convenient to consider, e.g.,

CC -m64 -mbig-endian

To be the C compiler for the purpose of invoking it to build target artifacts. So overriding the the CC variable to include thse flags works for this purpose.

When I applied this patch, I changed the following.

"the the" -> "the"
"thse" -> "these"

Please let me know if my fix-up is bad.

Quoted 134 lines

Unfortunately that is not compatible with the way the proposed new Kconfig macro language will work.

After previous patches in this series, these flags can be carefully passed in using flags instead.

Since v1: removed extra -EB in the recordmcount script (thanks mpe)

---
 arch/powerpc/Makefile                          | 16 +++++++++-------
 .../powerpc/tools/gcc-check-mprofile-kernel.sh | 12 ++++++++----
 scripts/recordmcount.pl                        | 18 +++++++++++++++++-
 3 files changed, 34 insertions(+), 12 deletions(-)
arch/powerpc/Makefile +9 -7
index 167b26a0780c..6faf1d6ad9dd 100644
@@ -75,13 +75,15 @@ endif
 endif
 
 ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
-override LD    += -EL
+KBUILD_CFLAGS  += -mlittle-endian
+LDFLAGS                += -EL
 LDEMULATION    := lppc
 GNUTARGET      := powerpcle
 MULTIPLEWORD   := -mno-multiple
 KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
 else
-override LD    += -EB
+KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
+LDFLAGS                += -EB
 LDEMULATION    := ppc
 GNUTARGET      := powerpc
 MULTIPLEWORD   := -mmultiple
@@ -94,19 +96,19 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN)             += $(call cc-option,-mabi=elfv1)
 aflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -mabi=elfv2
 endif
 
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -mlittle-endian
-cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(call cc-option,-mbig-endian)
 ifneq ($(cc-name),clang)
   cflags-$(CONFIG_CPU_LITTLE_ENDIAN)   += -mno-strict-align
 endif
 
+cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(call cc-option,-mbig-endian)
+cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -mlittle-endian
 aflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(call cc-option,-mbig-endian)
 aflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -mlittle-endian
 
 ifeq ($(HAS_BIARCH),y)
-override AS    += -a$(BITS)
-override LD    += -m elf$(BITS)$(LDEMULATION)
-override CC    += -m$(BITS)
+KBUILD_CFLAGS  += -m$(BITS)
+KBUILD_AFLAGS  += -m$(BITS) -Wl,-a$(BITS)
+LDFLAGS                += -m elf$(BITS)$(LDEMULATION)
 KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
 endif
 
arch/powerpc/tools/gcc-check-mprofile-kernel.sh +8 -4
index 061f8035bdbe..a7dd0e5d9f98 100755
@@ -7,17 +7,21 @@ set -o pipefail
 # To debug, uncomment the following line
 # set -x
 
+# -mprofile-kernel is only supported on 64le, so this should not be invoked
+# for other targets. Therefore we can pass in -m64 and -mlittle-endian
+# explicitly, to take care of toolchains defaulting to other targets.
+
 # Test whether the compile option -mprofile-kernel exists and generates
 # profiling code (ie. a call to _mcount()).
 echo "int func() { return 0; }" | \
-    $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
-    grep -q "_mcount"
+    $* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
+    2> /dev/null | grep -q "_mcount"
 
 # Test whether the notrace attribute correctly suppresses calls to _mcount().
 
 echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
-    $* -S -x c -O2 -p -mprofile-kernel - -o - 2> /dev/null | \
-    grep -q "_mcount" && \
+    $* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
+    2> /dev/null | grep -q "_mcount" && \
     exit 1
 
 echo "OK"
scripts/recordmcount.pl +17 -2
index 191eb949d52c..fe06e77c15eb 100755
@@ -266,13 +266,29 @@ if ($arch eq "x86_64") {
     $objcopy .= " -O elf32-sh-linux";
 
 } elsif ($arch eq "powerpc") {
+    my $ldemulation;
+
     $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
     # See comment in the sparc64 section for why we use '\w'.
     $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
 
+    if ($endian eq "big") {
+           $cc .= " -mbig-endian ";
+           $ld .= " -EB ";
+           $ldemulation = "ppc"
+    } else {
+           $cc .= " -mlittle-endian ";
+           $ld .= " -EL ";
+           $ldemulation = "lppc"
+    }
     if ($bits == 64) {
-       $type = ".quad";
+        $type = ".quad";
+        $cc .= " -m64 ";
+        $ld .= " -m elf64".$ldemulation." ";
+    } else {
+        $cc .= " -m32 ";
+        $ld .= " -m elf32".$ldemulation." ";
     }
 
 } elsif ($arch eq "arm") {
--

2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada
#9 lore raw

Re: [v5, 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

In reply to Nicholas Piggin
Quoted 9 lines · Nicholas Piggin

The powerpc toolchain can compile combinations of 32/64 bit and big/little endian, so it's convenient to consider, e.g.,

CC -m64 -mbig-endian

To be the C compiler for the purpose of invoking it to build target artifacts. So overriding the the CC variable to include thse flags works for this purpose.

Quoted 7 lines

Unfortunately that is not compatible with the way the proposed new Kconfig macro language will work.

After previous patches in this series, these flags can be carefully passed in using flags instead.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/1421dc6d48296a9e91702743b31458

cheers

author reviewer
#10 lore raw

PATCH v5 4/4 powerpc/kbuild: move -mprofile-kernel check to Kconfig

In reply to Nicholas Piggin

This eliminates the workaround that requires disabling -mprofile-kernel by default in Kconfig.

[ Note: this depends on https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig-shell-v3 ]

---
 arch/powerpc/Kconfig                            | 16 +---------------
 arch/powerpc/Makefile                           | 13 +------------
 arch/powerpc/include/asm/module.h               |  2 +-
 arch/powerpc/kernel/module_64.c                 |  4 ++--
 arch/powerpc/kernel/trace/ftrace.c              |  6 +++---
 arch/powerpc/tools/gcc-check-mprofile-kernel.sh |  1 -
 6 files changed, 8 insertions(+), 34 deletions(-)
arch/powerpc/Kconfig +1 -15
index 0cc41146bc51..736fe35a657d 100644
@@ -461,23 +461,9 @@ config LD_HEAD_STUB_CATCH
 
 	  If unsure, say "N".
 
-config DISABLE_MPROFILE_KERNEL
-	bool "Disable use of mprofile-kernel for kernel tracing"
-	depends on PPC64 && CPU_LITTLE_ENDIAN
-	default y
-	help
-	  Selecting this options disables use of the mprofile-kernel ABI for
-	  kernel tracing. That will cause options such as live patching
-	  (CONFIG_LIVEPATCH) which depend on CONFIG_DYNAMIC_FTRACE_WITH_REGS to
-	  be disabled also.
-
-	  If you have a toolchain which supports mprofile-kernel, then you can
-	  disable this. Otherwise leave it enabled. If you're not sure, say
-	  "Y".
-
 config MPROFILE_KERNEL
 	depends on PPC64 && CPU_LITTLE_ENDIAN
-	def_bool !DISABLE_MPROFILE_KERNEL
+	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__)
 
 config IOMMU_HELPER
 	def_bool PPC64
arch/powerpc/Makefile +1 -12
index 6faf1d6ad9dd..8eda91e0b8df 100644
@@ -161,18 +161,7 @@ CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
 endif
 
 ifdef CONFIG_MPROFILE_KERNEL
-    ifeq ($(shell $(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__),OK)
-        CC_FLAGS_FTRACE := -pg -mprofile-kernel
-        KBUILD_CPPFLAGS += -DCC_USING_MPROFILE_KERNEL
-    else
-        # If the user asked for mprofile-kernel but the toolchain doesn't
-        # support it, emit a warning and deliberately break the build later
-        # with mprofile-kernel-not-supported. We would prefer to make this an
-        # error right here, but then the user would never be able to run
-        # oldconfig to change their configuration.
-        $(warning Compiler does not support mprofile-kernel, set CONFIG_DISABLE_MPROFILE_KERNEL)
-        CC_FLAGS_FTRACE := -mprofile-kernel-not-supported
-    endif
+	CC_FLAGS_FTRACE := -pg -mprofile-kernel
 endif
 
 CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
arch/powerpc/include/asm/module.h +1 -1
index 4f6573934792..c38b125b7a57 100644
@@ -14,7 +14,7 @@
 #include <asm-generic/module.h>
 
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 #define MODULE_ARCH_VERMAGIC_FTRACE	"mprofile-kernel "
 #else
 #define MODULE_ARCH_VERMAGIC_FTRACE	""
arch/powerpc/kernel/module_64.c +2 -2
index a2636c250b7b..55bccc315e1a 100644
@@ -462,7 +462,7 @@ static unsigned long stub_for_addr(const Elf64_Shdr *sechdrs,
 	return (unsigned long)&stubs[i];
 }
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 static bool is_early_mcount_callsite(u32 *instruction)
 {
 	/*
@@ -746,7 +746,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 
 #define PACATOC offsetof(struct paca_struct, kernel_toc)
 
arch/powerpc/kernel/trace/ftrace.c +3 -3
index 4741fe112f05..b2272308225a 100644
@@ -144,7 +144,7 @@ __ftrace_make_nop(struct module *mod,
 		return -EINVAL;
 	}
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 	/* When using -mkernel_profile there is no load to jump over */
 	pop = PPC_INST_NOP;
 
@@ -188,7 +188,7 @@ __ftrace_make_nop(struct module *mod,
 		pr_err("Expected %08x found %08x\n", PPC_INST_LD_TOC, op);
 		return -EINVAL;
 	}
-#endif /* CC_USING_MPROFILE_KERNEL */
+#endif /* CONFIG_MPROFILE_KERNEL */
 
 	if (patch_instruction((unsigned int *)ip, pop)) {
 		pr_err("Patching NOP failed.\n");
@@ -324,7 +324,7 @@ int ftrace_make_nop(struct module *mod,
  * They should effectively be a NOP, and follow formal constraints,
  * depending on the ABI. Return false if they don't.
  */
-#ifndef CC_USING_MPROFILE_KERNEL
+#ifndef CONFIG_MPROFILE_KERNEL
 static int
 expected_nop_sequence(void *ip, unsigned int op0, unsigned int op1)
 {
arch/powerpc/tools/gcc-check-mprofile-kernel.sh +0 -1
index a7dd0e5d9f98..137f3376ac2b 100755
@@ -24,5 +24,4 @@ echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
     2> /dev/null | grep -q "_mcount" && \
     exit 1
 
-echo "OK"
 exit 0
Signature · 1 line
2.17.0
#11 lore raw
In reply to Nicholas Piggin
Quoted 11 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

Quoted 6 lines

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

I'll plan to merge the first three into the powerpc tree.

Masahiro, are you planning to merge your kconfig changes for 4.18? If so you could merge the whole branch and everything should merge nicely.

cheers

#12 lore raw

2018-05-30 23:39 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 20 lines
Quoted 11 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

Quoted 6 lines

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Quoted 3 lines

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

No, you can't.

This series depends on my Kconfig work.

You queued it up on v4.17-rc3,
but necessary patches are not there.

You will get build errors.

Quoted 2 lines

I'll plan to merge the first three into the powerpc tree.

Please do not do this.

You can issue Acked-by instead.

I need all the 4 patches to my tree. Otherwise, the git-bisect'ability breaks for PowerPC.

See, the PPC breakage report from Stephen Rothwell
https://lkml.org/lkml/2018/5/29/1296

Quoted 2 lines

Masahiro, are you planning to merge your kconfig changes for 4.18? If so you could merge the whole branch and everything should merge nicely.

Yes.

I already queued my and Nicholas' patches.

git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild kconfig

Nicholas,

Please check if the patch order is correct.

I need to insert 'powerpc/kbuild' patches between.

Quoted 5 lines

cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada
#13 lore raw
Quoted 21 lines · Masahiro Yamada

2018-05-30 23:39 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 20 lines
Quoted 17 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Quoted 8 lines
Quoted 3 lines

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

No, you can't.

This series depends on my Kconfig work.

The *last* commit depends on your work, the rest do not.

Quoted 4 lines

You queued it up on v4.17-rc3,
but necessary patches are not there.

You will get build errors.

I do not get any build errors for the first three commits.

Quoted 5 lines
Quoted 1 line

I'll plan to merge the first three into the powerpc tree.

Please do not do this.

You can issue Acked-by instead.

I'd prefer the first three commits were in my tree so they're tested properly.

Quoted 2 lines

I need all the 4 patches to my tree. Otherwise, the git-bisect'ability breaks for PowerPC.

You should merge all 4 into your tree, ie. all of my topic/kbuild branch.

And, I'll merge the first 3 into my tree.

There should be no bisection breakage as a result.

cheers

#14 lore raw

2018-05-31 13:31 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 31 lines
Quoted 21 lines · Masahiro Yamada

2018-05-30 23:39 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 20 lines
Quoted 17 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Quoted 8 lines
Quoted 3 lines

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

No, you can't.

This series depends on my Kconfig work.

Quoted 8 lines

The *last* commit depends on your work, the rest do not.

Quoted 4 lines

You queued it up on v4.17-rc3,
but necessary patches are not there.

You will get build errors.

I do not get any build errors for the first three commits.

Right, the first three are fine.

If we make sure commit cfff26c2dc7a1
does not appear in Linus' tree,
we are good.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I'll plan to merge the first three into the powerpc tree.

Please do not do this.

You can issue Acked-by instead.

Quoted 8 lines

I'd prefer the first three commits were in my tree so they're tested properly.

Quoted 2 lines

I need all the 4 patches to my tree. Otherwise, the git-bisect'ability breaks for PowerPC.

You should merge all 4 into your tree, ie. all of my topic/kbuild branch.

This depends on what "merge" means.

If it means "git pull", I cannot pull your topic/kbuild branch since it is broken.

masahiro@pug:~/ref/linux-ppc$ git log -1
commit cfff26c2dc7a18a4d10366896a68fb0ef9c793cb
Author: Nicholas Piggin <[email protected]>
Date:   Wed May 30 22:19:22 2018 +1000

powerpc/kbuild: move -mprofile-kernel check to Kconfig

This eliminates the workaround that requires disabling -mprofile-kernel by default in Kconfig.

[ Note: this depends on
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
kconfig-shell-v3 ]

masahiro@pug:~/ref/linux-ppc$ make ARCH=powerpc  ppc64_defconfig
arch/powerpc/Kconfig:465:warning: ignoring unsupported character '$'
arch/powerpc/Kconfig:465:warning: ignoring unsupported character ','
arch/powerpc/Kconfig:465:warning: ignoring unsupported character '$'
arch/powerpc/Kconfig:466: syntax error
arch/powerpc/Kconfig:465:warning: ignoring unsupported character '$'
arch/powerpc/Kconfig:465:warning: ignoring unsupported character '$'
arch/powerpc/Kconfig:465: invalid option
scripts/kconfig/Makefile:122: recipe for target 'ppc64_defconfig' failed
make[1]: *** [ppc64_defconfig] Error 1
Makefile:525: recipe for target 'ppc64_defconfig' failed
make: *** [ppc64_defconfig] Error 2

So, how do you want me to handle the last patch?

I can pull the first three from your branch,
then I can cherry-pick the last one on top of my kconfig tree.

Is this what you mean?

Quoted 9 lines

And, I'll merge the first 3 into my tree.

There should be no bisection breakage as a result.

cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada
#15 lore raw
Quoted 39 lines · Masahiro Yamada

2018-05-31 13:31 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 38 lines
Quoted 21 lines · Masahiro Yamada

2018-05-30 23:39 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 20 lines
Quoted 17 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Quoted 8 lines
Quoted 3 lines

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

No, you can't.

This series depends on my Kconfig work.

The *last* commit depends on your work, the rest do not.

Quoted 4 lines

You queued it up on v4.17-rc3,
but necessary patches are not there.

You will get build errors.

Quoted 8 lines
Quoted 1 line

I do not get any build errors for the first three commits.

Right, the first three are fine.

If we make sure commit cfff26c2dc7a1
does not appear in Linus' tree,
we are good.

Yep agreed.

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 1 line

I'll plan to merge the first three into the powerpc tree.

Please do not do this.

You can issue Acked-by instead.

I'd prefer the first three commits were in my tree so they're tested properly.

Quoted 2 lines

I need all the 4 patches to my tree. Otherwise, the git-bisect'ability breaks for PowerPC.

Quoted 7 lines
Quoted 2 lines

You should merge all 4 into your tree, ie. all of my topic/kbuild branch.

This depends on what "merge" means.

If it means "git pull", I cannot pull your topic/kbuild branch since it is broken.

Yeah OK I understand what you mean now.

Quoted 4 lines

So, how do you want me to handle the last patch?

I can pull the first three from your branch,
then I can cherry-pick the last one on top of my kconfig tree.

Yes, please do that.

cheers

#16 lore raw

2018-05-31 20:51 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 71 lines
Quoted 39 lines · Masahiro Yamada

2018-05-31 13:31 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 38 lines
Quoted 21 lines · Masahiro Yamada

2018-05-30 23:39 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 20 lines
Quoted 17 lines · Nicholas Piggin

This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig

I have tested on top of that tree, powerpc now builds there.

To avoid build breakage, the first 3 patches must go before the kconfig change, and the 4th patch must go after it.

v5 changes:
- Patch 4 update to syntax changed since kconfig-shell-v3 release.
- Patch 4 suggestions from Masahiro Yamada, remove unnecessary "OK" output from check mprofile script, and fold CC_USING_MPROFILE_KERNEL into CONFIG_MPROFILE_KERNEL.
- Reduce whitespace disturbance in patch 1.

Quoted 8 lines
Quoted 3 lines

I've put this series in a topic branch.

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/kbuild

No, you can't.

This series depends on my Kconfig work.

The *last* commit depends on your work, the rest do not.

Quoted 4 lines

You queued it up on v4.17-rc3,
but necessary patches are not there.

You will get build errors.

Quoted 8 lines
Quoted 1 line

I do not get any build errors for the first three commits.

Right, the first three are fine.

If we make sure commit cfff26c2dc7a1
does not appear in Linus' tree,
we are good.

Yep agreed.

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
Quoted 1 line

I'll plan to merge the first three into the powerpc tree.

Please do not do this.

You can issue Acked-by instead.

I'd prefer the first three commits were in my tree so they're tested properly.

Quoted 2 lines

I need all the 4 patches to my tree. Otherwise, the git-bisect'ability breaks for PowerPC.

Quoted 7 lines
Quoted 2 lines

You should merge all 4 into your tree, ie. all of my topic/kbuild branch.

This depends on what "merge" means.

If it means "git pull", I cannot pull your topic/kbuild branch since it is broken.

Quoted 8 lines

Yeah OK I understand what you mean now.

Quoted 4 lines

So, how do you want me to handle the last patch?

I can pull the first three from your branch,
then I can cherry-pick the last one on top of my kconfig tree.

Yes, please do that.

OK. I will.

BTW, if you try to offer a little more kindness, you may want to check some typos in the commit description.

I suspect some.
https://patchwork.kernel.org/patch/10438869/
https://patchwork.kernel.org/patch/10438873/

Also, the change logs could be dropped.

I see

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

or

Since v1: removed extra -EB in the recordmcount script (thanks mpe)

above your signed-off-by.

Of course, this is your call,
and you do not need to disturb the git history if it is too late.

Signature · 2 lines
Best Regards
Masahiro Yamada
#17 lore raw

Hi Masahiro,

Masahiro Yamada <[email protected]> writes:
...

Quoted 10 lines

Also, the change logs could be dropped.

I see

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

or

Quoted 8 lines

Since v1: removed extra -EB in the recordmcount script (thanks mpe)

above your signed-off-by.

Of course, this is your call,
and you do not need to disturb the git history if it is too late.

You're right, sorry those are bit messy.

I'm happy to update them, I haven't merged them yet, but I see you have them in your tree.

So I won't change them unless you confirm you're OK with it. Let me know.

cheers

#18 lore raw

Hi.

2018-06-01 19:34 GMT+09:00 Michael Ellerman <[email protected]>:

Quoted 23 lines

Hi Masahiro,

Masahiro Yamada <[email protected]> writes:
...

Quoted 10 lines

Also, the change logs could be dropped.

I see

Since v1: reworded changelog to explain the cause of the problem (thanks Segher) and moved the flags into the 64-32 cross compile case.

or

Quoted 8 lines

Since v1: removed extra -EB in the recordmcount script (thanks mpe)

above your signed-off-by.

Of course, this is your call,
and you do not need to disturb the git history if it is too late.

Quoted 7 lines

You're right, sorry those are bit messy.

I'm happy to update them, I haven't merged them yet, but I see you have them in your tree.

So I won't change them unless you confirm you're OK with it. Let me know.

Could you update your branch, please?

Then, I will re-pull the new one.

Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada
reviewer Acked-by
#19 lore raw
Quoted 1 line · Masahiro Yamada

2018-06-01 19:34 GMT+09:00 Michael Ellerman <[email protected]>:

...

Quoted 2 lines

Could you update your branch, please?

Done.

I've only pushed the first three patches this time, to avoid any confusion. Hopefully :)

The top commit is:

1421dc6d4829 ("powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS")

For the fourth one you're welcome to add my ack when you apply it:

Quoted 1 line

Then, I will re-pull the new one.

Thanks! Sorry this took a while to get right, next time we'll be much better at it ;)

cheers

author reviewer
#20 lore raw
Quoted 16 lines · On Fri, 01 Jun 2018 23:22:27 +1000 Michael Ellerman <[email protected]> wrote:
Quoted 1 line · Masahiro Yamada

2018-06-01 19:34 GMT+09:00 Michael Ellerman <[email protected]>:

...

Quoted 2 lines

Could you update your branch, please?

Done.

I've only pushed the first three patches this time, to avoid any confusion. Hopefully :)

The top commit is:

1421dc6d4829 ("powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS")

Quoted 8 lines

For the fourth one you're welcome to add my ack when you apply it:

Quoted 1 line

Then, I will re-pull the new one.

Thanks! Sorry this took a while to get right, next time we'll be much better at it ;)

Thank you both for sorting out my mess.

Thanks,
Nick