From owner-freebsd-ppc@freebsd.org Mon May 30 06:32:59 2016 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 B459FB54D2C for ; Mon, 30 May 2016 06:32:59 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-182.reflexion.net [208.70.211.182]) (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 5662313DB for ; Mon, 30 May 2016 06:32:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 8503 invoked from network); 30 May 2016 06:32:47 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 30 May 2016 06:32:47 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Mon, 30 May 2016 02:32:49 -0400 (EDT) Received: (qmail 3821 invoked from network); 30 May 2016 06:32:49 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 30 May 2016 06:32:49 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 7F73CB1E001; Sun, 29 May 2016 23:32:44 -0700 (PDT) Subject: 11.0 -r300944 buildworld attempt failed [amd64 targeting powerpc via system clang use] Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 From: Mark Millard In-Reply-To: <8A197698-51C7-43F9-9927-465602E19AAE@dsl-only.net> Date: Sun, 29 May 2016 23:32:50 -0700 Cc: FreeBSD Toolchain , FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: References: <8A197698-51C7-43F9-9927-465602E19AAE@dsl-only.net> To: FreeBSD Current , Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2016 06:32:59 -0000 [It may well be that powerpc is not an intended cross compile target via = clang since clang is insufficient for an FreeBSD/powerpc ABI compliant = buildworld as stands. Still I use this to illustrate the more general = points for clang use in cross builds.] The failure: > --- libc.so.7.full --- > /usr/bin/ld: unrecognised emulation mode: elf32ppc_fbsd > Supported emulations: elf_x86_64_fbsd elf_i386_fbsd > clang: error: linker command failed with exit code 1 (use -v to see = invocation) > *** [libc.so.7.full] Error code 1 >=20 > make[4]: stopped in /usr/src/lib/libc > 1 error >=20 > make[4]: stopped in /usr/src/lib/libc > *** [lib/libc__L] Error code 2 Note the /usr/bin/ld use: the host (amd64) linker for a powerpc link = operation. The log shows the ld command was via clang=E2=80=99s front end as far as = what the build did directly (just a prefix shown): > --- libc.so.7.full --- > /usr/bin/clang -target powerpc-unknown-freebsd11.0 = --sysroot=3D/usr/obj/clang/powerpc.powerpc/usr/src/tmp = -B/usr/obj/clang/powerpc.powerpc/usr/src/tmp/usr/bin -nodefaultlibs = -Wl,--version-script=3DVersion.map -shared -Wl,-x -Wl,--fatal-warnings = -Wl,--warn-shared-textrel -o libc.so.7.full -Wl,-soname,libc.so.7 = `NM=3D'nm' NMFLAGS=3D'' lorder trivial-vdso_tc.So bt_close.So bt_conv.So = bt_debug.So bt_delete.So bt_get.So bt_open.So bt_overflow.So bt_page.So . . . The -B does not point to a place with a powerpc specific ld command: > # ls -lt /usr/obj/clang/powerpc.powerpc/usr/src/tmp/usr/bin > total 1395 > -rwxr-xr-x 1 root wheel 827248 May 29 22:20 ctfmerge > -rwxr-xr-x 1 root wheel 534712 May 29 22:20 sysinit > -rwxr-xr-x 1 root wheel 960784 May 29 22:20 ctfconvert As far as I can tell a potentially proper path would have been: /usr/local/powerpc-freebsd/bin/ld if a devel/powerpc-binutils port existed and was installed. (No such = port exists.) I do not know if other TARGET_ARCH=E2=80=99s have similar problems or = not (even if they have a binutils port). This was not a WITH_META_MODE=3Dyes context. make.conf was empty and src.conf was: TO_TYPE=3Dpowerpc # KERNCONF=3DGENERICvtsc-NODEBUG TARGET=3D${TO_TYPE} .if ${.MAKE.LEVEL} =3D=3D 0 TARGET_ARCH=3D${TO_TYPE} .export TARGET_ARCH .endif # WITHOUT_CROSS_COMPILER=3D WITH_SYSTEM_COMPILER=3D # WITH_LIBCPLUSPLUS=3D WITH_BINUTILS_BOOTSTRAP=3D WITH_CLANG=3D WITH_CLANG_IS_CC=3D WITH_CLANG_FULL=3D WITH_CLANG_EXTRAS=3D # lldb requires missing atomic 8-byte operations for powerpc (non-64) WITHOUT_LLDB=3D # WITH_BOOT=3D WITHOUT_LIB32=3D # WITHOUT_GCC_BOOTSTRAP=3D WITHOUT_GCC=3D WITHOUT_GCC_IS_CC=3D WITHOUT_GNUCXX=3D # NO_WERROR=3D #WERROR=3D MALLOC_PRODUCTION=3D # WITH_DEBUG_FILES=3D =3D=3D=3D Mark Millard markmi at dsl-only.net