After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584101 - Configure fails with kerberos and LDFLAGS="-Wl,--as-needed"
Configure fails with kerberos and LDFLAGS="-Wl,--as-needed"
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.26.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2009-05-28 08:49 UTC by Tiziano Müller
Modified: 2009-05-28 16:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
evolution-data-server-2.26.2-as-needed-configure.patch (1.31 KB, patch)
2009-05-28 08:50 UTC, Tiziano Müller
committed Details | Review

Description Tiziano Müller 2009-05-28 08:49:45 UTC
Please describe the problem:
when you enable kerberos support in configure and have LDFLAGS="-"Wl,--as-needed" configure bails out with the message of not finding the libraries:
checking for Kerberos 5... no
no
configure: error: You specified with krb5, but it was not found.



Steps to reproduce:
1. run configure with --with-krb5 and have LDFLAGS="-Wl,--as-needed"


Actual results:


Expected results:


Does this happen every time?


Other information:
The problem is that the libraries to link against are being added to LDFLAGS instead of LIBS resulting in the following gcc call:
gcc ${CFLAGS} ${LDFLAGS} -o conftest.o conftest
where LDFLAGS contains then "-Wl,--as-needed -lkrb5 ..."
meaning that symbols get stripped before conftest actually gets linked, thus the symbol krb5_init_... which conftest.o tries to use being undefined.
Adding -lkrb5... to LIBS adds them after conftest.c.
Comment 1 Tiziano Müller 2009-05-28 08:50:23 UTC
Created attachment 135486 [details] [review]
evolution-data-server-2.26.2-as-needed-configure.patch

and here's the patch for configure.in to solve the issue
Comment 2 Matthew Barnes 2009-05-28 14:52:34 UTC
$ LDFLAGS="-Wl,--as-needed" ./configure --with-krb5

The above command works fine for me on Fedora with or without the patch.  But your explanation is sound and Googling for similar cases show the same solution.