libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] branch-1-4 on Darwin


From: Edouard G. Parmelan
Subject: [PATCH] branch-1-4 on Darwin
Date: Tue, 14 Aug 2001 16:06:53 +0200
User-agent: Mutt/1.3.18i

Hi,

I have port Kaffe on Darwin.  It use branch-1-4 (1.922.2.23 2001/07/29
16:48:38) with my previous m4's quote patch.

While compiling with static modules and static libraries, .libs/KaffeS.c
failed to compile due to some zsh (/bin/sh on Mac OS X) backslash inside
double quotes bugs^H^H^H^H features.

This was extracted from my libtool script

    global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) \$/  {\\"\1\\", 
(lt_ptr) 0},/p' -e 's/^[BCDEGRST] \([^ ]*\) \([^ ]*\)\$/  {\"\2\", (lt_ptr) 
\&\2},/p'"

As you cas see, "... \\"\1\\" ..." will throws away double quotes
required for module name C string.  But as "... \"\2\" ..." works for
function name C string, I quick fix libtool.m4 (patch lt-darwin-0.diff)
to use same construct for both module name and function name.

With that patch, libtool was able to succefully build (and run) Kaffe
with static modules and libraries on Darwin.


While trying to use dynamic modules and dynamic libraries I had few
problems:

- In the definition of archive_cmds the form '... $(test -n "$version"
  ...) ...' was not escaped correctly by zsh.  I hack that with a
  different definition of delay_variable_subst but a I'm not sure of the
  correct fix.  The definition I use was:
  delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g;s/\\\\\\\"/\\\\"/g'

- Libtool was unable to build libkaffevm.dynlib due to multi definitions
  of same symbols.  In fact, conveniences libraries are add in $deplibs
  _and_ in $convenience resulting in duplicate link.  But Darwin's ld
  don't allow that.  This is solved in patch lt-darwin-1.diff.

- Kaffe binary was not linked because Darwin's ld -lFOO only search
  libFOO.dylib and libFOO.a and therefor does not find dlopen'ed
  modules.  I hack that by changing library_names_spec and soname_spec
  to always use dylib.  Unfortunary, Darwin's ld fails again.  It's not
  possible to use a 'bundle' as a 'dynamiclib'.
  
Then I realise that ltdl does not yet support Darwin's dyld interface.
So will continue to use static link until dyld will be supported by
libtool (may be it's already done in HEAD branch ?).

Hope that helps.
-- 
Edouard G. Parmelan
http://egp.free.fr

Attachment: lt-darwin-0.diff
Description: Text document

Attachment: lt-darwin-1.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]