Shared libs on OSX

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shared libs on OSX

Per Persson
Hi,
I've been looking into the issue of building shared libs for OS X and
have made some progress.
Some of the problems with dynamic linking (as reported before) persist,
but I've been able to run a version octave built with shared libs.
This was accomplished using a yet-to-be-released version of Apples gcc
(v3.3 build 1301).

One thing that will need to be changed in the Makefiles is with repect
to the SH_LD and SH_LDFLAGS.

In Mach-O objects there is a difference between a shared library
(dylib) and a loadable module (.oct in this case). A dylib is used for
linking either statically or shared from, but _not_ dynamically as
opposed to ELF where I it is my understanding that a shared lib (.so)
can be used for both shared and dynamic loading(?).

Hence, I'd like to split SH_LD and SH_LDFLAGS into SH_LD, SH_LDFLAGS,
DL_LD and DL_LDFLAGS where the default is DL_LD=SH_LD and
DL_LDFLAGS=SH_LDFLAGS for systems other than OS X.

I've attached a patch with the changes so you can comment on the
suggestion.

/Per


osx_shared (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Shared libs on OSX

John W. Eaton-6
On 26-Nov-2002, Per Persson <[hidden email]> wrote:

| Hi,
| I've been looking into the issue of building shared libs for OS X and
| have made some progress.
| Some of the problems with dynamic linking (as reported before) persist,
| but I've been able to run a version octave built with shared libs.
| This was accomplished using a yet-to-be-released version of Apples gcc
| (v3.3 build 1301).
|
| One thing that will need to be changed in the Makefiles is with repect
| to the SH_LD and SH_LDFLAGS.
|
| In Mach-O objects there is a difference between a shared library
| (dylib) and a loadable module (.oct in this case). A dylib is used for
| linking either statically or shared from, but _not_ dynamically as
| opposed to ELF where I it is my understanding that a shared lib (.so)
| can be used for both shared and dynamic loading(?).
|
| Hence, I'd like to split SH_LD and SH_LDFLAGS into SH_LD, SH_LDFLAGS,
| DL_LD and DL_LDFLAGS where the default is DL_LD=SH_LD and
| DL_LDFLAGS=SH_LDFLAGS for systems other than OS X.
|
| I've attached a patch with the changes so you can comment on the
| suggestion.

This seems to suggest that the MKOCTFILE_SH_* variables should also be
renamed MKOCTFILE_DL_* becuase mkoctfile is creating files that can be
dynamically linked, but that are not shared libraries on all systems.

Is that OK?  Are we reinventing something here, that will make it
more difficult to switch to libtool?

Does libtool support OS X?

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

Re: Shared libs on OSX

Per Persson

On Tuesday, November 26, 2002, at 06:42 PM, John W. Eaton wrote:

> | Hence, I'd like to split SH_LD and SH_LDFLAGS into SH_LD, SH_LDFLAGS,
> | DL_LD and DL_LDFLAGS where the default is DL_LD=SH_LD and
> | DL_LDFLAGS=SH_LDFLAGS for systems other than OS X.
> |
> | I've attached a patch with the changes so you can comment on the
> | suggestion.
>
> This seems to suggest that the MKOCTFILE_SH_* variables should also be
> renamed MKOCTFILE_DL_* becuase mkoctfile is creating files that can be
> dynamically linked, but that are not shared libraries on all systems.

Indeed.

>
> Is that OK?  Are we reinventing something here, that will make it
> more difficult to switch to libtool?
>

I really don't know.

> Does libtool support OS X?

Yes, at least to some extent. There was some discussion of the state of
darwin support on the libtool developer list recently. I'm not very
familiar with (GNU)libtool but it seems to have gone trough a lot of
changes recently.
I'll see if I can dig out some more info.

Just to add to the confusion, Apple provides a tool named libtool which
is unrelated to GNUlibtool (which is installed as glibtool...)

/Per

------------
Per Persson
Blekinge Institute of Technology
Dept. of Signal Processing and Telecommunications

www:   http://www.its.bth.se/staff/pee
e-mail: [hidden email]