ThoughtGang / opdis

libopcodes-based disassembler
GNU General Public License v2.0
35 stars 10 forks source link

[MacOSX 10.6.8 / brew 0.9.3] build needs ./configure massage #3

Closed alxdrl closed 9 years ago

alxdrl commented 12 years ago

./configure fails with the following in config.log:

Undefined symbols:
  "_libintl_dgettext", referenced from:
      _perror_memory in libopcodes.a(dis-buf.o)
      _perror_memory in libopcodes.a(dis-buf.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

and others similar messages related to gettext symbols… I'm able to build opdis on my brewed macosx with the following commands: ./configure LDFLAGS="-lintl -largp -liberty -L/usr/local/opt/gettext/lib -L/usr/local/opt/argp-standalone/lib -L/usr/local/Cellar/binutils/2.22/lib/x86_64" Don't know if you can do anything about it ?

HOMEBREW_VERSION: 0.9.3
HEAD: 6b2d52f2afa29d91b97853a7efd744fba01f7ada
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.6.8-i386
Xcode: 3.2.6
GCC-4.0: build 5494
GCC-4.2: build 5666
LLVM-GCC: build 2335
Clang: 1.7 build 77
X11: 2.3.6 => /usr/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

rofl0r commented 12 years ago

a disassembler with internationalized error messages ! ain't that great ?

mkfs commented 11 years ago

I don't use homebrew on my OS X box, and I don't have any control over whatever crap GNU binutils (libbfd and libopcodes) links to.

I'll add some more complete dependency checks to the autoconf scripts and see if that helps -- apparently libz is another library required by binutils, but whose header files no longer ship by default.

mkfs commented 11 years ago

Latest commit has fixes (and a wrapper script for configure) that allow opdis to build more readily on OS X with either MacPorts or HomeBrew.

I have not yet tested the resulting executable -- all that banging away at autoconf scripts has sapped my will.

There is still something funky, though: make check works with the MacPorts build, but fails (running the tree test) with the HomeBrew build.

mkfs commented 11 years ago

Can anyone using a mac confirm this fix? My macbook has been booted into Linux for over a month now.

alxdrl commented 11 years ago

I can confirm that configure.osx works out of the box here (homebrew on OSX 10.6) ; great !

Though the executable fails with some missing symbol :

$ opdis 
dyld: Symbol not found: __hex_value
  Referenced from: /usr/local/Cellar/opdis/HEAD/lib/libopdis.0.dylib
  Expected in: flat namespace
 in /usr/local/Cellar/opdis/HEAD/lib/libopdis.0.dylib

I might have a look someday, I'm currently focusing outside of opdis scope ATM and I'm not acquainted at all with OSX dynamic linking.

Thanks anyway !

bannedit commented 11 years ago

I think I solved the problem. For whatever reason the LIB -liberty was not being set in the Makefile. Manually adding it to the LIB var fixes this.

mkfs commented 9 years ago

This should all be fixed with the latest commits.