Opened 11 months ago

Last modified 9 days ago

#68870 assigned defect

arm-none-eabi-gdb wants to build for x86_64 on Apple Silicon

Reported by: jmalcaide (Jose M. Alcaide) Owned by: judaew (Vadym-Valdis Yudaiev)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: sonoma arm64 Cc:
Port: arm-none-eabi-gdb

Description

It seems that the arm-none-eabi-gdb port is ignoring build_arch. This is what happens when trying to build that port on an Apple Silicon-based Mac (from Terminal.app):

% sudo port install arm-none-eabi-gdb
Error: Cannot install arm-none-eabi-gdb for the arch 'x86_64' because
Error: its dependency arm-none-eabi-gcc is only installed for the arch 'arm64'
Error: and does not have a universal variant.
Error: Unable to execute port: architecture mismatch

Here is my list of installed ports:

% port -v installed
The following ports are currently installed:
  arm-none-eabi-binutils @2.41_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T22:18:17+0100'
  arm-none-eabi-gcc @13.2.0_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T16:06:33+0100'
  db48 @4.8.30_5 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:26:03+0100'
  gdbm @1.23_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:26:26+0100'
  gettext @0.21.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T22:00:54+0100'
  gettext-runtime @0.21.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:56:30+0100'
  gettext-tools-libs @0.21.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:59:03+0100'
  gmp @6.3.0_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:25:26+0100'
  help2man @1.49.3_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:29:32+0100'
  isl @0.24_1 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:25:43+0100'
  libiconv @1.17_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:55:57+0100'
  libmpc @1.3.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:27:00+0100'
  libtextstyle @0.21.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:57:06+0100'
  lz4 @1.9.4_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:27:05+0100'
  mpfr @4.2.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:26:52+0100'
  ncurses @6.4_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:54:03+0100'
  nethack @3.6.7_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:54:31+0100'
  p5.34-locale-gettext @1.70.0_1 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:29:29+0100'
  perl5.34 @5.34.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:29:20+0100'
  readline @8.2.001_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:26:17+0100'
  texinfo @7.1_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T14:30:30+0100'
  unrar @6.2.12_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T21:53:16+0100'
  xz @5.4.5_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:25:59+0100'
  zlib @1.3_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-11-30T22:07:41+0100'
  zstd @1.5.5_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-12-10T13:27:24+0100'

I am using the default macports.conf and I don't have a ~/.macports directory.

Change History (3)

comment:1 in reply to:  description Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to judaew
Status: newassigned

Replying to jmalcaide:

It seems that the arm-none-eabi-gdb port is ignoring build_arch.

It isn't; this is working as intended. The arm-none-eabi-gdb portfile includes the crossgdb portgroup which contains the lines:

        # gdb is not supported on macOS ARM now
        # See https://inbox.sourceware.org/gdb/3185c3b8-8a91-4beb-a5d5-9db6afb93713@Spark
        supported_archs x86_64 i386

comment:2 Changed 11 months ago by jmalcaide (Jose M. Alcaide)

I think that the error message is very misleading. Firts, it says that arm-none-eabi-gdb was being installed for X86-64 (I never intended that). Secondly, it states that the reason for failing is that the dependency arm-none-eabi-gcc has been installed for arm64; however, the real reason is that arm-none-eabi-gdb does not support building for arm64, because it is not listed as a supported architecture by the crossdb portgroup.

Anyway, I don't understand why arm-none-eabi-gdb cannot be built for arm64. In my case, I intend to use this port for cross-debugging programs running on a BBC micro:bit microcontroller board connected to my Mac via USB, and using PyOCD for communication with the onboard debugger. These programs are being cross-compiled, cross-assembled and cross-linked using arm-none-eabi-gcc and arm-none-eabi-binutils. The executbale so generated is converted using objdump from ELF to bin formats. The architecture of the host computer (the Mac) is completely irrelevant for all this to work. In fact, I installed the complete toolchain (including arm-none-eabi-gdb) using Homebrew and it works perfectly.

Version 0, edited 11 months ago by jmalcaide (Jose M. Alcaide) (next)

comment:3 Changed 9 days ago by sectroyer

+1

Note: See TracTickets for help on using tickets.