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 *




connect with CollabNet
   Contact Us

Have new blog posts sent directly to your email.

looking for something

CollabNet: We are proud to partner with #YesWeCode to help advance #tech careers for low-opportunity & diverse students:
Date: 26 May 2016 | 7:04 pm

CollabNet: How to Ensure Success with #DevOps in a Distributed #Network Environment: @Data_Informed: @varbetz:
Date: 26 May 2016 | 5:50 pm

CollabNet: We are exhibiting at @CloudExpo: June 7-9! Make sure to come say hi and learn about #TeamForge: #DevOps
Date: 25 May 2016 | 8:54 pm