From: Randy Dunlap <hidden> Date: 2021-04-20 23:32:18
Hi,
Is there a way to do this?
$ make ARCH=powerpc randconfig # and force PPC32
and separately
$ make ARCH=powerpc randconfig # and force PPC64
I suppose that I could do something like this (for PPC64):
$ make ARCH=powerpc randconfig
$ ./scripts/config -d PPC32 -e PPC64
$ make ARCH=powerpc olddefconfig
$ make ARCH=powerpc all
but that's awkward and sort of defeats the randomness -- i.e.,
the randomness is done before the ARCH=PPC{32,64} is forced,
and then some of the config items won't be valid during the
'make olddefconfig'.
If the answer is No, then I will try to make a patch (at least
for local use) that does something like x86 does for
i386 | x86_64, or sparc does for sparc32 | sparc64.
[time passes]
OK, I have a patch that seems for work as far as setting
PPC32=y or PPC64=y... but it has a problem during linking
of vmlinux:
crosstool/gcc-9.3.0-nolibc/powerpc-linux/bin/powerpc-linux-ld:./arch/powerpc/kernel/vmlinux.lds:6: syntax error
and the (bad) generated vmlinux.lds file says (at line 6):
OUTPUT_ARCH(1:common)
while it should say:
OUTPUT_ARCH(powerpc:common)
Does anyone have any ideas about this problem?
The ARCH=ppc32 / ARCH=ppc64 patch is below FYI.
It is missing an update to Documentation/kbuild/kbuild.rst (aliases).
thanks.
--
---
Makefile | 8 ++++++++
arch/powerpc/Makefile | 14 +++++++-------
arch/powerpc/kernel/vdso64/Makefile | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 5 +++--
4 files changed, 19 insertions(+), 10 deletions(-)
@@ -30,7 +30,7 @@ ccflags-y := -shared -fno-common -fno-buasflags-y:=-D__VDSO64__-stargets+=vdso64.lds-CPPFLAGS_vdso64.lds+=-P-C-U$(ARCH)+CPPFLAGS_vdso64.lds+=-P-C-U$(SRCARCH)# link rule for the .so file, .lds has to be first$(obj)/vdso64.so.dbg:$(src)/vdso64.lds$(obj-vdso64)$(obj)/vgettimeofday.oFORCE---linux-next-20210420.orig/arch/powerpc/Makefile+++linux-next-20210420/arch/powerpc/Makefile
@@ -297,8 +297,8 @@ bootwrapper_install:# without the .config suffix.define merge_into_defconfig$(Q)$(CONFIG_SHELL)$(srctree)/scripts/kconfig/merge_config.sh\--m-O$(objtree)$(srctree)/arch/$(ARCH)/configs/$(1)\-$(foreachconfig,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)+-m-O$(objtree)$(srctree)/arch/$(SRCARCH)/configs/$(1)\+$(foreachconfig,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)+$(Q)$(MAKE)-f$(srctree)/Makefileolddefconfigendef
@@ -378,7 +378,7 @@ ppc64_book3e_allmodconfig:define archhelp@echo'* zImage - Build default images selected by kernel config'-@echo' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'+@echo' zImage.* - Compressed kernel image (arch/$(SRCARCH)/boot/zImage.*)'@echo' uImage - U-Boot native image format'@echo' cuImage.<dt> - Backwards compatible U-Boot image for older'@echo' versions which do not support device trees'
@@ -389,12 +389,12 @@ define archhelp@echo' (your) ~/bin/$(INSTALLKERNEL) or'@echo' (distribution) /sbin/$(INSTALLKERNEL) or'@echo' install to $$(INSTALL_PATH) and run lilo'-@echo' *_defconfig - Select default config from arch/$(ARCH)/configs'+@echo' *_defconfig - Select default config from arch/$(SRCARCH)/configs'@echo''@echo' Targets with <dt> embed a device tree blob inside the image'@echo' These targets support board with firmware that does not'@echo' support passing a device tree directly. Replace <dt> with the'-@echo' name of a dts file from the arch/$(ARCH)/boot/dts/ directory'+@echo' name of a dts file from the arch/$(SRCARCH)/boot/dts/ directory'@echo' (minus the .dts extension).'endef
[time passes]
OK, I have a patch that seems for work as far as setting
PPC32=y or PPC64=y... but it has a problem during linking
of vmlinux:
crosstool/gcc-9.3.0-nolibc/powerpc-linux/bin/powerpc-linux-ld:./arch/powerpc/kernel/vmlinux.lds:6: syntax error
and the (bad) generated vmlinux.lds file says (at line 6):
OUTPUT_ARCH(1:common)
while it should say:
OUTPUT_ARCH(powerpc:common)
Does anyone have any ideas about this problem?
The following change fixes the problem, allthough I guess that's not what you want to do at the end.
I don't think you need that change. If the ARCH is neither 'powerpc' not 'ppc64' CONFIG_PPC64 isn't
set so CONFIG_PPC32 is set.
select KASAN_VMALLOC if KASAN && MODULES
config PPC64
- bool "64-bit kernel"
+ bool "64-bit kernel" if "$(ARCH)" = "powerpc"
+ default y if "$(ARCH)" = "ppc64"
select ZLIB_DEFLATE
help
This option selects whether a 32-bit or a 64-bit kernel
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-04-21 07:16:19
Randy Dunlap [off-list ref] writes:
Hi,
Is there a way to do this?
$ make ARCH=powerpc randconfig # and force PPC32
Sort of:
$ KCONFIG_ALLCONFIG=arch/powerpc/configs/book3s_32.config make randconfig
But that also forces BOOK3S.
and separately
$ make ARCH=powerpc randconfig # and force PPC64
No.
...
OK, I have a patch that seems for work as far as setting
PPC32=y or PPC64=y... but it has a problem during linking
of vmlinux:
crosstool/gcc-9.3.0-nolibc/powerpc-linux/bin/powerpc-linux-ld:./arch/powerpc/kernel/vmlinux.lds:6: syntax error
and the (bad) generated vmlinux.lds file says (at line 6):
OUTPUT_ARCH(1:common)
while it should say:
OUTPUT_ARCH(powerpc:common)
Does anyone have any ideas about this problem?
I guess your patch broke something? :D
Not sure sorry.
What about something like this?
cheers
On Wed, Apr 21, 2021 at 4:15 PM Michael Ellerman [off-list ref] wrote:
quoted hunk
Randy Dunlap [off-list ref] writes:
quoted
Hi,
Is there a way to do this?
$ make ARCH=powerpc randconfig # and force PPC32
Sort of:
$ KCONFIG_ALLCONFIG=arch/powerpc/configs/book3s_32.config make randconfig
But that also forces BOOK3S.
quoted
and separately
$ make ARCH=powerpc randconfig # and force PPC64
No.
...
quoted
OK, I have a patch that seems for work as far as setting
PPC32=y or PPC64=y... but it has a problem during linking
of vmlinux:
crosstool/gcc-9.3.0-nolibc/powerpc-linux/bin/powerpc-linux-ld:./arch/powerpc/kernel/vmlinux.lds:6: syntax error
and the (bad) generated vmlinux.lds file says (at line 6):
OUTPUT_ARCH(1:common)
while it should say:
OUTPUT_ARCH(powerpc:common)
Does anyone have any ideas about this problem?
I guess your patch broke something? :D
Not sure sorry.
What about something like this?
cheers
From: Randy Dunlap <hidden> Date: 2021-04-27 23:46:07
On 4/21/21 12:15 AM, Michael Ellerman wrote:
quoted hunk
Randy Dunlap [off-list ref] writes:
quoted
Hi,
Is there a way to do this?
$ make ARCH=powerpc randconfig # and force PPC32
Sort of:
$ KCONFIG_ALLCONFIG=arch/powerpc/configs/book3s_32.config make randconfig
But that also forces BOOK3S.
quoted
and separately
$ make ARCH=powerpc randconfig # and force PPC64
No.
...
quoted
OK, I have a patch that seems for work as far as setting
PPC32=y or PPC64=y... but it has a problem during linking
of vmlinux:
crosstool/gcc-9.3.0-nolibc/powerpc-linux/bin/powerpc-linux-ld:./arch/powerpc/kernel/vmlinux.lds:6: syntax error
and the (bad) generated vmlinux.lds file says (at line 6):
OUTPUT_ARCH(1:common)
while it should say:
OUTPUT_ARCH(powerpc:common)
Does anyone have any ideas about this problem?
I guess your patch broke something? :D
Not sure sorry.
What about something like this?
cheers