buildNatives_osx64 build is broken
See original GitHub issueDescribe the bug
gradle buildNatives_osx64
fails with error message
> Task :CabExtract:osx64CabExtractMake
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
gcc -DHAVE_CONFIG_H -I. -I./mspack -DMSPACK_NO_DEFAULT_SYSTEM -g -O2 -c -o system.o `test -f 'mspack/system.c' || echo './'`mspack/system.c
gcc -DHAVE_CONFIG_H -I. -I./mspack -DMSPACK_NO_DEFAULT_SYSTEM -g -O2 -c -o cabd.o `test -f 'mspack/cabd.c' || echo './'`mspack/cabd.c
gcc -DHAVE_CONFIG_H -I. -I./mspack -DMSPACK_NO_DEFAULT_SYSTEM -g -O2 -c -o lzxd.o `test -f 'mspack/lzxd.c' || echo './'`mspack/lzxd.c
gcc -DHAVE_CONFIG_H -I. -I./mspack -DMSPACK_NO_DEFAULT_SYSTEM -g -O2 -c -o mszipd.o `test -f 'mspack/mszipd.c' || echo './'`mspack/mszipd.c
gcc -DHAVE_CONFIG_H -I. -I./mspack -DMSPACK_NO_DEFAULT_SYSTEM -g -O2 -c -o qtmd.o `test -f 'mspack/qtmd.c' || echo './'`mspack/qtmd.c
rm -f libmspack.a
ar cru libmspack.a system.o cabd.o lzxd.o mszipd.o qtmd.o
/opt/local/bin/ranlib: object: libmspack.a(system.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make[1]: *** [libmspack.a] Error 1
make: *** [all] Error 2
> Task :CabExtract:osx64CabExtractMake FAILED
To Reproduce Steps to reproduce the behavior: This applies to the current Ghidra github repo, the last commit was https://github.com/NationalSecurityAgency/ghidra/commit/cafbb77db0a2120c529aef45d2d6bc47fa1edc29
mkdir ~/git2
cd ~/git2
git clone https://github.com/NationalSecurityAgency/ghidra.git
cd ghidra/
gradle eclipse
gradle prepDev -x yajswDevUnpack eclipse
mkdir -p /git2/ghidra.bin/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/
cp ~/git/ghidra.bin/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/* ~/git2/ghidra.bin/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/
gradle prepDev -x yajswDevUnpack eclipse
gradle buildNatives_osx64
Expected behavior Build should work.
Environment (please complete the following information):
- OS: macOS 10.14.5
- Java Version: openjdk 11.0.2 2019-01-15
- Ghidra Version: fresh clone from github
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
React Native build breaking - 64 bit support #2684 - GitHub
Our react-native xcode build is failing to archive due to realm. I've searched exhaustively, but haven't found a lead on what could fix...
Read more >Can't build gdal in x64 - Stack Overflow
I managed to build x64 version of GDAL under Visual Studio 2012 using steps ... Start VS2012 x64 Native Tools Command Prompt :...
Read more >MSBuild and 64-bit Visual Studio 2022 - .NET Blog
Visual Studio's shift to 64-bit means your builds in Visual Studio 2022 will run in a 64-bit MSBuild. This will not cause any...
Read more >Building native software - Gradle User Manual
The software model is being retired and the plugins mentioned in this chapter will eventually be deprecated and removed. We recommend new projects...
Read more >Visual Studio not able to compile a simple Hello World
Run Build Command:"C:/Program Files (x86)/Microsoft Visual ... Open your x64 Native Tools Command prompt from your Start Menu (while at it, pin it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I found the problem - apparently my
ranlib
(“Apple Inc. version cctools-895”) was installed with another package, maybe libtools (?), and didn’t matchar
.Now, with
everything builds ok.
It generates a warning
but it builds 😃
Thanks for your help.
Thanks for your information, it helps me a lot.
I have also occurred this problem after I updated my MAC with command
brew upgrade
.But my error info is:
Using command
nm libmspack.a | grep _mspack_create_cab_decompressor
, I get:It’s clear that I have successfully built and archived the target functions, but why I cannot link them?
The command
ar -V
andranlib -V
gives me the result:So it’s not about the incompatible between AR and RANLIB. What about the LD? Then I use system default AR and RANLIB instead:
Build again. Bingo! Compile successfully.
CONCLUSION: The AR and RANLIB from GNU Binutils does not compatible with the system linker LD on mac OSX, we should use the system default toolchains.