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/libsvnjavahl-1.la] Error 1

After digging around, I finally joined the #fink irc channel on
irc.freenode.net 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 "./autogen.sh".
        
  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:
    http://trac.macports.org/projects/macports/browser/trunk/dports/devel/subversion-javahlbindings/Portfile
    Is there any good patch we can make work with upstream so that these workarounds aren’t necessary?

  2. Jeremy Whitlock says:

    David,
    I brought this up to the Subversion dev list in December:
    http://svn.haxx.se/dev/archive-2006-12/0113.shtml
    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,
    Jeremy

  3. Obvious says:

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

  4. Jeremy Whitlock says:

    Obvious,
    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,
    Jeremy

Leave a Reply

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

*

CAPTCHA Image

*

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
   Contact Us
sign up for emails
looking for something
conversations

CollabNet: .@rsabbagh: #CST will be teaching a Certified #ScrumMaster course in Toronto, ON Sept 25-26! Don't forget to register! http://t.co/xCuQ0wP4dr
Date: 19 September 2014 | 10:06 pm

CollabNet: Executive #DevOps workshop in NJ - Engineering & management practices using the most popular #OpenSource dev tools http://t.co/hCE4CSz0IK
Date: 19 September 2014 | 2:00 pm

CollabNet: Any Exec or Mgr interested in learning how #DevOps is working for other large organizations, should join this webinar http://t.co/WNtsLBX5F3
Date: 18 September 2014 | 10:30 pm