From owner-freebsd-toolchain@freebsd.org Thu Nov 9 08:29:36 2017 Return-Path: Delivered-To: freebsd-toolchain@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 E2DBEE6EBE1 for ; Thu, 9 Nov 2017 08:29:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 C44427D3ED for ; Thu, 9 Nov 2017 08:29:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vA98Tadp087132 for ; Thu, 9 Nov 2017 08:29:36 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-toolchain@FreeBSD.org Subject: [Bug 223551] for external toolchain support, X prefix is not setting build utils for make buildworld Date: Thu, 09 Nov 2017 08:29:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 08:29:37 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223551 Mark Millard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markmi@dsl-only.net --- Comment #1 from Mark Millard --- (In reply to sid from comment #0) I expect that there is a misinterpretation of the https://wiki.freebsd.org/ExternalToolchain wording. (Easily done.) I think that https://wiki.freebsd.org/ExternalToolchain does not well indicate what context it material applies in vs. what context is does not: XCC, XCXX, XCPP, XAS, etc. do not replace all uses of CC, CPP, AS, etc. in all contexts. The description: The XCC approach works with top level build targets (buildworld, buildkerne= l, etc) and overrides common make variables such as CC, CXX, and AS during the cross building portions of the build with values specified by the XCC, XCPP, XAS, etc variables. (end description) sounds like all uses of CC, CXX, AS, and the like are replaced --but that is wrong and would not work for cross-builds. For example, for amd64 -> aarch64 (cortex-A53) cross builds I've used one compiler as the "for host" CC/CXX/CPP and another compiler and its tool chain as the "cross compiler to target" XCC/XCPP/. . . for a cross build context. The cross-compiler tools can not be used for everything because some host software is also built for later use in the overall buildworld that is happening on the host. Some recursive makes replace uses of CC/CXX/CPP and the like with uses of XCC/XCXX/XCPP (for example). But other make activity uses the original definitions above (or the defaults for what is not specified). I've even done examples of a gcc host compiler (and its toolchain) and a separate gcc cross compiler (and its tool chain), avoiding the system compiler for both aspects. That is a type of example where things have to start with CC/CXX/CPP/. . . vs. XCC/XCXX/XCPP/. . . being distinct and the initial CC/CXX/CPP/. . . do have to be used but are not the default (system compiler tied). [devel/*-xtolchain-gcc's are not setup for this fully automatically: they are only the cross-compiler/toolchain part of it.] I'll supply one example for a cross-build that has both CC/CXX/CPP and XCC/XCXX/XCPP/XAS/. . . assignments and needs the distinctions: (The example is for 12.0 but I've done such 11.x and for 10.x in the past. This does use the system compiler/toolchain as the host-targetting compiler/toolchain.) # more ~/src.configs/src.conf.cortexA53-xtoolchain-gcc.amd64-host TO_TYPE=3Daarch64 TOOLS_TO_TYPE=3D${TO_TYPE} VERSION_CONTEXT=3D12.0 # KERNCONF=3DGENERIC-NODBG TARGET=3Darm64 .if ${.MAKE.LEVEL} =3D=3D 0 TARGET_ARCH=3D${TO_TYPE} .export TARGET_ARCH .endif # WITHOUT_CROSS_COMPILER=3D WITHOUT_SYSTEM_COMPILER=3D # WITH_LIBCPLUSPLUS=3D WITHOUT_BINUTILS_BOOTSTRAP=3D WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=3D WITHOUT_CLANG_BOOTSTRAP=3D WITH_CLANG=3D WITH_CLANG_IS_CC=3D WITH_CLANG_FULL=3D WITH_CLANG_EXTRAS=3D WITHOUT_LLD_BOOTSTRAP=3D WITH_LLD=3D WITH_LLD_IS_LD=3D WITH_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_REPRODUCIBLE_BUILD=3D WITH_DEBUG_FILES=3D # XCFLAGS+=3D -mcpu=3Dcortex-a53 XCXXFLAGS+=3D -mcpu=3Dcortex-a53 # There is no XCPPFLAGS but XCPP gets XCFLAGS content. # # # For TO (so-called "cross") stages . . . # So-called-cross via ${TO_TYPE}-xtoolchain-gcc/${TO_TYPE}-gcc. . . # TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related binutils. . . # CROSS_TOOLCHAIN=3D${TO_TYPE}-gcc X_COMPILER_TYPE=3Dgcc CROSS_BINUTILS_PREFIX=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ .if ${.MAKE.LEVEL} =3D=3D 0 XCC=3D/usr/local/bin/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}-gcc XCXX=3D/usr/local/bin/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}-g++ XCPP=3D/usr/local/bin/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}-cpp .export XCC .export XCXX .export XCPP XAS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/as XAR=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ar XLD=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ld XNM=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/nm XOBJCOPY=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objcopy XOBJDUMP=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objdump XRANLIB=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ranlib XSIZE=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/size #NO-SUCH: XSTRINGS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/strings XSTRINGS=3D/usr/local/bin/${TOOLS_TO_TYPE}-freebsd-strings .export XAS .export XAR .export XLD .export XNM .export XOBJCOPY .export XOBJDUMP .export XRANLIB .export XSIZE .export XSTRINGS .endif # # # From based on clang (via system). . . # .if ${.MAKE.LEVEL} =3D=3D 0 CC=3D/usr/bin/clang CXX=3D/usr/bin/clang++ CPP=3D/usr/bin/clang-cpp .export CC .export CXX .export CPP .endif (In some respects the above is explicit about some things that each devel/*-xtoolchain-gcc sets up to do automatically.) So ultimately I think the specifics of any example of a possible bad substitution need to be reported, including the inputs (such as the above), the actual invocation of make, and the bad commands that resulted during a build. With that much context things can be checked and which parts are messed up identified. The submittal is far to generic to identify anything specific that might be wrong. I'll note that I use this stuff extensively for amd64, powerpc64, powerpc, aarc64, and armv7 and cross building amd64 -> (each of the other 4). It seems to work correctly for me and last I tried it devel/*-xtoolchain-gcc based builds were working (and they use this stuff too, but presume the system-compiler for the host targeting part of buildworld). I started doing such things before the devel/*-xtoolchain-gcc's were put in place. --=20 You are receiving this mail because: You are the assignee for the bug.=