jinxin
jinxin

Reputation: 41

gdb: no bottle available-gdb install

I'm trying to install gdb command on my (M1) Mac OS 11.5.2, but I got brew error "gdb: no bottle available!"

I use brew install gdb here's the output:

Error: gdb: no bottle available!
You can try to install from source with:
  brew install --build-from-source gdb
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

I try to use brew install --build-from-source gdb here's the output:

==> Downloading https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz
Already downloaded: /Users/XX/Library/Caches/Homebrew/downloads/3b9f42b326145a6a827e12965049f662e7fa6b9687d9263219c87418d4f8835d--gdb-10.2.tar.xz
==> ../configure --enable-targets=all --prefix=/opt/homebrew/Cellar/gdb/10.2 --disable-debug --disable-dependency-tracking --with-lzma --w
==> make
==> make install-gdb maybe-install-gdbserver
Error: Empty installation

Here's my brew config output:

HOMEBREW_VERSION: 3.2.8
ORIGIN: https://mirrors.ustc.edu.cn/brew.git
HEAD: f026dd21c195952747395ebdda24327204f012ec
Last commit: 5 days ago
Core tap ORIGIN: https://mirrors.ustc.edu.cn/homebrew-core.git
Core tap HEAD: d91b62c128523ef6fb6dcf7b227071a8a2b561c0
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0.5 build 1205
Git: 2.30.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.5.2-arm64
CLT: 12.5.1.0.1.1623191612
Xcode: N/A
Rosetta 2: false

I don't know how to slove it. Please help me if you know the answer.

Upvotes: 4

Views: 6223

Answers (3)

Peng
Peng

Reputation: 91

I can use gdb on Ubuntu(arm64) by using multipass. Maybe you can have a try~

Upvotes: 0

Sainnhe Park
Sainnhe Park

Reputation: 11

If you are using Lima which is something like "macOS subsystem for Linux", you can install a native arm gdb on a linux distro, but this requires recompile the code on linux.

Upvotes: 1

Simba
Simba

Reputation: 27738

You just can't build gdb a native arm64 package. It's not supported.

Quote from Apple Silicon support in Homebrew

We now have a majority of our formulas bottled for Apple Silicon: 70%. However, not all software is ready for ARM processors on macOS, and since we ship what upstream releases, there will be some formulas that take a long time to be fixed, have a new release… and some which will never support ARM.

Our level of support is this: Homebrew strives to ship ARM bottles for software that does support ARM. We can't fix every software that's out there, and we won't accept feature requests like “formula Z does not support ARM can you fix it”. The most useful way you can help that software work on ARM is to open a bug report with the software developers.

That's one of the reason why Homebrew chooses /opt/homebrew as the homebrew prefix for M1 Mac, but not the old /usr/local. Users may need Apple Silicon Homebrew (installed in /opt/homebrew), Rosetta2 Homebrew (/usr/local) coexist.

So, if you really need gdb. Get a Rosetta 2 Homebrew installation and install it through Rosetta 2.

Upvotes: 5

Related Questions