From owner-freebsd-toolchain@freebsd.org Sat May 12 05:27:55 2018 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 854CFFB4270 for ; Sat, 12 May 2018 05:27:55 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic313-15.consmr.mail.bf2.yahoo.com (sonic313-15.consmr.mail.bf2.yahoo.com [74.6.133.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F174814CC for ; Sat, 12 May 2018 05:27:54 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: YUy8nkMVM1m1R313S3RcVA6fHykTX04F8rw6WAEUShREA4hgxxdcroci_m6WJEa ahMpGZcKGEQdl2YMwDyalY0Y65jFXhrNdJbbD3RYE24RQ7fHPyu5KRz.tr8gKSrkzKtB3BbG_Gb2 vuZM_Giw5fcl3dstl2qp5yFv.b4BX9ynHbBCD5BEgHG9Gjm1JEBP0VrxccjQ41dOkw6kMyPbsHra NIl.FJLqb7ik_K0RYpSlDhvf5.btncdJQIT4w_WtICflboEvkm6XoUYmcFOIZBQC0djbc0CQOcz5 tp45ivFiF8oYuz3qGtwXjpU_ko12UkP9rGGMfp75afJOC2Mr7C6BF86pPdSl6INA5IqC8MNfLZ5q 63nEmnm8deBjmYRPVEvdkTRVG_jz3HkY4owoBeyhuZpwZ.wzy4rG6v2JQKF5RSF2tiqMTZ0blwqh AUF00AUMT1UXrUy.72zsbAAM.MxHrHwrxUti.cGCBa029KXcVMPfAciroVkPEU35PCWEQwyEMqZg z95Ts4MlxuNDMEd0j18.wApOoTV9z8HaRek3gjXDhCRIeB.1B.VmneIb2jmP1p9ztg8PwCdCHCuG ielcBagM0ywO535vBlVOdxHRC8BTx1Xv_Pk6ePCFaMTfnu.epqy2vhOxJVHc2joNIZACo9Jvsv18 I5IY- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.bf2.yahoo.com with HTTP; Sat, 12 May 2018 05:27:54 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp401.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5d145dba65231755fbe645c632627545; Sat, 12 May 2018 05:07:40 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: What fails when devel/xtoolchain-llvm60 attempts to build powerpc64's lib32 in buildworld cross builds (from amd64 here) Date: Fri, 11 May 2018 22:07:38 -0700 References: <81EA8FB2-101B-4D31-A2D4-91CCB78AF695@yahoo.com> To: freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML In-Reply-To: Message-Id: <0AAA00A2-5C78-44FF-AFFE-5D796A22EBC7@yahoo.com> X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2018 05:27:55 -0000 On 2018-May-11, at 4:09 PM, Mark Millard = wrote: > [I experiment with targeting powerpc family members with > modern tool chains. In this case trying to use > devel/xtoolchain-llvm60 . This was indirectly reached via > commenting on a bugzilla entry for something else powerpc > family related.] >=20 > BEGIN setup notes: >=20 > Because of (at least) lld problems for targeting powerpc family = members, > the following is based on an alternate toolchains/*.mk : >=20 > # diff /usr/local/share/toolchains/llvm60.mk = /usr/local/share/toolchains/llvm60_altbinutils.mk > 4,5c4,5 > < XLD=3D/usr/local/llvm60/bin/ld.lld > < CROSS_BINUTILS_PREFIX=3D/var/empty > --- >=20 >> #XLD=3D/usr/local/llvm60/bin/ld.lld >> #CROSS_BINUTILS_PREFIX=3D/var/empty >=20 > This is to allow setting up the use of: >=20 > CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-unknown-freebsd12.0/bin/ >=20 > END Setup notes. >=20 > The below is from adding a -v to what the .meta file showed for the = failing command. > Note the "-cc1as -triple i386-portbld-freebsd12.0" and "-target-cpu = i486" that results > from buildworld=E2=80=99s lib32 related command that tries to compile = assembly source for > powerpc. >=20 >=20 > # /usr/local/bin/clang60 -v -DCOMPAT_32BIT -mcpu=3Dpowerpc -m32 = -L/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc= .powerpc64/obj-lib32/tmp/usr/lib32 = tosysroot=3D/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/s= rc/powerpc.powerpc64/obj-lib32/tmp = -B/usr/local/powerpc64-unknown-freebsd12.0/bin = -B/usr/obj/powerpc64vtsc_x -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes = -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch = -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline = -Wnested-externs -Wredundant-decls -Wold-style-definition = -Wno-pointer-sign -Wthread-safety -Wno-empty-body -Wno-string-plus-int = -Wno-unused-const-variable -Qunused-arguments -c = /usr/src/lib/csu/powerpc/crtn.S -o crtn.ole-definition -Wno-pointer-sign = -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unus > clang version 6.0.0 = (tags/RELEASE_600/final)/usr/src/lib/csu/powerpc/crtn.S -o crtn.o > Target: i386-portbld-freebsd12.0 > Thread model: posix > InstalledDir: /usr/local/llvm60/bin > "/usr/local/llvm60/bin/clang-6.0" -cc1 -triple = i386-portbld-freebsd12.0 -E -disable-free -main-file-name crtn.S = -mrelocation-model static -mthread-model posix -mdisable-fp-elim = -masm-verbose -mconstructor-aliases -target-cpu i486 -dwarf-column-info = -debug-info-kind=3Dstandalone -dwarf-version=3D2 -debugger-tuning=3Dgdb = -v -coverage-notes-file /usr/src/crtn.gcno -resource-dir = /usr/local/llvm60/lib/clang/6.0.0 -D COMPAT_32BIT -I = /usr/src/lib/csu/common -I /usr/src/lib/libc/include -isysroot = /usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc.p= owerpc64/obj-lib32/tmp -O2 -Wsystem-headers -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes = -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch = -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline = -Wnested-externs -Wredundant-decls -Wold-style-definition = -Wno-pointer-sign -Wthread-safety -Wno-empty-body -Wno-string-plus-int = -Wno-unused-const-variable -std=3Dgnu99 -fconst-strings = -fdebug-compilation-dir /usr/src -ferror-limit 19 -fmessage-length 180 = -fobjc-runtime=3Dgnustep -fdiagnostics-show-option -vectorize-loops = -vectorize-slp -o /tmp/crtn-d80df9.s -x assembler-with-cpp = /usr/src/lib/csu/powerpc/crtn.S > clang -cc1 version 6.0.0 based upon LLVM 6.0.0 default target = x86_64-portbld-freebsd12.0 > #include "..." search starts here: > #include <...> search starts here: > /usr/src/lib/csu/common > /usr/src/lib/libc/include > /usr/local/llvm60/lib/clang/6.0.0/include > = /usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc.p= owerpc64/obj-lib32/tmp/usr/include > End of search list. > "/usr/local/llvm60/bin/clang-6.0" -cc1as -triple = i386-portbld-freebsd12.0 -filetype obj -main-file-name crtn.S = -target-cpu i486 -I /usr/src/lib/csu/common -I /usr/src/lib/libc/include = -fdebug-compilation-dir /usr/src -dwarf-debug-producer clang version = 6.0.0 (tags/RELEASE_600/final) -I /usr/src/lib/csu/common -I = /usr/src/lib/libc/include -debug-info-kind=3Dlimited -dwarf-version=3D2 = -mrelocation-model static -o crtn.o /tmp/crtn-d80df9.s > /usr/src/lib/csu/powerpc/crtn.S:29:2: warning: DWARF2 only supports = one section per compilation unit > .section .init,"ax",@progbits > ^ > /usr/src/lib/csu/powerpc/crtn.S:30:11: error: unexpected token in = memory operand > lwz 11,0(1) > ^ > /usr/src/lib/csu/powerpc/crtn.S:31:10: error: unexpected token in = memory operand > lwz 0,4(11) > ^ > /usr/src/lib/csu/powerpc/crtn.S:32:2: error: invalid instruction = mnemonic 'mtlr' > mtlr 0 > ^~~~ > . . . >=20 >=20 >=20 > It would appear that a -triple may be missing in the = /usr/local/bin/clang60 > command line that would specify the specific ABI to target. It appears = that > the -mcpu=3Dpowerpc is not enough to even get the cpu family right as = far as > what assembler notation to process. >=20 > I do not know if an appropriate -triple addition would currently be > sufficient for things to start working. >=20 > Something needs to cause the right assembler notation to be processed = for > lib32 if WITH_LIB32=3D is to be supported for cross builds. Kenneth Salerno's = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227920 is an example patch for 11.1 for this lack of -target use where it can = be needed. =3D=3D=3D Mark Millard marklmi26-fbsd at yahoo.com ( dsl-only.net went away in early 2018-Mar)