You needd to add :
/usr/local/opt/binutils/bin
Answer from Philippe on Stack OverflowYou needd to add :
/usr/local/opt/binutils/bin
The path /usr/local/opt/binutils/bin should be added to your PATH environment variable.
You probably didn't notice the output from brew install binutils:
binutils is keg-only, which means it was not symlinked into /usr/local, because Apple's CLT provides the same tools.
If you need to have binutils first in your PATH, run: echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> /Users/ipellegrini/.bash_profile
For compilers to find binutils you may need to set: export LDFLAGS="-L/usr/local/opt/binutils/lib" export CPPFLAGS="-I/usr/local/opt/binutils/include"
So should be enough to:
- ⤵️
runecho 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> ~/.bash_profilein order to add thebinfolder toPATH, automatically, every time you open a new command-line shell. - 🔄
close the current shell and open a new one, for triggering the.bash_profileand making the command available for use. - 🔍
runwhich readelfto ensure that your desired command is found & reachable
Enjoy 🎉
macOS: Install GNU binutils with homebrew
Problem with building binutils on macOS
macos - Binutils build fails on Mac OS X 10.10.5 Yosemite - Stack Overflow
gcc - Building GNU Binutils on MacOS Monterey fails - Stack Overflow
You needd to add :
/usr/local/opt/binutils/bin
Answer from Philippe on Stack OverflowHello guys,
I am trying to build the binutils source on macOS, yet I always get the ld: undefined symbols for x86_64 architecture error. Here is a picture of the reason I think is the main cause of the error.
Anybody faced a similar problem on macOS and was able to solve it?
You really would make life easier for yourself if you used homebrew as a package manager on OSX.
Goto the homebrew website and copy and paste the one-line install script into your Terminal.
Then you can install binutils simply by typing
brew install binutils
If, down the line, you want to find GNU sed, or ImageMagick, you can just do
brew search sed
or
brew search imagemagick
then
brew install sed
If you have any problems, just run
brew doctor
If you want to update all your packages, just run
brew update
brew upgrade --all
More cool ideas and suggestions here.
After build failure , you should clean previously generated object files
So,
make clean
./configure --prefix=/usr --disable-werror
make