FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 04-08-2011, 04:49 AM
Brian May
 
Default compiling without -O2 ld shared lib errors

Hello,
Am trying to compile Heimdal in unstable without -O2 optimization, so I can debug*http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618992*

To do this, I have inserted the line in debian/rules:
CFLAGS := "-g"
Unfortunately, when ever I do, I get the following error:

/bin/bash ../libtool --tag=CC * --mode=link gcc *-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs *-g * -o digest-service digest-service.o libkdc.la ../lib/ipc/libheim-ipcs.la ../lib/hdb/libhdb.la ../lib/krb5/libkrb5.la *-lcrypto *../lib/asn1/libasn1.la ../lib/vers/libvers.la ../lib/roken/libroken.la -lcrypt *-ldb *-lresolv -pthread -lpthread
libtool: link: gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -g -o .libs/digest-service digest-service.o -pthread *./.libs/libkdc.so ../lib/ipc/.libs/libheim-ipcs.a /home/brian/tree/heimdal/git/heimdal/lib/roken/.libs/libroken.so ../lib/hdb/.libs/libhdb.so ../lib/krb5/.libs/libkrb5.so -lcrypto ../lib/asn1/.libs/libasn1.so ../lib/vers/.libs/libvers.a ../lib/roken/.libs/libroken.so -lcrypt -ldb -lresolv -lpthread -pthread
/usr/bin/ld: digest-service.o: undefined reference to symbol 'heim_ntlm_calculate_ntlm1@@HEIMDAL_NTLM_1.0'/usr/bin/ld: note: 'heim_ntlm_calculate_ntlm1@@HEIMDAL_NTLM_1.0' is defined in DSO //home/brian/tree/heimdal/git/heimdal/lib/ntlm/.libs/libheimntlm.so.0 so try adding it to the linker command line
//home/brian/tree/heimdal/git/heimdal/lib/ntlm/.libs/libheimntlm.so.0: could not read symbols: Invalid operationcollect2: ld returned 1 exit statusmake[2]: *** [digest-service] Error 1
make[2]: Leaving directory `/home/brian/tree/heimdal/git/heimdal/kdc'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/home/brian/tree/heimdal/git/heimdal'make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2debuild: fatal error at line 1329:dpkg-buildpackage -rfakeroot -D -us -uc failed

At first glance this appears be clear, except the error goes away when compiling everything with -O2.

Any ideas?
What does the "Invalid operation" mean?
--
Brian May <brian@microcomaustralia.com.au>
 
Old 04-08-2011, 10:11 AM
Simon McVittie
 
Default compiling without -O2 ld shared lib errors

On Fri, 08 Apr 2011 at 14:49:42 +1000, Brian May wrote:
> /usr/bin/ld: digest-service.o: undefined reference to symbol
> 'heim_ntlm_calculate_ntlm1@@HEIMDAL_NTLM_1.0'
> /usr/bin/ld: note: 'heim_ntlm_calculate_ntlm1@@HEIMDAL_NTLM_1.0' is defined
> in DSO //home/brian/tree/heimdal/git/heimdal/lib/ntlm/.libs/libheimntlm.so.0
> so try adding it to the linker command line

The symbol is defined in libheimntlm.so.0, so try adding it to the linker
command line. :-)

This is the same thing as described in:

http://wiki.debian.org/qa.debian.org/FTBFS#A2009-11-02Packagesfailingbecausebinutils-gold.2BAC8-indirectlinking

http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

You can work around it with -Wl,--add-needed in LDFLAGS, or fix it properly
by including -lheimntlm in the LIBADD/LDADD for whatever you're linking.

S


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110408101145.GA6872@reptile.pseudorandom.co.uk"> http://lists.debian.org/20110408101145.GA6872@reptile.pseudorandom.co.uk
 
Old 04-11-2011, 11:33 PM
Brian May
 
Default compiling without -O2 ld shared lib errors

On 8 April 2011 20:11, Simon McVittie <smcv@debian.org> wrote:

You can work around it with -Wl,--add-needed in LDFLAGS, or fix it properly
by including -lheimntlm in the LIBADD/LDADD for whatever you're linking.
Thanks. Thought this might be the case.
However, that doesn't explain why it magically when compiling with -02. Are linker rules relaxed when they see code compiled with -O2? It doesn't make a lot of sense to me.

Unless maybe -O2 removes the entire function that references this symbol, because it is is not used anywhere... Hmmm.... Might have worked this out myself :-)
./kdc/digest-service.c:
=== cut ===static voidntlm_service(...){[...]ret = heim_ntlm_calculate_ntlm1(...)[...]}
[...]
intmain(int argc, char **argv){[...]#if __APPLE__** *{** * * *heim_sipc mach;** * * *heim_sipc_launchd_mach_init("org.h5l.ntlm-service",
** * * * * * * * * * * * * * * * * *ntlm_service, context, &mach);** * * *heim_sipc_timeout(60);** *}#endif[...]}=== cut ===

Am thinking the best solution might be to wrap the entire*ntlm_service function with the same*#if __APPLE__ ... #endif, as that appears to be the only reference to*ntlm_service, and I think the static definition means it can't be referenced externally.
--
Brian May <brian@microcomaustralia.com.au>
 
Old 04-12-2011, 06:35 AM
Simon McVittie
 
Default compiling without -O2 ld shared lib errors

On Tue, 12 Apr 2011 at 09:33:25 +1000, Brian May wrote:
> Am thinking the best solution might be to wrap the entire ntlm_service
> function with the same #if __APPLE__ ... #endif, as that appears to be the
> only reference to ntlm_service, and I think the static definition means it
> can't be referenced externally.

That's what I'd do. If it still compiles, then it's correct :-)

S


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110412063536.GB17756@reptile.pseudorandom.co.uk" >http://lists.debian.org/20110412063536.GB17756@reptile.pseudorandom.co.uk
 

Thread Tools




All times are GMT. The time now is 09:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org