maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #04331
Re: Shared plugin library build question
On Fri, 2011-09-23 at 00:10 +0200, Vladislav Vaintroub wrote:
> Steve,
> Are you talking about PIC requirements, when you say " HP-UX doesn't support
> building shared libaries that depend on archive libraries".
No I was thinking of a dependent library list, after building mariadb
on linux, in the storage/federated/.libs directory, there is
ha_federated.so, the shared library and there is ha_federated.la,
the libtool library file which contains:
dependency_libs=' -L/wsp/sje/mariadb/linux/obj/libservices -lmysqlservices -lcrypt -lnsl -lpthread -lrt'
I think this causes libtool, when building something that uses ha_federated.so to
also link in libmysqlservices (and crypt, etc).
libmsqlservices would only need to be PIC if it were copied into
ha_federated.so and I don't think that is happening is it? If so then
it would need to be PIC and with my build, the libsqlservices code is
not compiled with the PIC options.
> In MySQL 5.5, linking static to shared feature was used extensively (as a
> replacement for libtool's "convenience libraries", static library was
> compiled with platform dependent PIC flag), and it worked on all major
> Unixes, I'm pretty sure it worked on HPUX/Itanium.
>
> I think the trick for Maria 5.3 could be to compile the sqlservices library
> with the PIC flag (+Z or +z or something similar, if I recall this
> correctly). I do not have access to HPUX machines anymore, but you might
> want to give it a try.
I think compiling with PIC should only be needed if libsqlservices code
is intended to be linked into a shared library and I am not sure if that
is the case or not.
Here is the error message that libtool gives me during the build:
*** Warning: linker path does not have real file for library -lmysqlservices.
*** I have the capability to make that library automatically link in
when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libmysqlservices and none of the candidates passed a file
format test
*** using a file magic. Last file
checked: /wsp/sje/mariadb/isvn/mariadb-project/5.3.1.beta/obj_gcc/libservices/libmysqlservices.a
*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module ha_federated. Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.
libtool: link: ar
cru .libs/ha_federated.a .libs/ha_federated_la-ha_federated.o .libs/ha_federated_la-string.o
Steve Ellcey
sje@xxxxxxxxxx
Follow ups
References