[Top][All Lists]

[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

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:

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(" 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 
-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 
-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 
/bin/sh ../libtool  --tag=CC   --mode=link cc -qlanglvl=extc89  -g -module 
-avoid-version  -o -rpath 
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>  
libtool: link: cc -qlanglvl=extc89 -Wl,-bM:SRE -o .libs/  
.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/
libtool: link: ( cd ".libs"&&  rm -f ""&&  ln -s "../" 
"" )

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

cat src/
# - 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).

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

# The name of the static archive.

# Linker flags that can not go in dependency_libs.

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

# Names of additional weak libraries provided by this library

# Version information for core_fake.

# Is this an already installed library?

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

# Files to dlopen/dlpreopen

# Directory that this library needs to be installed in:

Thank you


reply via email to

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