Re: stable/11 question: kboot vs. powerpc: only powerpc64?

From: Mark Millard <markmi_at_dsl-only.net>
Date: Mon, 11 Jul 2016 11:43:06 -0700
On 2016-Jul-11, at 11:30 AM, Mark Millard <markmi_at_dsl-only.net> wrote:

> On 2016-Jul-11, at 11:04 AM, Mark Millard <markmi_at_dsl-only.net> wrote:
> 
>> On 2016-Jul-11, at 6:49 AM, Nathan Whitehorn <nwhitehorn_at_freebsd.org> wrote:
>>> 
>>> It is not 64-bit only; like the normal loader, it can load both 32-bit and 64-bit kernels. Those two flags are probably obsolete at this point and were for compatibility with pre-2.17.5 versions of binutils. Can you do a test build with the -CFLAGS+= -Wa,-mppc64bridge line removed?
>>> -Nathan
>>> 
>>> On 07/11/16 03:55, Mark Millard wrote:
>>>> Is the following something that should be updated something like is indicated below for 11.0-BETA1? Is kboot powerpc64 specific?
>>>> 
>>>> # svnlite diff /usr/src/sys/boot/powerpc/Makefile
>>>> Index: /usr/src/sys/boot/powerpc/Makefile
>>>> ===================================================================
>>>> --- /usr/src/sys/boot/powerpc/Makefile	(revision 302457)
>>>> +++ /usr/src/sys/boot/powerpc/Makefile	(working copy)
>>>> _at__at_ -1,5 +1,9 _at__at_
>>>> # $FreeBSD$
>>>> -SUBDIR=		boot1.chrp kboot ofw ps3 uboot
>>>> +SUBDIR=		boot1.chrp
>>>> +.if ${MACHINE_ARCH} == "powerpc64"
>>>> +SUBDIR+=		kboot
>>>> +.endif
>>>> +SUBDIR+=		ofw ps3 uboot
>>>>  .include <bsd.subdir.mk>
>>>> 
>>>> 
>>>> 
>>>> I ask because I'd submitted 206303 back on 2016-jan-16 reporting that TARGET_ARCH=powerpc WITH_BOOT= was stopped by getting a -Wc,-mppc64bride and a -mcpu=powerpc64 (one of the base/head/sys/boot/powerpc/kboot/Makefile SRCS being ppc64_elf_freebsd.c).
>>>> 
>>>> ===
>>>> Mark Millard
>>>> markmi at dsl-only.net
>> 
>> I do not have access to powerpc's currently so I'm just going to be doing cross-build tests for TARGET_ARCH=powerpc and TARGET_ARCH=powerpc64 (from amd64) based on the below updates.
>> 
>> You initially mention "two flags" but then only explicitly request removal of one (the -CFLAGS+= -Wa,-mppc64bridge line).
>> 
>> I'm assuming that the -mcpu=powerpc64 is also to be removed if powerpc (non-64) is to be covered. See my intended test below. Let me know if it is not what you want. 
>> 
>>> # svnlite diff sys/boot/powerpc/kboot/Makefile
>>> Index: sys/boot/powerpc/kboot/Makefile
>>> ===================================================================
>>> --- sys/boot/powerpc/kboot/Makefile	(revision 302457)
>>> +++ sys/boot/powerpc/kboot/Makefile	(working copy)
>>> _at__at_ -71,7 +71,7 _at__at_
>>> # Avoid the open-close-dance for every file access as some firmwares perform
>>> # an auto-negotiation on every open of the network interface and thus causes
>>> # netbooting to take horribly long.
>>> -CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64
>>> +CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE
>>> 
>>> # Always add MI sources
>>> .PATH:		${.CURDIR}/../../common ${.CURDIR}/../../../libkern
>>> _at__at_ -88,9 +88,6 _at__at_
>>> 
>>> LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
>>> 
>>> -# 64-bit bridge extensions
>>> -CFLAGS+= -Wa,-mppc64bridge
>>> -
>>> # Pull in common loader code
>>> #.PATH:		${.CURDIR}/../../ofw/common
>>> #.include	"${.CURDIR}/../../ofw/common/Makefile.inc"
>> 
>>> # svnlite diff sys/boot/powerpc/Makefile
>>> # 
>> 
>> (I.e., I reverted sys/boot/powerpc/Makefile.)
>> 
>> ===
>> Mark Millard
>> markmi at dsl-only.net
> 
> The TARGET_ARCH=powerpc build completed with the following messages (from grep'ing for kboot in the typescript file):
> 
>> ===> sys/boot/powerpc/kboot (all)
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/vers.c
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/conf.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/metadata.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/vers.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/main.o
>> /usr/src/sys/boot/powerpc/kboot/main.c:307:12: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
>> /usr/src/sys/boot/powerpc/kboot/main.c:306:29: note: initialize the variable 'sp' to silence this warning
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/ppc64_elf_freebsd.o
>> /usr/src/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c:94:15: warning: implicit declaration of function 'md_load64' is invalid in C99 [-Wimplicit-function-declaration]
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/host_syscall.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/hostcons.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/hostdisk.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/kerneltramp.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/kbootfdt.o
>> --- kbootfdt.o ---
>> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:54:17: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>> /usr/src/sys/boot/powerpc/kboot/host_syscall.h:36:21: note: passing argument to parameter 'path' here
>> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:123:8: warning: assigning to 'uint64_t *' (aka 'unsigned long long *') from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:125:8: warning: assigning to 'uint64_t *' (aka 'unsigned long long *') from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:134:8: warning: assigning to 'uint32_t *' (aka 'unsigned int *') from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:135:8: warning: assigning to 'uint32_t *' (aka 'unsigned int *') from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/ucmpdi2.o
>> In file included from /usr/src/sys/boot/powerpc/kboot/../../../libkern/ucmpdi2.c:37:
>> In file included from /usr/src/sys/boot/powerpc/kboot/../../../libkern/quad.h:59:
>> /usr/src/sys/boot/powerpc/kboot/../../../sys/syslimits.h:41:2: warning: "No user-serviceable parts inside." [-W#warnings]
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/boot.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/commands.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/console.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/devopen.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/interp.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/interp_backslash.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/interp_parse.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/ls.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/misc.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/module.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/panic.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/load_elf32.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/reloc_elf32.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/load_elf64.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/reloc_elf64.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/dev_net.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/disk.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/part.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/crc32.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/interp_forth.o
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/loader.kboot
>> Building /usr/obj/clang/powerpc.powerpc/usr/src/sys/boot/powerpc/kboot/loader.help
> 
> The compiler involved was clang 3.8.0 . (This was a WITH_META_MODE=yes build.)
> 
> The TARGET_ARCH=powerpc64 build also completed. The compiler involved was powerpc64-gcc. (This was a WITH_META_MODE=yes build.)
> 
> ===
> Mark Millard
> markmi at dsl-only.net

I just noticed at least one additional warning (for hostdisk.c) from the TARGET_ARCH=powerpc64 so here is the list via grep for that context:

> # grep kboot ~/sys_typescripts/typescript_make_powerpc64vtsc_nodebug_incl_clang_xtoolchain-amd64-host-2016-07-11:11:02:56 | grep -i warning:
> /usr/src/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c:94:15: warning: implicit declaration of function 'md_load64' [-Wimplicit-function-declaration]
> /usr/src/sys/boot/powerpc/kboot/hostdisk.c:96:10: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'void *' [-Wformat=]
> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:54:17: warning: passing argument 1 of 'host_open' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:123:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:125:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:134:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> /usr/src/sys/boot/powerpc/kboot/kbootfdt.c:135:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> /usr/src/sys/boot/powerpc/kboot/../../../sys/syslimits.h:41:2: warning: #warning "No user-serviceable parts inside." [-Wcpp]
> /usr/src/sys/boot/powerpc/kboot/../../common/ls.c:142:18: warning: variable 'tail' set but not used [-Wunused-but-set-variable]

===
Mark Millard
markmi at dsl-only.net
Received on Mon Jul 11 2016 - 16:43:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:06 UTC