From owner-freebsd-toolchain@freebsd.org Tue Jul 17 01:46:16 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 2F646104965B for ; Tue, 17 Jul 2018 01:46:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-12.consmr.mail.ne1.yahoo.com (sonic313-12.consmr.mail.ne1.yahoo.com [66.163.185.35]) (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 AFE7B8DFAF for ; Tue, 17 Jul 2018 01:46:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: fZ8WGlcVM1k6fUW5g4R69iqDcu18ePoHe5hDyL49a2UOf_4XcPe4kBcCrvFtNkY 5xSSHKevpbA7LzcMQxfll4Z5J7r1DpvhNU9cXdbmojgalyXjDwmDMbLPGveMv7P398ckY_.95jIl 4xby.h3B5zfZ6gbaBAJOJ9uOpWowuEYUVI0ejMhQsWy5vQC.vYrPN6M4IuingETymJ6lcHwQdqrd E62Md4kulzTn3PJ_HGEnNBEuyvOsqiWOHGpalaaD8IAEDeI8qsustO6F45pKBeSUfECgaB1dFjtb .6lRYufkqpBrXoWNQXBZZDOE50mFOm9vks1DIeJsxbUbJHkrwfax4mXtaFcNSgctqfCWerTzZxlL txG3NpsATIuBaPJXluVqdNRvk1D5CIXO.ATgVI4u05pxiZ54tz6X.IAk.mgJ1HAJVjuRpU9x0Up0 vfB_Lbx4Xjy38bbqSzzr0W_V2eHTBFcLnlPrq3Zo4VSdeOMAB9teqMVNwXx_2lvJatozQW_fj7yX kHlf3_FHgZoZBxOgWwS6RBsJPVK6wVNoHZB2766HjLyT3A3pUhTGLyQwvt.upbx34.VVFR3cDX_L GwMtQRiKmvBRUBWjOiivYbWpspIGfWIyovPBt6MJR8BUASegTDwEtf7ah4ui.1TTMTsCPFlv8_7b 5ab6b0xoTx63MooN2JYtT.QskYb7tnDVpeZcwGvuXL7yOpwBsxukQ1D9dVr8b7Y_8g9_XFzWxckv 5bZCKNdRt_DMFhzxZ1rJE21eA5ZyiFSddoqBjUzBTGzOoJke.izx6VNmFPEVRdqekQwURX_IQTmW APhzWfzq4dGsacNAI7ZHj76QnzXqfUE_6_LFQhH.0KnVH4UDI1PsfLYTXml27UYFPKQwXU4G4Q3G 8eMlnGjokSi1bJwg3.W9DfEa4BJRWU0L9P8QGs9M4uzotL8vCYNndDADWANQBhenwlUPYwCKArk0 in4EsO7zMMYjHrQg49MysVvJurHxQon8JbxgMsgTiiMzc6UpVbPkBdg.Vox6UuG90pDCwfB96dA- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Tue, 17 Jul 2018 01:46:09 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp420.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID dfa1c5b26052016dc45f53d50b83c24c; Tue, 17 Jul 2018 01:46:04 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: New kernel-toolchain buildkernel problem for amd64 -> aarch64 cross build ( after -r336348 ) : ld used for addf_data only can target: elf_x86_64_fbsd elf_i386_fbsd From: Mark Millard In-Reply-To: <2A128804-82FA-4315-9FD9-F109FAF7216B@yahoo.com> Date: Mon, 16 Jul 2018 18:46:02 -0700 Cc: FreeBSD Toolchain , freebsd-arm , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: <22626F9B-4337-4C06-BB24-5BAB5AD52300@yahoo.com> References: <81184558-6b23-085b-19e3-b11569808174@FreeBSD.org> <09601A6A-C275-4B90-9A76-7C64E2CA7B32@yahoo.com> <0b5b2181-7335-325c-3e7a-f882a48fcd69@FreeBSD.org> <2A128804-82FA-4315-9FD9-F109FAF7216B@yahoo.com> To: Bryan Drewery X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2018 01:46:16 -0000 [ toolchain-metadata.mk is missing when kernel-toolchain is used. I've no clue if this is intentional or not. ] On 2018-Jul-16, at 6:13 PM, Mark Millard wrote: > On 2018-Jul-16, at 4:47 PM, Bryan Drewery = wrote: >=20 >> On 7/16/2018 3:49 PM, Mark Millard wrote: >>>=20 >>>=20 >>> On 2018-Jul-16, at 3:31 PM, Bryan Drewery = wrote: >>>=20 >>>> On 7/16/18 1:21 PM, Mark Millard wrote: >>>>> I attempted a from-scratch (. . ./arm64.aarch64/ empty) = kernel-toolchain buildkernel >>>>> targeting aarch64 from amd64 based on head -r336349 . It failed by = ending up >>>>> using an ld that can only target elf_x86_64_fbsd elf_i386_fbsd : >>>>=20 >>>> I probably extended the LLVM_TARGET_ALL=3Dno in cross-compiler too = far. I >>>> thought I had left that out for kernel-toolchain but apparently = not. >>>>=20 >>>> Try this patch and kernel-toolchain after applying please: >>>> http://people.freebsd.org/~bdrewery/patches/cross-compiler-fix.diff >>>> . . . >>>=20 >>> Result is unchanged. Details follow. >>=20 >> Ok, I'll look more tomorrow. >>=20 >>>=20 >>> With: >>>=20 >>> # svnlite diff /usr/src/Makefile.inc1 >>> Index: /usr/src/Makefile.inc1 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- /usr/src/Makefile.inc1 (revision 336349) >>> +++ /usr/src/Makefile.inc1 (working copy) >>> @@ -666,7 +666,7 @@ >>> BMAKE=3D \ >>> ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ >>> ${BSARGS} >>> -.if empty(.MAKEOVERRIDES:MMK_LLVM_TARGET_ALL) >>> +.if empty(.MAKEOVERRIDES:MMK_LLVM_TARGET_ALL) && !make(*toolchain*) >>> BMAKE+=3D MK_LLVM_TARGET_ALL=3Dno >>> .endif >>>=20 >>> used via: >>>=20 >>> # rm -fr /usr/obj/cortexA53_clang/arm64.aarch64/* >>> # = ~/sys_build_scripts.amd64-host/make_cortexA53_nodebug_clang_bootstrap-amd6= 4-host.sh -j4 kernel-toolchain buildkernel >>>=20 >>> I still get: >>>=20 >>> --- buildkernel --- >>> Building = /usr/obj/cortexA53_clang/arm64.aarch64/usr/src/arm64.aarch64/sys/GENERIC-N= ODBG/modules/usr/src/sys/modules/accf_data/accf_data.kld >>> --- accf_data.kld --- >>> ld: unrecognised emulation mode: aarch64elf >>> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd >>> *** [accf_data.kld] Error code 1 >>>=20 >>>=20 >>>=20 >>> Reminder of what my .sh script does: >>>=20 >>> # more = ~/sys_build_scripts.amd64-host/make_cortexA53_nodebug_clang_bootstrap-amd6= 4-host.sh >>> kldload -n filemon && \ >>> script = ~/sys_typescripts/typescript_make_cortexA53_nodebug_clang_bootstrap-amd64-= host-$(date +%Y-%m-%d:%H:%M:%S) \ >>> env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.cortexA53-clang-bootstrap.amd64= -host" \ >>> WITH_META_MODE=3Dyes \ >>> MAKEOBJDIRPREFIX=3D"/usr/obj/cortexA53_clang/arm64.aarch64" \ >>> make $* >>>=20 >>> (I'll not repeat the other supporting material.) >=20 > In case it helps: >=20 > # = ~/sys_build_scripts.amd64-host/make_cortexA53_nodebug_clang_bootstrap-amd6= 4-host.sh test-system-linker > Script started, output file is = /root/sys_typescripts/typescript_make_cortexA53_nodebug_clang_bootstrap-am= d64-host-2018-07-16:17:48:38 > USING_SYSTEM_LINKER =3D no > MK_SYSTEM_LINKER =3D no > MK_LLD_BOOTSTRAP =3D yes > MK_BINUTILS_BOOTSTRAP =3D no > WANT_LINKER_TYPE =3D lld > WANT_LINKER_VERSION =3D 60001 > WANT_LINKER_VERSION_FILE =3D = lib/clang/include/lld/Common/Version.inc > WANT_LINKER_FREEBSD_VERSION =3D 335540-1200003 > WANT_LINKER_FREEBSD_VERSION_FILE =3D = lib/clang/include/lld/Common/Version.inc > LD =3D ld > LINKER_TYPE =3D bfd > LINKER_FEATURES =3D filter > LINKER_VERSION =3D 21750 > LINKER_FREEBSD_VERSION =3D 0 > XLD =3D ld > X_LINKER_TYPE =3D bfd > X_LINKER_FEATURES =3D filter > X_LINKER_VERSION =3D 21750 > X_LINKER_FREEBSD_VERSION =3D 0 >=20 > Script done, output file is = /root/sys_typescripts/typescript_make_cortexA53_nodebug_clang_bootstrap-am= d64-host-2018-07-16:17:48:38 >=20 > The part after the WANT_'s looks odd to me. >=20 > (I think the above type of output would be good in ci.freebsd.org > build logs for the likes of FreeBSD-head-*-build . Similarly for > test-system-compiler output.) >=20 > I get similar oddness for a self-hosted amd64 build via my > usual .sh and src/make configuration files: >=20 > # = ~/sys_build_scripts.amd64-host/make_amd64_nodebug_clang-amd64-host.sh = test-system-linker > Script started, output file is = /root/sys_typescripts/typescript_make_amd64_nodebug_clang-amd64-host-2018-= 07-16:18:00:52 > USING_SYSTEM_LINKER =3D no > MK_SYSTEM_LINKER =3D yes > MK_LLD_BOOTSTRAP =3D yes > MK_BINUTILS_BOOTSTRAP =3D yes > WANT_LINKER_TYPE =3D lld > WANT_LINKER_VERSION =3D 60001 > WANT_LINKER_VERSION_FILE =3D = lib/clang/include/lld/Common/Version.inc > WANT_LINKER_FREEBSD_VERSION =3D 335540-1200003 > WANT_LINKER_FREEBSD_VERSION_FILE =3D = lib/clang/include/lld/Common/Version.inc > LD =3D ld > LINKER_TYPE =3D bfd > LINKER_FEATURES =3D filter > LINKER_VERSION =3D 21750 > LINKER_FREEBSD_VERSION =3D 0 > XLD =3D ld > X_LINKER_TYPE =3D bfd > X_LINKER_FEATURES =3D filter > X_LINKER_VERSION =3D 21750 > X_LINKER_FREEBSD_VERSION =3D 0 >=20 > Script done, output file is = /root/sys_typescripts/typescript_make_amd64_nodebug_clang-amd64-host-2018-= 07-16:18:00:52 >=20 >=20 > (In both contexts test-system-compiler output seemed reasonable to > me.) In looking around I find that the kernel-toolchain tree does not have a toolchain-metadata.mk : # ls -lTdt = /usr/obj/cortexA53_clang/arm64.aarch64/usr/src/arm64.aarch64/* drwxr-xr-x 7 root wheel 512 Jul 16 15:41:41 2018 = /usr/obj/cortexA53_clang/arm64.aarch64/usr/src/arm64.aarch64/tmp drwxr-xr-x 3 root wheel 512 Jul 16 15:41:41 2018 = /usr/obj/cortexA53_clang/arm64.aarch64/usr/src/arm64.aarch64/sys (Of course the build failed and so did not execute everything.) The buildworld based ones do have such files. For example, the amd64 self-hosted build that used buildworld has: # more = /usr/obj/amd64_clang/amd64.amd64/usr/src/amd64.amd64/toolchain-metadata.mk= .info Using cached toolchain metadata from build at FBSDUSSD on Mon Jul = 16 11:49:07 PDT 2018 _LOADED_TOOLCHAIN_METADATA=3Dt COMPILER_VERSION=3D60001 X_COMPILER_VERSION=3D60001 COMPILER_TYPE=3Dclang X_COMPILER_TYPE=3Dclang COMPILER_FEATURES=3D c++11 retpoline X_COMPILER_FEATURES=3D c++11 retpoline COMPILER_FREEBSD_VERSION=3D1200015 X_COMPILER_FREEBSD_VERSION=3D1200015 LINKER_VERSION=3D60001 X_LINKER_VERSION=3D60001 LINKER_FEATURES=3D build-id ifunc filter retpoline X_LINKER_FEATURES=3D build-id ifunc filter retpoline LINKER_TYPE=3Dlld X_LINKER_TYPE=3Dlld LINKER_FREEBSD_VERSION=3D335540-1200003 X_LINKER_FREEBSD_VERSION=3D335540-1200003 .export COMPILER_VERSION COMPILER_TYPE COMPILER_FEATURES = COMPILER_FREEBSD_VERSION LINKER_VERSION LINKER_FEATURES LINKER_TYPE = LINKER_FREEBSD_VERSION .export X_COMPILER_VERSION X_COMPILER_TYPE X_COMPILER_FEATURES = X_COMPILER_FREEBSD_VERSION X_LINKER_VERSION X_LINKER_FEATURES = X_LINKER_TYPE X_LINKER_FREEBSD_VERSION (This is despite what test-system-linker showed for that tree.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)