Compiling JavaHL On Mac OS X


Usually compiling JavaHL is pretty simple: just follow the directions
mentioned in the source code. Not on OS X though, there is an anomaly on
OS X when running "make javahl" or "make
install-javahl". When you run these make targets on OS X, you get
output like this:

ld: multiple definitions of symbol ___divdi3
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libgcc.a(_divdi3.o) private external definition of
___divdi3 in section (__TEXT,__text)
/usr/lib/libgcc_s.10.4.dylib(_divdi3_s.o) definition of ___divdi3
ld: multiple definitions of symbol ___udivdi3
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libgcc.a(_udivdi3.o) private external definition of
__udivdi3 in section (__TEXT,__text)
/usr/lib/libgcc_s.10.4.dylib(_udivdi3_s.o) definition of ___udivdi3
ld: multiple definitions of symbol ___umoddi3
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libgcc.a(_umoddi3.o) private external definition of
___umoddi3 in section (__TEXT,__text)
/usr/lib/libgcc_s.10.4.dylib(_umoddi3_s.o) definition of ___umoddi3
/usr/bin/libtool: internal link edit command failed
make: *** [subversion/bindings/java/javahl/native/] Error 1

After digging around, I finally joined the #fink irc channel on and started asking questions (I heard they had a working
script to compile the JavaHL bindings.) After talking to a few people in
#fink, they passed me this nice little snippet that fixed the problem:

perl -pi -e "s/-all_load//g" libtool

The above Perl call removes the "-all_load" flag from libtool to
work around a libtool issue on the Mac. Going into deeper detail is really
a libtool matter and I’ll omit that here but let me give you a little cheat sheet for building the JavaHL bindings from
scratch. Here are the brief steps:

  1. Download Subversion source.
  2. Change directory to where you downloaded the Subversion source.
  3. Run "./".
  4. Run "./configure <your_flags>". 
  5. Run "make". 
  6. Run "perl -pi -e  "s/-all_load//g" libtool". 
  7. Run "make javahl".
  8. Run "make install-javahl".

If you follow the steps above, you’ll have a working JavaHL
installation on your OS X system.  Enjoy.

Tagged with: , , , , , , , , , , , ,
Posted in Subversion
4 comments on “Compiling JavaHL On Mac OS X
  1. MacPorts manages to get this to work as well with some mild patching; see their Portfile at:
    Is there any good patch we can make work with upstream so that these workarounds aren’t necessary?

  2. Jeremy Whitlock says:

    I brought this up to the Subversion dev list in December:
    If you want, reply back to this because no one responded. My personal opinion is that our build process should be able to workaround libtool issues if known. If that view is not agreed upon, at least document it in the installation file or FAQ.
    Take care,

  3. Obvious says:

    Why not file a bug report instead of just posting to a mailing list?

  4. Jeremy Whitlock says:

    My plan was to get their feedback as to whether this merited an issue to be filed. Since I got no response, I just left it alone and figured I’d document it.
    Take care,

Leave a Reply

Your email address will not be published. Required fields are marked *




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

connect with CollabNet
sign up for emails
looking for something

CollabNet: Don't forget to register for our upcoming Certified #Scrum Master Course in Baltimore, MD! Apr 28-29
Date: 22 April 2014 | 10:30 pm

CollabNet: Register today! How the Government is Utilizing Open Source Webcast Series Thursday – April 24th, 2014 – 2:00pm ET
Date: 21 April 2014 | 10:15 pm

CollabNet: @dribback1: discusses "The #Agile Regression: How to Avoid Moving Backwards" in our blog
Date: 21 April 2014 | 5:42 pm