public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "galaxyking0419 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-113648-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113648

            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/libexec;
exec-prefix defaults to prefix, which defaults to /usr/local unless overridden
by the --prefix=pathname switch described above. target is the target system
triple, such as ‘sparc-sun-solaris2.11’, and version denotes the GCC version,
such as 3.0. If the target system is the same that you are building on, check
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 system
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=ld
ld
[u@mbp d]% aarch64-linux-gnu-gcc -print-prog-name=as
as
[u@mbp d]% aarch64-linux-gnu-gcc -print-prog-name=objdump
objdump

GCC configuration:
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/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=release
--enable-clocale=gnu --enable-default-pie --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-languages=c,c++
--enable-lto --enable-shared --enable-threads=posix
--libexecdir=/Volumes/Toolchain/openwrt/lib --prefix=/Volumes/Toolchain/openwrt
--program-prefix=aarch64-linux-gnu- --target=aarch64-linux-gnu
--with-build-sysroot=/Volumes/Toolchain/openwrt/aarch64-linux-gnu
--with-cpu=cortex-a53+crypto --with-glibc-version=2.38 --with-gmp=/opt/homebrew
--with-mpc=/opt/homebrew --with-mpfr=/opt/homebrew
--with-local-prefix=/Volumes/Toolchain/openwrt/aarch64-linux-gnu
--with-sysroot=/Volumes/Toolchain/openwrt/aarch64-linux-gnu --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (GCC)

             reply	other threads:[~2024-01-29  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29  5:38 galaxyking0419 at gmail dot com [this message]
2024-01-29  5:53 ` [Bug target/113648] " pinskia at gcc dot gnu.org
2024-01-29  6:46 ` galaxyking0419 at gmail dot com
2024-01-29  8:47 ` schwab@linux-m68k.org
2024-01-29  8:50 ` schwab@linux-m68k.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113648-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).