From nobody Fri Jul 16 20:41:45 2021 X-Original-To: freebsd-toolchain@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 516CD12A7884 for ; Fri, 16 Jul 2021 20:41:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-55.consmr.mail.gq1.yahoo.com (sonic316-55.consmr.mail.gq1.yahoo.com [98.137.69.31]) (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 4GRNSs13m3z4rZh for ; Fri, 16 Jul 2021 20:41:48 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626468107; bh=Om7GHGSuwb2irbRbiPVnqfbptUXWBirSPmp+tH0d7FY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=b7XoxKxAoe49ErDCtRGl6Vw/WAV6A+ab8XnaPevgm7bpULEQipjhNqJLPE5CujQ8AXptYxqO38z7IRhLfalbGFVP77lrXnwaOnRcctjXYxrnWLoVsrdZN3/1LELnNT4JyZ31YQ8hjt8uPyoYAjCtk5vy7I3laH0XuyVkinlMkC6mEqNiiTr121sX8o5/1dZs0SJqIXdpAMS+513TPxYpr6z6r46EB/PuRaQOsLwga5e/k0O3oTKzcSaPz54aZrzZRwi/zo2eZm3VKKm6egwFOyFzJrSzba6qJ2pWXdN/mXyi37SUNVqd2zg7CKwv1TXliz4JJ850osHksnYQzyZzzg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626468107; bh=gESBH/8KS2NGrHaThdu+ubV6ewMDVeWjzmKGgouOZDx=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=l4hOe0nxkAws46DnVrPG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zIWXRQ4n9k3pZpNpzdIOlwjhTleoNsMheuPD_o445St6d3FhHKk.i9XcAP xHCi0hMWY13qs7S8O4x8i_KpROqB.Xwgw2jGuBc2jGjsCr3sV_KnSoc8QPjj_xMP5CPM_5Q2dJW4 TXSkWQ0HTMGelNtdPjf11dHNPfkn.Gp9U_rqECzwTKF8QRODAuLor5CsZMi2KR9F3LolPdxjP0Zc _t_rKa3q8Gf.gyT3kP60AJqLyIyWNVpPckaNV_KBwjlAcTXsvreSGSVXK0eSLyHuTtw9sFkEBW2L o8yj2jtujRoLwrh2.NK7xXIWeQ5Z8Lq5jknc__SYC.p6p7p28L.cJ7Zy8DtDdqWNb_aZqLQ9U2O3 .l5.jHpp5CwOtcl4IHarLo_crdQwMF_Ub384axYkF3INEYM4Gq0Z4uNw7.hhSpW1v_CTmpg0oXjg .iHG5LMxMGE9CYWxiLKJsGOHna1OXjd1JzXQl2eLX6eDM2ZpgWI.YkibH573R1.jA1CZdcsddpQ1 QXSzQ1jvpniDlufoOLzKpYV8RVPygKZ7BdD_c_eudyXlgIdJ6KobDkR_8PB7BFeGPh7rXDJ35cuQ Tip5WLYRJRB2GDclsbi5bbxCOTxMAoOzJre5aQiKUuxd5kxOUmv5ftaHoC_9IIHwhVib_nmrVsRL lAwocm8t1k1Uyg6MlO94PNHOKBT0.YUE9QnLyFu.OgXJcUGTJt6xVHNta31v8FqDx8FqsdjzmJ0e urMPmhoFy4bGJuczWwoRX8EDLuyAxqYwFhDl.F6KC0EwSA4kbxI4IZFwVXdP1dsqENMZpbhV6Azo YTOJ945DDJuFfUtusyAmc4H6iOv1i X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Fri, 16 Jul 2021 20:41:47 +0000 Received: by kubenode548.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 36a6ff27b0050b6396067a0887ffb64c; Fri, 16 Jul 2021 20:41:46 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Maintenance List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: Why is main's system clang (12.0.1-rc2) using /usr/local/bin/aarch64-unknown-freebsd14.0-ld ? (such breaks things) In-Reply-To: Date: Fri, 16 Jul 2021 13:41:45 -0700 Cc: FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: References: <7073D16F-4505-4948-8232-A9618DF2FE5F.ref@yahoo.com> <7073D16F-4505-4948-8232-A9618DF2FE5F@yahoo.com> <77803112-7C05-40EA-9A46-8A5EB419950C@FreeBSD.org> <3B5C7A3A-344F-4CC7-A50D-56E391D04E59@yahoo.com> To: Dimitry Andric X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GRNSs13m3z4rZh X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=b7XoxKxA; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.31 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-1.73 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.69.31:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.77)[0.772]; SPAMHAUS_ZRD(0.00)[98.137.69.31:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.31:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.31:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-toolchain] Reply-To: marklmi@yahoo.com From: Mark Millard via freebsd-toolchain X-Original-From: Mark Millard X-ThisMailContainsUnwantedMimeParts: N On 2021-Jul-16, at 11:26, Mark Millard wrote: > On 2021-Jul-16, at 04:15, Mark Millard wrote: >=20 >> On 2021-Jul-16, at 03:23, Dimitry Andric wrote: >>=20 >>> On 16 Jul 2021, at 02:21, Mark Millard via freebsd-toolchain = wrote: >>>> # c++ -v -o trivial trivial.cpp >>>> FreeBSD clang version 12.0.1 (git@github.com:llvm/llvm-project.git = llvmorg-12.0.1-rc2-0-ge7dac564cd0e) >>>> Target: aarch64-unknown-freebsd14.0 >>>> Thread model: posix >>>> InstalledDir: /usr/bin >>>> "/usr/bin/c++" -cc1 -triple aarch64-unknown-freebsd14.0 -emit-obj = -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier = -discard-value-names -main-file-name trivial.cpp -mrelocation-model = static -mframe-pointer=3Dnon-leaf -fno-rounding-math = -mconstructor-aliases -munwind-tables -target-cpu generic = -target-feature +neon -target-abi aapcs = -fallow-half-arguments-and-returns -fno-split-dwarf-inlining = -debugger-tuning=3Dgdb -v -resource-dir /usr/lib/clang/12.0.1 = -internal-isystem /usr/include/c++/v1 -fdeprecated-macro = -fdebug-compilation-dir /usr/home/root/c_tests -ferror-limit 19 = -fno-signed-char -fgnuc-version=3D4.2.1 -fcxx-exceptions -fexceptions = -faddrsig -o /tmp/trivial-5d90b5.o -x c++ trivial.cpp >>>> clang -cc1 version 12.0.1 based upon LLVM 12.0.1 default target = aarch64-unknown-freebsd14.0 >>>> #include "..." search starts here: >>>> #include <...> search starts here: >>>> /usr/include/c++/v1 >>>> /usr/lib/clang/12.0.1/include >>>> /usr/include >>>> End of search list. >>>> "/usr/local/bin/aarch64-unknown-freebsd14.0-ld" --eh-frame-hdr = -dynamic-linker /libexec/ld-elf.so.1 --enable-new-dtags -o trivial = /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib = /tmp/trivial-5d90b5.o -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed = -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o = /usr/lib/crtn.o >>>=20 >>> Yes, this is an unfortunate (and sometimes unwanted) side effect of = the >>> way the clang driver searches for its linker(s). It prefers "target >>> specific executables" (meaning, those beginning with the target = triple) >>> above generic executables, when searching for linkers, assemblers = and >>> other external tools. >>=20 >> As far as I know the /usr/bin/clang++ related FreeBSD >> toolchain never has a file aarch64-unknown-freebsd14.0-ld >> in FreeBSD. (And similarly fr other suffices than ld.) >>=20 >> In other words, why is aarch64-unknown-freebsd14.0-ld >> even listed in TargetSpecificExecutables for the system >> toolchain's clang++ ? >>=20 >> I would argue that the default FreeBSD system toolchain >> configuration/operation should be adjusted/patched to not >> have automatic defaults that cause parts of that toolchain >> to not be used even though they are present, just because >> some unrelated/independent port(s) have been installed that >> are a different toolchain. (Explicitly enabling/allowing >> alternate matches may well be reasonable.) >>=20 >> As far as I know, there is no guarantee of compatibility >> with the gcc/g++/gnu related toolchain, with the error >> message that I reported being an example for attempted >> -flto use. >>=20 >>> See the Driver::GetProgramPath() function: >>> = https://github.com/llvm/llvm-project/blob/release/12.x/clang/lib/Driver/Dr= iver.cpp#L4981 >>=20 >> It looks like if there was an implcit/automatic -B /usr/bin >> when /usr/bin/clang++ is the native FreeBSD toolchain one, >> that the problem would be avoided. >>=20 >> But, as, stands, that has to be done explicitly on the >> command lines in order to tell clang++ to use its own >> related FreeBSD toolchain instead of using one from >> ports. >>=20 >>> In short, if it finds aarch64-unknown-freebsd14.0-$TOOL in your = PATH, it >>> will prefer that over $TOOL, even if the 'naked' $TOOL would be = found in >>> an earlier PATH component. >>>=20 >>> For programs like ld, as and such, these will be found if you = install >>> the devel/binutils port with an arch-specific FLAVOR. In this case, = I >>> assume this was because you installed a CROSS_TOOLCHAIN package such = as >>> freebsd9-gcc, or directly installed the aarch64-binutils package? >>=20 >> # pkg which /usr/local/bin/aarch64-unknown-freebsd14.0-ld >> /usr/local/bin/aarch64-unknown-freebsd14.0-ld was installed by = package aarch64-binutils-2.33.1_4,1 >>=20 >> # pkg delete aarch64-binutils >> Checking integrity... done (0 conflicting) >> Deinstallation has been requested for the following 3 packages (of 0 = packages in the universe): >>=20 >> Installed packages to be REMOVED: >> aarch64-binutils: 2.33.1_4,1 >> aarch64-gcc6: 6.5.0_3 >> aarch64-gcc9: 9.3.0_1 >>=20 >> Number of packages to be removed: 3 >>=20 >> The operation will free 278 MiB. >>=20 >> Proceed with deinstalling packages? [y/N]: N >>=20 >> So /usr/local/bin/aarch64-unknown-freebsd14.0-ld >> exists because I built and installed: >>=20 >> devel/freebsd-gcc6@aarch64 >> devel/freebsd-gcc9@aarch64 >> devel/binutils@aarch64 >>=20 >>> Note that the native binutils package does not cause these problems, >>> since it prefixes its tools with $arch-portbld-freebsd14.0. E.g., = the >>> 'vendor' field of the triple is set to "portbld", not "unknown". >>>=20 >>> I guess the flavored binutils packages do use the "unknown" vendor = field >>> to avoid installation conflicts. But at some point this should be >>> resolved: either all binutils ports should use the "portbld" vendor, = or >>> all of them should use "unknown", but this mixing is causing = trouble, in >>> my opinion. >>=20 >> It has been all portbld at times in the past. That mix is also a >> problem. 3 distinct naming structures are needed, not just 2, in >> order to prevent mixing from occurring without some form of >> explicit request for a mix. >=20 > Another command line way to potentially control this might be > use of: -fuse-ld=3Dlld >=20 > That might change the name looked for to: = aarch64-unknown-freebsd14.0-lld > and not match any existing toolchains. >=20 I've confirmed the -fuse-ld=3Dlld workaround and using it when -flto is involved allows a build to complete instead of getting the earlier-reported error. This avoid fiddling with the path sequence via -B so I prefer it over -B . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)