riscv-software-src / homebrew-riscv

homebrew (macOS) packages for RISC-V toolchain
https://riscv.org
314 stars 49 forks source link

Failed to build on Intel Mac 12.6.7 Monterey: error: expected unqualified-id #115

Closed Aragami1408 closed 10 months ago

Aragami1408 commented 1 year ago

When I try to run brew install riscv-tools, I got this error:

==> Downloading https://formulae.brew.sh/api/formula.jws.json
####################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
####################################################################################################################################################### 100.0%
==> Fetching dependencies for riscv-software-src/riscv/riscv-tools: riscv-software-src/riscv/riscv-gnu-toolchain, riscv-software-src/riscv/riscv-isa-sim and riscv-software-src/riscv/riscv-pk
==> Fetching riscv-software-src/riscv/riscv-gnu-toolchain
==> Cloning https://github.com/riscv/riscv-gnu-toolchain.git
Updating /Users/higanbana/Library/Caches/Homebrew/riscv-gnu-toolchain--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at b86b2b3 Switch from Ubuntu 20.04 LTS to 22.04 LTS for jobs (#1353)
==> Fetching riscv-software-src/riscv/riscv-isa-sim
==> Cloning https://github.com/riscv/riscv-isa-sim.git
Updating /Users/higanbana/Library/Caches/Homebrew/riscv-isa-sim--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 5a114574 Merge pull request #1491 from ved-rivos/zabha
==> Fetching riscv-software-src/riscv/riscv-pk
==> Cloning https://github.com/riscv/riscv-pk.git
Updating /Users/higanbana/Library/Caches/Homebrew/riscv-pk--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at acbe166 Revert "[GCC]: Fix fence.i bug (#296)"
==> Fetching riscv-software-src/riscv/riscv-tools
==> Downloading https://github.com/riscv/riscv-tools/archive/homebrew.tar.gz
Already downloaded: /Users/higanbana/Library/Caches/Homebrew/downloads/5e080ac67877162e34a9e6701d88df637ec2f4abb27be9857918a142c6a3477e--riscv-tools-homebrew.tar.gz
==> Installing riscv-tools from riscv-software-src/riscv
==> Installing dependencies for riscv-software-src/riscv/riscv-tools: riscv-software-src/riscv/riscv-gnu-toolchain, riscv-software-src/riscv/riscv-isa-sim and riscv-software-src/riscv/riscv-pk
==> Installing riscv-software-src/riscv/riscv-tools dependency: riscv-software-src/riscv/riscv-gnu-toolchain
==> git submodule update --init --recursive newlib
==> git submodule update --init --recursive binutils
==> git submodule update --init --recursive gcc
==> sed -i .bak s/.*=host-darwin.o$// gcc/gcc/config.host
==> sed -i .bak s/.* x-darwin.$// gcc/gcc/config.host
==> ./configure --with-cmodel=medany --enable-multilib
==> make
Last 15 lines from /Users/higanbana/Library/Logs/Homebrew/riscv-gnu-toolchain/07.make:
            ^
In file included from /private/tmp/riscv-gnu-toolchain-20231104-61971-1c09o3r/gdb/gdb/m2-exp.y:42:
In file included from /private/tmp/riscv-gnu-toolchain-20231104-61971-1c09o3r/gdb/gdb/language.h:26:
/private/tmp/riscv-gnu-toolchain-20231104-61971-1c09o3r/gdb/gdb/symtab.h:307:23: error: expected unqualified-id
        style = split_style::DOT;
                             ^
m2-exp.c:163:13: note: expanded from macro 'DOT'
#define DOT 302
            ^
2 errors generated.
make[3]: *** [m2-exp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all-gdb] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-gdb-newlib] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/riscv-software-src/homebrew-riscv/issues

These open issues may also help:
M2 Mac Air, riscv-gnu-toolchain install failed https://github.com/riscv-software-src/homebrew-riscv/issues/114
sbeamer commented 10 months ago

I have disabled building gdb by default, and it solves many issues, potentially this one.