From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 096CA3858D20; Mon, 29 Jan 2024 05:38:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 096CA3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706506695; bh=Bh51MpWF0KjJCw3FhtbPGHmEaz5enwzRHyV5BwzQl6k=; h=From:To:Subject:Date:From; b=hDFYVhm1MNDN/nCGqsRhTsrz6MB4sFz6bgII5KmMI5zg4FWZDdxfwap3bSZyHkujs kb8ydM7a2Zm/NP6pEMncXQ7Dgo9BzqhSS6MLofIS85BPwLg0Wd8Fl1+FtB9afNmYT5 hMelLxpdDlRu8RRG6DH5D/MVqTYYH0Avy+oOHmgM= From: "galaxyking0419 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113648] New: Cross compiler cannot find cross binutils on macOS Date: Mon, 29 Jan 2024 05:38:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: galaxyking0419 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113648 Bug ID: 113648 Summary: Cross compiler cannot find cross binutils on macOS Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: galaxyking0419 at gmail dot com Target Milestone: --- According to https://gcc.gnu.org/install/configure.html, the gcc should find binutils components (e.g., as, ld, objdump) using rule: - Unless GCC is being built with a cross compiler, check the libexec/gcc/target/version directory. libexec defaults to exec-prefix/libex= ec; exec-prefix defaults to prefix, which defaults to /usr/local unless overrid= den by the --prefix=3Dpathname switch described above. target is the target sys= tem triple, such as =E2=80=98sparc-sun-solaris2.11=E2=80=99, and version denote= s the GCC version, such as 3.0. If the target system is the same that you are building on, che= ck operating system specific directories. - Check in the PATH for a tool whose name is prefixed by the target system triple. - Check in the PATH for a tool whose name is not prefixed by the target sys= tem triple, if the host and target system triple are the same (in other words, = we use a host tool if it can be used for the target as well). My setup following the target system triple convention: [u@mbp d]% whereis aarch64-linux-gnu-ld aarch64-linux-gnu-ld: /Volumes/Toolchain/openwrt/bin/aarch64-linux-gnu-ld But the aarch64-linux-gnu-gcc still picks the macOS as, ld etc: [u@mbp d]% aarch64-linux-gnu-gcc -print-prog-name=3Dld ld [u@mbp d]% aarch64-linux-gnu-gcc -print-prog-name=3Das as [u@mbp d]% aarch64-linux-gnu-gcc -print-prog-name=3Dobjdump objdump GCC configuration: Using built-in specs. COLLECT_GCC=3Daarch64-linux-gnu-gcc COLLECT_LTO_WRAPPER=3D/Volumes/Toolchain/openwrt/lib/gcc/aarch64-linux-gnu/= 13.2.0/lto-wrapper Target: aarch64-linux-gnu Configured with: ../gcc-13.2.0/configure --disable-libgomp --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-multilib --disable-nls --disable-werror --enable-__cxa_atexit --enable-checking=3Dre= lease --enable-clocale=3Dgnu --enable-default-pie --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-languages=3D= c,c++ --enable-lto --enable-shared --enable-threads=3Dposix --libexecdir=3D/Volumes/Toolchain/openwrt/lib --prefix=3D/Volumes/Toolchain= /openwrt --program-prefix=3Daarch64-linux-gnu- --target=3Daarch64-linux-gnu --with-build-sysroot=3D/Volumes/Toolchain/openwrt/aarch64-linux-gnu --with-cpu=3Dcortex-a53+crypto --with-glibc-version=3D2.38 --with-gmp=3D/op= t/homebrew --with-mpc=3D/opt/homebrew --with-mpfr=3D/opt/homebrew --with-local-prefix=3D/Volumes/Toolchain/openwrt/aarch64-linux-gnu --with-sysroot=3D/Volumes/Toolchain/openwrt/aarch64-linux-gnu --with-system= -zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.2.0 (GCC)=