From owner-freebsd-ppc@freebsd.org Fri Jun 16 04:20:11 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82284BF5DF1 for ; Fri, 16 Jun 2017 04:20:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-16.reflexion.net [208.70.210.16]) (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 34A536F419 for ; Fri, 16 Jun 2017 04:20:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 31540 invoked from network); 16 Jun 2017 04:20:09 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 16 Jun 2017 04:20:09 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Fri, 16 Jun 2017 00:20:09 -0400 (EDT) Received: (qmail 14227 invoked from network); 16 Jun 2017 04:20:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 16 Jun 2017 04:20:09 -0000 Received: from [192.168.1.114] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 8375FEC7B35; Thu, 15 Jun 2017 21:20:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: -r319936 and -r319991 TARGET_ARCH=powerpc via clang: boot1.chrp/boot1.c:(.text+0x14b8): undefined reference to `__udivdi3' (boot1.o: In function `fsread_size') From: Mark Millard In-Reply-To: Date: Thu, 15 Jun 2017 21:20:08 -0700 Cc: FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: References: To: FreeBSD Toolchain X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2017 04:20:11 -0000 [A gcc 4.2.1 based buildworld buildkernel did not have this problem.] On 2017-Jun-15, at 5:34 PM, Mark Millard wrote: > Context: amd64 -> powerpc cross build of -r319936 > (one of my usual clang-based experiments): >=20 > --- all_subdir_sys --- > Building = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/boot/powerpc/boot1.= chrp/boot1.elf > --- boot1.elf --- > boot1.o: In function `fsread_size': > /usr/src/sys/boot/powerpc/boot1.chrp/boot1.c:(.text+0x14b8): undefined = reference to `__udivdi3' > /usr/src/sys/boot/powerpc/boot1.chrp/boot1.c:(.text+0x1508): undefined = reference to `__udivdi3' > cc: error: linker command failed with exit code 1 (use -v to see = invocation) > --- all_subdir_lib --- > Building = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/lib/msun/s_remquo.po > --- all_subdir_sys --- > *** [boot1.elf] Error code 1 >=20 > make[6]: stopped in /usr/src/sys/boot/powerpc/boot1.chrp > .ERROR_TARGET=3D'boot1.elf' > = .ERROR_META_FILE=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys= /boot/powerpc/boot1.chrp/boot1.elf.meta' >=20 >=20 > # Meta data file = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/boot/powerpc/boot1.= chrp/boot1.elf.meta > CMD cc -target powerpc-unknown-freebsd12.0 = --sysroot=3D/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp = -B/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin = -ffreestanding -msoft-float = -I/usr/src/sys/boot/powerpc/boot1.chrp/../../common = -I/usr/src/sys/boot/powerpc/boot1.chrp/../../../ -D_STANDALONE = -std=3Dgnu99 -Qunused-arguments -nostdlib -static -Wl,-N -o boot1.elf = boot1.o ashldi3.o syncicache.o =20 > CWD = /usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/boot/powerpc/boot1.= chrp > TARGET boot1.elf > -- command output -- > boot1.o: In function `fsread_size': > /usr/src/sys/boot/powerpc/boot1.chrp/boot1.c:(.text+0x14b8): undefined = reference to `__udivdi3' > /usr/src/sys/boot/powerpc/boot1.chrp/boot1.c:(.text+0x1508): undefined = reference to `__udivdi3' > cc: error: linker command failed with exit code 1 (use -v to see = invocation) > *** Error code 1 >=20 > Note: This was -j16 for the build. >=20 > I updated /usr/src and amd64 to -r319991 and then > retried cross building for powerpc: same result. >=20 >=20 > Note: I'd frozen at -r317820 until this update. Back then > I could buildworld and buildkernel via clang (although > I could not boot the clang-based kernel and so had to > build a gcc 4.2.1 based one and use it). I tried a gcc 4.2.1 buildworld buildkernel and it completed fine. The __udivdi3 problem is clang toolchain specific. =3D=3D=3D Mark Millard markmi at dsl-only.net