niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » HP-UX
link error - xunlink unsatisfied
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
Author Message
programmer
*nix forums beginner


Joined: 22 Jun 2006
Posts: 4

PostPosted: Wed Jun 28, 2006 3:32 pm    Post subject: link error - xunlink unsatisfied Reply with quote

When I link my program using the command:
gcc -o fe -lpthread fe.o mylib.sl
I get the error:
/usr/ccs/bin/ld: Unsatisfied symbols:
xunlink (code)

Does anyone know why this is happening?

uname -a
HP-UX hpux B.11.11 U 9000/800 892008281 unlimited-user license
Back to top
Rick Jones
*nix forums Guru


Joined: 24 Feb 2005
Posts: 492

PostPosted: Wed Jun 28, 2006 4:56 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

programmer <programmer@nowhere.org> wrote:
Quote:
When I link my program using the command:
gcc -o fe -lpthread fe.o mylib.sl
I get the error:
/usr/ccs/bin/ld: Unsatisfied symbols:
xunlink (code)

Does anyone know why this is happening?

uname -a
HP-UX hpux B.11.11 U 9000/800 892008281 unlimited-user license

I'm not a compiler guy but I think I've seen enough of their responses
to take a stab at it.

First, IIRC system libraries should be at the end of the links, so the
-lpthread should be at the end, not the beginning.

Second, the message means that something - either in fe, mylib or
those things on which they depend is tryng to reference a routine
called xunlink and the linker is not able to resolve that reference
for them.

So, for now, first fix-up the link-order. If the problem persists,
find who is trying to call xunlink and work from there.

rick jones
--
The computing industry isn't as much a game of "Follow The Leader" as
it is one of "Ring Around the Rosy" or perhaps "Duck Duck Goose."
- Rick Jones
these opinions are mine, all mine; HP might not want them anyway... Smile
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Kevin Collins
*nix forums Guru Wannabe


Joined: 11 Mar 2005
Posts: 216

PostPosted: Wed Jul 05, 2006 6:37 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

In article <Lwyog.2329$ZW3.892@news.cpqcorp.net>, Rick Jones wrote:
Quote:
programmer <programmer@nowhere.org> wrote:
When I link my program using the command:
gcc -o fe -lpthread fe.o mylib.sl
I get the error:
/usr/ccs/bin/ld: Unsatisfied symbols:
xunlink (code)

Does anyone know why this is happening?

uname -a
HP-UX hpux B.11.11 U 9000/800 892008281 unlimited-user license

I'm not a compiler guy but I think I've seen enough of their responses
to take a stab at it.

First, IIRC system libraries should be at the end of the links, so the
-lpthread should be at the end, not the beginning.

I'm no expert here either, but at least for compiling Perl, you need pthread at
the front of the list...

Quote:
Second, the message means that something - either in fe, mylib or
those things on which they depend is tryng to reference a routine
called xunlink and the linker is not able to resolve that reference
for them.

So, for now, first fix-up the link-order. If the problem persists,
find who is trying to call xunlink and work from there.

Kevin
--
Unix Guy Consulting, LLC
Unix and Linux Automation, Shell, Perl and CGI scripting
http://www.unix-guy.com
Back to top
Paul Pluzhnikov
*nix forums Guru


Joined: 25 Mar 2005
Posts: 512

PostPosted: Thu Jul 06, 2006 3:42 am    Post subject: Re: link error - xunlink unsatisfied Reply with quote

Kevin Collins <spamtotrash@toomuchfiction.com> writes:

Quote:
In article <Lwyog.2329$ZW3.892@news.cpqcorp.net>, Rick Jones wrote:
First, IIRC system libraries should be at the end of the links, so the
-lpthread should be at the end, not the beginning.

I'm no expert here either, but at least for compiling Perl, you need pthread at
the front of the list...

Well, I am an expert (at least a self-proclaimed one Smile, and
you don't need -lpthread at the front, when *linking* Perl (or
anything else). It should be at the end together with all the other
system libraries [1].

[1] Actually, with shared libraries it doesn't much matter whether
the libraries are at the beginning or the end of the link line [2].
But it does matter a *lot* if archive libraries are used.
More info here:
http://webpages.charter.net/ppluzhnikov/linker.html

[2] So long as "system symbols" aren't redefined [3].
[3] Which is a terrible idea (TM).

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
Kevin Collins
*nix forums Guru Wannabe


Joined: 11 Mar 2005
Posts: 216

PostPosted: Thu Jul 06, 2006 8:06 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

In article <m37j2r9z6j.fsf@somewhere.in.california.localhost>, Paul Pluzhnikov
wrote:
Quote:
Kevin Collins <spamtotrash@toomuchfiction.com> writes:

In article <Lwyog.2329$ZW3.892@news.cpqcorp.net>, Rick Jones wrote:
First, IIRC system libraries should be at the end of the links, so the
-lpthread should be at the end, not the beginning.

I'm no expert here either, but at least for compiling Perl, you need pthread at
the front of the list...

Well, I am an expert (at least a self-proclaimed one Smile, and
you don't need -lpthread at the front, when *linking* Perl (or
anything else). It should be at the end together with all the other
system libraries [1].

Have you ever tried to compile the DBD::Oracle Perl module on HP-UX? If not, go
ahead and try - I'll wait... :)

If you do not specify -lcl and -lpthread as the 1st libraries to link, you WILL
NOT get a usable shared library. It will fail to load, and is a well-known
issue with Perl and HP-UX.

Quote:
[1] Actually, with shared libraries it doesn't much matter whether
the libraries are at the beginning or the end of the link line [2].
But it does matter a *lot* if archive libraries are used.
More info here:
http://webpages.charter.net/ppluzhnikov/linker.html

[2] So long as "system symbols" aren't redefined [3].
[3] Which is a terrible idea (TM).

Kevin
--
Unix Guy Consulting, LLC
Unix and Linux Automation, Shell, Perl and CGI scripting
http://www.unix-guy.com
Back to top
Paul Pluzhnikov
*nix forums Guru


Joined: 25 Mar 2005
Posts: 512

PostPosted: Fri Jul 07, 2006 3:05 am    Post subject: Re: link error - xunlink unsatisfied Reply with quote

Kevin Collins <spamtotrash@toomuchfiction.com> writes:

Quote:
Have you ever tried to compile the DBD::Oracle Perl module on HP-UX?

No, I have not.

However, I continue to claim that your "-lpthread first" statement
is totally bogus.

Quote:
If not, go ahead and try - I'll wait... Smile

I could do that, but that will prove nothing -- you'll just claim
that your version of Perl or DBD::Oracle was different.

So if you want me to prove you wrong, please state *exact* version
of Perl and DBD::Oracle that allegedly requires "-lpthread first",
including how that Perl was configured.

Quote:
If you do not specify -lcl and -lpthread as the 1st libraries to link, you WILL
NOT get a usable shared library.

The instructions here:
http://search.cpan.org/~pythian/DBD-Oracle-1.17/README.hpux.txt
explain that you must rebuild Perl itself with '-lpthread' (and do
not state, but I assure you '-lpthread' goes at the end).

Once you do that, it wouldn't even matter whether DBD::Oracle shared
library links with -lpthread or not.

And if you don't do that, it doesn't matter where you put '-lpthread'
when linking DBD::Oracle, as the result will be completely undefined
either way.

Quote:
It will fail to load, and is a well-known issue with Perl and HP-UX.

I think you are just repeating an "urban legend", without
understanding the problem.

There is a well-known issue with Perl and DBD::Oracle, but it has
nothing to do with where on the link line '-lpthread' goes.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
Kevin Collins
*nix forums Guru Wannabe


Joined: 11 Mar 2005
Posts: 216

PostPosted: Fri Jul 07, 2006 5:32 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

In article <m3odw2dsid.fsf@somewhere.in.california.localhost>, Paul Pluzhnikov
wrote:
Quote:
Kevin Collins <spamtotrash@toomuchfiction.com> writes:

Have you ever tried to compile the DBD::Oracle Perl module on HP-UX?

No, I have not.

However, I continue to claim that your "-lpthread first" statement
is totally bogus.

If not, go ahead and try - I'll wait... :)

I could do that, but that will prove nothing -- you'll just claim
that your version of Perl or DBD::Oracle was different.

So if you want me to prove you wrong, please state *exact* version
of Perl and DBD::Oracle that allegedly requires "-lpthread first",
including how that Perl was configured.

If you do not specify -lcl and -lpthread as the 1st libraries to link, you WILL
NOT get a usable shared library.

The instructions here:
http://search.cpan.org/~pythian/DBD-Oracle-1.17/README.hpux.txt
explain that you must rebuild Perl itself with '-lpthread' (and do
not state, but I assure you '-lpthread' goes at the end).

Once you do that, it wouldn't even matter whether DBD::Oracle shared
library links with -lpthread or not.

And if you don't do that, it doesn't matter where you put '-lpthread'
when linking DBD::Oracle, as the result will be completely undefined
either way.

And if you read ALL of the README you point to you will find this text:

"BTW: If you add -lcl and -lpthread to the end of the list it will not work. I
wasted a day and a half trying to figure out why I had lost the recipe, before
I realized that this was the problem."

Quote:
It will fail to load, and is a well-known issue with Perl and HP-UX.

I think you are just repeating an "urban legend", without
understanding the problem.

There is a well-known issue with Perl and DBD::Oracle, but it has
nothing to do with where on the link line '-lpthread' goes.

Feel completely free to educate me - I have no issue with being enlightened.
However, you seem bent on proving me wrong, do it with facts please.

Thanks,

Kevin

--
Unix Guy Consulting, LLC
Unix and Linux Automation, Shell, Perl and CGI scripting
http://www.unix-guy.com
Back to top
Paul Pluzhnikov
*nix forums Guru


Joined: 25 Mar 2005
Posts: 512

PostPosted: Fri Jul 07, 2006 8:22 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

Kevin Collins <spamtotrash@toomuchfiction.com> writes:

Quote:
And if you read ALL of the README you point to you will find this text:

"BTW: If you add -lcl and -lpthread to the end of the list it will not work. I
wasted a day and a half trying to figure out why I had lost the recipe, before
I realized that this was the problem."

There is in fact such a statement in the README.
What's not clear is exactly *which* list it is talking about.

Quote:
Feel completely free to educate me - I have no issue with being enlightened.
However, you seem bent on proving me wrong, do it with facts please.

So here are the facts:

If one is to build perl-5.8.8 after
sh ./Configure -A prepend:libswanted='cl pthread ' -des
then the *actual* link line for perl is:

cc -o perl +DD64 -L/usr/local/lib -L/lib/pa20_64 -Wl,-E \
-Wl,-B,deferred perlmain.o lib/auto/DynaLoader/DynaLoader.a \
libperl.a `cat ext.libs` -lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc

From this, it is clear that the list in the "BTW" note is the list of
system libraries, *not* the list of all arguments (which is what
started our exchange).

Further, the "BTW" note says that if '-lcl -lpthread' is moved to
the end, then "make test" will fail.

I did move it to the end "by hand", and reran "make test", just so
I can see *why* it would fail. However it didn't fail, so the "BTW"
note itself is either wrong, or applies only to a different release
of the OS or the compiler/linker.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
Kevin Collins
*nix forums Guru Wannabe


Joined: 11 Mar 2005
Posts: 216

PostPosted: Mon Jul 10, 2006 9:57 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

In article <m3d5chmah8.fsf@somewhere.in.california.localhost>, Paul Pluzhnikov
wrote:
Quote:
Kevin Collins <spamtotrash@toomuchfiction.com> writes:

And if you read ALL of the README you point to you will find this text:

"BTW: If you add -lcl and -lpthread to the end of the list it will not work. I
wasted a day and a half trying to figure out why I had lost the recipe, before
I realized that this was the problem."

There is in fact such a statement in the README.
What's not clear is exactly *which* list it is talking about.

Feel completely free to educate me - I have no issue with being enlightened.
However, you seem bent on proving me wrong, do it with facts please.

So here are the facts:

If one is to build perl-5.8.8 after
sh ./Configure -A prepend:libswanted='cl pthread ' -des
then the *actual* link line for perl is:

cc -o perl +DD64 -L/usr/local/lib -L/lib/pa20_64 -Wl,-E \
-Wl,-B,deferred perlmain.o lib/auto/DynaLoader/DynaLoader.a \
libperl.a `cat ext.libs` -lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc

From this, it is clear that the list in the "BTW" note is the list of
system libraries, *not* the list of all arguments (which is what
started our exchange).

Ok, so that makes sense so far...

Quote:
Further, the "BTW" note says that if '-lcl -lpthread' is moved to
the end, then "make test" will fail.

I did move it to the end "by hand", and reran "make test", just so
I can see *why* it would fail. However it didn't fail, so the "BTW"
note itself is either wrong, or applies only to a different release
of the OS or the compiler/linker.

That is because you were compiling 'perl' and not DBD-Oracle. The note is about
the perl executable, but the 'make test' is referring to DBD-Oracle.

If you now perform a 'make install' of perl as you compiled it, then use that
perl to configure and install DBI and then get DBD-Oracle and run configure,
make, make test, the make test will fail.

Trust me, it will happen - I've seen it from at least 11.00 thru 11.23 on
PA-RISC and Itanium... :)

Kevin
--
Unix Guy Consulting, LLC
Unix and Linux Automation, Shell, Perl and CGI scripting
http://www.unix-guy.com
Back to top
Paul Pluzhnikov
*nix forums Guru


Joined: 25 Mar 2005
Posts: 512

PostPosted: Mon Jul 10, 2006 11:54 pm    Post subject: Re: link error - xunlink unsatisfied Reply with quote

Kevin Collins <spamtotrash@toomuchfiction.com> writes:

Quote:
That is because you were compiling 'perl' and not DBD-Oracle. The note is about
the perl executable, but the 'make test' is referring to DBD-Oracle.

If you now perform a 'make install' of perl as you compiled it, then use that
perl to configure and install DBI and then get DBD-Oracle and run configure,
make, make test, the make test will fail.

I did, and it didn't fail (using Oracle 8.1.7; the only version I have).

In fact, it would make absolutely no sense for it to fail:
if 'perl' itself has been linked with libpthread.sl, then it
*doesn't* matter whether Oracle.sl links with libpthread at all --
libpthread is loaded when perl itself is, and when subsequent load
of Oracle.sl comes, the runtime loader merely increments libpthread
reference count, but doesn't load another copy of it.

In fact, the final link line for Oracle.sl has neither -lcl nor
-lpthread anywhere on it.

Quote:
Trust me, it will happen

The problem is that I don't trust you (mostly because you are
telling me something I know to be false).

But I think I've run out of options to convince you, and you probably
have run out of options to convince me; so will just have to continue
to believe that the other one is wrong.

Cheers
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
Dennis Handly
*nix forums beginner


Joined: 28 Jun 2005
Posts: 38

PostPosted: Sat Jul 15, 2006 10:07 am    Post subject: Re: link error - xunlink unsatisfied Reply with quote

Paul Pluzhniko wrote:
: It should be at the end together with all the other system libraries [1].

But better be before libc.

: [1] Actually, with shared libraries it doesn't much matter whether
: the libraries are at the beginning or the end of the link line [2].

That's not strictly true. With C++ shared libs, there is a static init
order that when changed could break things. And several ISVs ran into
one after I made a change.
(That's if you change the relative shlib order.)

: But it does matter a *lot* if archive libraries are used.

Right.

Quote:
From: Kevin Collins <spamtotrash@toomuchfiction.com
make test, the make test will fail.

Because of the libpthread libc ordering?

Quote:
From: Paul Pluzhnikov <ppluzhnikov-nsp@charter.net
In fact, it would make absolutely no sense for it to fail:
if 'perl' itself has been linked with libpthread.sl, then it
*doesn't* matter whether Oracle.sl links with libpthread at all --

That may be true for PA32 but PA64 has a different search ordering.
depth vs breadth.
And when it came out, there were no end of issues and unexpected problems.

Quote:
libpthread is loaded when perl itself is, and when subsequent load
of Oracle.sl comes, the runtime loader merely increments libpthread
reference count, but doesn't load another copy of it.

Yes but the symbol order binding could be changed.

Quote:
The problem is that I don't trust you (mostly because you are
telling me something I know to be false).

There are gotchas with libpthread ordering and dependent shlibs.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 10:42 pm | All times are GMT
navigation Forum index » *nix » HP-UX
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts ** Postfix error on console every minute or so ** ?? drywash Postfix 0 Fri Jul 04, 2008 8:49 pm
No new posts Postfix error bounce diwash Postfix 0 Fri Mar 28, 2008 3:37 am
No new posts I am getting following error in Aix 5.3 rockcharles1 AIX 0 Tue Aug 28, 2007 11:06 pm
No new posts postfix out of memory error - please help metind Postfix 0 Mon Sep 11, 2006 1:54 am

Cell Phones | Advertising | Free Ringtones | Per Insurance | Buy Playstation 3
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3520s ][ Queries: 16 (0.1961s) ][ GZIP on - Debug on ]