libtool
[Top][All Lists]
Advanced

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

Re: lt_dlopen fails on AIX


From: Anatoly Belyaev
Subject: Re: lt_dlopen fails on AIX
Date: Thu, 30 Aug 2012 19:39:23 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Hi,
if you want to build and install .so files instead of .a files try add parameter "--enable-so=shared" and "-Wl,-brtl" to LDFLAGS when you invoke configure.
----------------------------------------
Best regards, Anatoly Belyaev
Crypto-Pro LLC
work: +7 495 7804820
e-mail: address@hidden

On 08/29/2012 01:18 PM, Brice Goglin wrote:
Hello,

I cannot get ltdl to load plugins on AIX 6.1. I am compiling plugins
with -module -avoid-version. libtool generates a ".so" but then embeds
it inside a ".a" and it looks like it really wants me to use this ".a"
since the ".so" doesn't even get installed.

When lt_dlopen tries to open the plugins (tried dlopen with an extension
and dlopenext without extension), it fails saying "file not found". The
raw dlopen doesn't want to load the .a file because of a "bad magic number".

dlopen succeeds if I use "foo.a(foo.so)" as a file name instead of
"foo.a", and if I add RTLD_MEMBER to the flags. But I don't see any
reference to RTLD_MEMBER in libltdl, so I assume I am not building the
plugins correctly.

What should I do to properly build my plugin? I assume I need to .la to
point to a .so instead of a .a but I can't find how do that. FWIW,
things work fine on Linux and Solaris, at least.

Here's the (dummy) plugin compile lines:

source='topology-fake.c' object='core_fake_la-topology-fake.lo' libtool=yes \
         DEPDIR=.deps depmode=xlc /bin/sh ../.././config/depcomp \
         /bin/sh ../libtool  --tag=CC   --mode=compile cc -qlanglvl=extc89 
-DHAVE_CONFIG_H -I. -I../../src -I../include/private/autogen -I../include/hwloc/autogen  
-I/pf/k/k203045/hwloc-1.6a1-1/build/include -I/pf/k/k203045/hwloc-1.6a1-1/include 
-DHWLOC_INSIDE_LIBHWLOC 
-DHWLOC_PLUGINS_DIR=\"/pf/k/k203045/hwloc-1.6a1-1/build/install/lib/hwloc\" 
-I../../src/libltdl -DHWLOC_BUILD_PLUGIN   -g -c -o core_fake_la-topology-fake.lo `test 
-f 'topology-fake.c' || echo '../../src/'`topology-fake.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../src 
-I../include/private/autogen -I../include/hwloc/autogen 
-I/pf/k/k203045/hwloc-1.6a1-1/build/include -I/pf/k/k203045/hwloc-1.6a1-1/include 
-DHWLOC_INSIDE_LIBHWLOC 
-DHWLOC_PLUGINS_DIR=\"/pf/k/k203045/hwloc-1.6a1-1/build/install/lib/hwloc\" 
-I../../src/libltdl -DHWLOC_BUILD_PLUGIN -g -c ../../src/topology-fake.c 
-Wp,-qmakedep=gcc,-MF.deps/core_fake_la-topology-fake.TPlo  -DPIC -o 
.libs/core_fake_la-topology-fake.o
/bin/sh ../libtool  --tag=CC   --mode=link cc -qlanglvl=extc89  -g -module 
-avoid-version  -o core_fake.la -rpath 
/pf/k/k203045/hwloc-1.6a1-1/build/install/lib/hwloc 
core_fake_la-topology-fake.lo  -lpthread
libtool: link: /usr/bin/nm -B -BCpg  .libs/core_fake_la-topology-fake.o   | awk '{ if ((($ 2 == "T") || ($ 2 == 
"D") || ($ 2 == "B"))&&  (substr($ 3,1,1) != ".")) { print $ 3 } }' | sort -u>  
.libs/core_fake.exp
libtool: link: cc -qlanglvl=extc89 -Wl,-bM:SRE -o .libs/core_fake.so  
.libs/core_fake_la-topology-fake.o   -lpthread -lc -Wl,-bnoentry  
-qlanglvl=extc89   -Wl,-bE:.libs/core_fake.exp -Wl,-berok
libtool: link: ar cru .libs/core_fake.a .libs/core_fake.so
libtool: link: ( cd ".libs"&&  rm -f "core_fake.la"&&  ln -s "../core_fake.la" 
"core_fake.la" )


And the generated .la that lt_dlopen does not want to load:

cat src/core_fake.la
# core_fake.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.1
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='core_fake.so'

# Names of this library.
library_names='core_fake.a core_fake.a'

# The name of the static archive.
old_library=''

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=' -lpthread'

# Names of additional weak libraries provided by this library
weak_library_names=''

# Version information for core_fake.
current=0
age=0
revision=0

# Is this an already installed library?
installed=no

# Should we warn about portability when linking against -modules?
shouldnotlink=yes

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/pf/k/k203045/hwloc-1.6a1-1/build/install/lib/hwloc'


Thank you
Brice


_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool



reply via email to

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