From nobody Fri Jul 16 07:53:48 2021 X-Original-To: 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 65C368D73E3 for ; Fri, 16 Jul 2021 07:53:57 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-54.consmr.mail.gq1.yahoo.com (sonic307-54.consmr.mail.gq1.yahoo.com [98.137.64.30]) (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 4GR3Qs0Xy2z3kdk for ; Fri, 16 Jul 2021 07:53:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626422032; bh=pmzhd7BEimcdDbTKKvscIYwMUG8dNZQ5pZRP9y06KpU=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=Iqu5mhIcyqSR0kMxuoSktpTiH+Tuca7WheLKc4OY5kku/7ekEU6+5oyhGVOI3SeRIkmr14QSVxAd6SvdKa7ENiaml9phIzdRi47F4uKa7xviQZIAieAPGqRCt4DiZFbdt412yCiW7YLLfgBiI2jcov3r0yYmQIy9pbkMMPuhsLoFaJuLd4M2xjFiIaS0p/dGVftSkzhA+gDWBnnWorEidG6w5lS4D3De1zhNE8QdfgZvQ1r1Gzg6wJdSgKmJh5/Crgqe+KDdQj7DOXQ5qQUtvlwz1jd0RNCmAOUeYoFrKcYRLqvt3dHzQKLTajv5d/uPS1I0Rj2K6ATHSTwvxOwx3Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626422032; bh=18E64y68IZpTYJEpT7LqlEp+++zveBqhe632zCzB4ga=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=W/y8fVhVmuA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_ZJlV n8dQa.QqpRIvc5_5kBm.CbFEt0zyhnGVkLSx4tIf3TxMTRkKQ.DjJpO6TKWUow7Nb.t5NNZKcSFf en7j6kqnzdK5zwWSLkILkWTGSdHUWRCl1KbIP3z.3k0UgSWV.RccuEB1ujrjVm463GNpkaS2Ko_j 0FQw7cixscIbdGnNY0LUA.4UUXkSGWOJ26i1hk2JevEe.dzFrtUndeFOEiUP4Bi1Xn._RrXHlMkP pb67jahaPe5RJYFi5CI.bPpZwMrjgr1E0HF9TIpBgbRVxH59qR6RML5KFlGjgV7oG.RFUEvo_kxz sLv6GqyDihaPMV3fSOdz5ua8Dyo6JlkTuK5Nrfz_U43mk.u02iw9IOD4brw7g9dtyhRu6Ig5Fb9z XB9ji5aOVoWP08kNK7bcFRrDR1YwRcjvWCqtjIkVh_4am1XzKqyadNM58LM0syUzw6XCk4rG3VNF cQU_vj_nrFKLLHMVvQmqU4XaGmIP_Q2KlCq4xsSmsWe_sROVQqTLCaHTFPAt.LmRV6BiTq2P5Ip3 wnXidRWC0a6QY6LN7WkMy7mb29qHNNuFzBDNsXYHUKtNiyxnplSq8.yu3KalmcTxdb9OzBTLErWZ hJPd6vTg4LUVqHKez3DuV2R33W48F25YQo5bs45AqRRy6prHVgYF.QY9AdI_f9ul09Z8JKowo5IP HlQyfwbKeaRAocYLZ87Yro2q.s5fGIqc6_1JVquXTJqj1y_peYijlye1gp_1u45g7lCp5F_dW.0Y kyAEWaL8snyGTp6Ii0yFPIUapNHqOZjUDj7cXEDlij2YBCzVmh1dpz4K2enM- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Fri, 16 Jul 2021 07:53:52 +0000 Received: by kubenode518.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID b205681f077a119e251175413bab1381; Fri, 16 Jul 2021 07:53:48 +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 00:53:48 -0700 Cc: toolchain@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9AD00B4C-8DED-4D35-9813-03FA8429DAFC@yahoo.com> References: <7073D16F-4505-4948-8232-A9618DF2FE5F.ref@yahoo.com> <7073D16F-4505-4948-8232-A9618DF2FE5F@yahoo.com> To: David Chisnall X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GR3Qs0Xy2z3kdk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: marklmi@yahoo.com From: Mark Millard via toolchain X-Original-From: Mark Millard X-ThisMailContainsUnwantedMimeParts: N On 2021-Jul-16, at 00:42, David Chisnall = wrote: > On 16/07/2021 01:21, Mark Millard via freebsd-toolchain wrote: >> Context: >> # uname -apKU >> FreeBSD CA72_16Gp_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #10 = main-n247756-348c41d1815d-dirty: Mon Jul 5 10:23:55 PDT 2021 = root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm6= 4.aarch64/sys/GENERIC-NODBG-CA72 arm64 aarch64 1400025 1400025 >> Showing a trivial example . . . >> # cat trivial.cpp >> // # c++ -v -o trival trivial.cpp >> int main() { >> } >> # c++ -v >> 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 >> # 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 >> CA72_16Gp_ZFS# c++ -v >> 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 >> Note the "/usr/local/bin/aarch64-unknown-freebsd14.0-ld" path >> for ld. >> I've an example where this usage leads to: >> /usr/local/bin/aarch64-unknown-freebsd14.0-ld: = /usr/bin/../lib/LLVMgold.so: error loading plugin: Cannot open = "/usr/bin/../lib/LLVMgold.so" >> clang++: error: linker command failed with exit code 1 (use -v to see = invocation) >=20 > This is the documented behaviour for clang when cross-compiling. The host is aarch64 and the target is aarch64 and the command was: # c++ -v -o trivial trivial.cpp So: no cross compile is involved. > You can specify a target in one of two ways with clang: >=20 > - Via the -target flag. Not used in the command line reported for the trivial example: # c++ -v -o trivial trivial.cpp > - By invoking clang with a symlink named {target}-clang[++] Also not involved. > Clang will look for all of the tools in your path (or in the tree = specified with -B if you provide an alternative location for tools). # echo $PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/roo= t/bin No -B in: # c++ -v -o trivial trivial.cpp > If clang finds {target}-{tool name} then it will invoke this in = preference to {tool name}. This avoids situations where, for example, = your system ld is BFD ld (or any other linker that doesn't support = cross-linking) and you are cross compiling. I'm not cross compiling. > In general, if you are cross building anything and not specifying = --sysroot (to tell it where to find headers and libraries for the = target) and -B (to tell it where to find tools) then you are probably = doing something wrong. >=20 I'm not cross compiling. I've no clue why the linker name it is looking for is: aarch64-unknown-freebsd14.0-ld : seems wrong to me when not corss compiling. But: # find / -name aarch64-unknown-freebsd14.0-ld -print | more /usr/local/bin/aarch64-unknown-freebsd14.0-ld So: it did find the only instance of what it looked for. It just looked for the wrong thing. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)