From owner-freebsd-ppc@FreeBSD.ORG Thu Mar 12 00:34:17 2015 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BF61DF4 for ; Thu, 12 Mar 2015 00:34:17 +0000 (UTC) Received: from asp.reflexion.net (outbound-241.asp.reflexion.net [69.84.129.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02EA07AF for ; Thu, 12 Mar 2015 00:34:16 +0000 (UTC) Received: (qmail 7574 invoked from network); 12 Mar 2015 00:34:15 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 12 Mar 2015 00:34:15 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.40.1) with SMTP; Wed, 11 Mar 2015 20:34:15 -0400 (EDT) Received: (qmail 3068 invoked from network); 12 Mar 2015 00:34:15 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 Mar 2015 00:34:15 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id 950801C4052; Wed, 11 Mar 2015 17:34:09 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: 11.0-CURRENT: ofw_standard.c:175 (for example): attempts to cast char* to cell_t fail in cross compile from powerpc to powerpc64 From: Mark Millard In-Reply-To: Date: Wed, 11 Mar 2015 17:34:13 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: FreeBSD PowerPC ML , Nathan Whitehorn X-Mailer: Apple Mail (2.2070.6) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 00:34:17 -0000 Given the mix of the new relocatable kernels, powerpc64 (and other > 32 = bit-bit addressed openfirmware use?) and "typedef uint32_t cell_t;" (at = least for sys/powerpc/include/ofw_machdep.h)... For the char*-to-cell_t casing in 11.0-CURRENT's ofw_standard.c to work = for powerpc64 and others with larger than 32 bit addresses but = restrictions in the openfirmware implementation it would seem that = something must force the strings to stay in lower memory where zero = extended 32 bit values work as addresses. (Which may well be a = requirement of the Openfirmware implementation --no matter how things = are expressed in C/C++ code.) On fundamentals it looks to me like the 11.0-CURRENT ofw_standard.c code = assumes that only a <=3D 32 bit pointer environment would be using = openfirmware: I see no hook for keeping the relevant strings inside the = smaller address range. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2015-Mar-11, at 05:12 PM, Mark Millard = wrote: Basic context (on a PowerMac G5 but using a powerpc 11.0-CURRENT build = to cross build targeting powerpc64): # freebsd-version -ku; uname -a 11.0-CURRENT 11.0-CURRENT FreeBSD FBSDG4C0 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279514M: Mon Mar = 9 22:24:27 PDT 2015 = root@FBSDG4S0:/usr/obj/usr/srcC/sys/GENERICvtsc-NODEBUG powerpc # svnlite info Path: . Working Copy Root Path: /usr/srcC URL: https://svn0.us-west.freebsd.org/base/head Relative URL: ^/head Repository Root: https://svn0.us-west.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 279514 Node Kind: directory Schedule: normal Last Changed Author: adrian Last Changed Rev: 279514 Last Changed Date: 2015-03-01 18:27:25 -0800 (Sun, 01 Mar 2015) The problem for building powerpc64 kernels from a powerpc build's = context... I tried to buildworld buildkernel with TARGET=3Dpowerpc = TARGET_ARCH=3Dpowerpc64. while buildworld completed buildkernel did not. I give the relevant part of the script output file below but the basic = problem shows up as point to integer conversions with mismatched sizes = in code casting (for example) char* to cell_t such as: static int ofw_std_test(ofw_t ofw, const char *name) { struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t service; cell_t missing; } args =3D { (cell_t)"test", // <<<<<<<<<< LOOK HERE 1, 1, }; args.service =3D (cell_t)name; // <<<<<<<<<< LOOK HERE if (openfirmware(&args) =3D=3D -1) return (-1); return (args.missing); } The script log shows: ... ctfconvert -L VERSION -g ofwbus.o^M cc -c -O -pipe -g -Wall -Wredundant-decls -Wnested-externs = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline = -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-in clude-dirs -fdiagnostics-show-option -Wno-unknown-pragmas = -Wno-uninitialized -nostdinc -I. -I/usr/srcC/sys = -I/usr/srcC/sys/contrib/altq -I/usr/srcC/sys/contrib/libfdt -D_KERNEL = -DHAVE_KERNEL_OPTION _HEADERS -include opt_global.h -msoft-float -Wa,-many = -fno-omit-frame-pointer -mno-altivec -ffreestanding -fwrapv = -fstack-protector -gdwarf-2 -Wno-uninitialized -Wall -Wredundant-decls = -Wnested-exter ns -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline = -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions = -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized -fno-common -fms-extensions -finline-limit=3D15000 = --param inline-unit-growth=3D100 --param large-function-growth=3D1000 = -msoft-float -std=3Diso9899:1999 -Werror /usr/srcC/sys/dev/ofw/ ofw_standard.c^M cc1: warnings being treated as errors^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_test':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:175: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:180: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_interpret':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:195: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:202: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_peer':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:226: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_child':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:248: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_parent':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:270: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_instance_to_package':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:292: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_getproplen':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:315: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:321: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_getprop':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:342: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:348: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:349: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_nextprop':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:370: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:376: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:377: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_setprop':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:399: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:405: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:406: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_canon':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:426: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:431: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:432: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_finddevice':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:450: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:455: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_instance_to_path':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:474: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:480: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_package_to_path':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:500: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:506: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function = 'ofw_std_call_method':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:526: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:537: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_open':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:567: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:572: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_close':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:588: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_read':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:610: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:616: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_write':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:637: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:643: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_seek':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:663: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_claim':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:693: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:698: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:703: warning: cast to pointer from = integer of different size [-Wint-to-pointer-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_release':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:717: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c:722: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_enter':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:740: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M /usr/srcC/sys/dev/ofw/ofw_standard.c: In function 'ofw_std_exit':^M /usr/srcC/sys/dev/ofw/ofw_standard.c:758: warning: cast from pointer to = integer of different size [-Wpointer-to-int-cast]^M *** Error code 1^M ^M Stop.^M make[2]: stopped in = /usr/obj/powerpc.powerpc64/usr/srcC/sys/GENERICvtsc-NODEBUG^M *** Error code 1^M ^M Stop.^M make[1]: stopped in /usr/srcC^M *** Error code 1^M =3D=3D=3D Mark Millard markmi at dsl-only.net