If you try to compile sssd with --as-needed in LDFLAGS, you will get error shown in the attachments. Without --as-needed it compiles fine. Please fix this.
Build log index.html
Fields changed
cc: => spamslepnoga@inbox.ru
Useful reference on what to do: http://www.gentoo.org/proj/en/qa/asneeded.xml
Sorry, but I could not reproduce the problem locally, neither with standard Fedora CFLAGS with "-Wl,--as-needed" added, nor with just as-needed.
Would you mind pasting the complete CFLAGS that trigger the error on you system? Thanks!
I just took a look at your build log. The failure here is because the following compile line is wrong:
libtool: link: x86_64-pc-linux-gnu-gcc -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -O2 -march=native -fomit-frame-pointer -mfpmath=sse+387 -mpc80 -msse3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -o krb5_child util/krb5_child-debug.o providers/krb5/krb5_child-krb5_become_user.o providers/krb5/krb5_child-krb5_child.o providers/krb5_child-child_common.o providers/krb5_child-dp_pam_data_util.o util/krb5_child-user_info_msg.o util/krb5_child-sss_krb5.o -O2 -march=native -fomit-frame-pointer -mfpmath=sse+387 -mpc80 -msse3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -ltalloc /usr/lib64/libpopt.so -L/usr/lib64 -Wl,--as-needed -lkrb5 -lk5crypto -lcom_err -lkeyutils -lresolv -ldl
This causes the error output:
providers/krb5_child-child_common.o: In function `write_pipe_recv': child_common.c:(.text+0x4d): undefined reference to `tevent_req_is_error'
(among others)
If you look at {{{Makefile.am}}}, you'll see that the krb5_child binary must be linked against an appropriate version of libtevent. Looking at your configure output, I see:
checking tevent.h usability... yes checking tevent.h presence... yes checking for tevent.h... yes checking for tevent_context_init in -ltevent... no
Configure should have failed here. This is a bug, we cannot function without tevent_context_init. I suspect that your build environment has a very old version of libtevent.
I suspect that your build environment has a very old version of libtevent. 1) Who configure does not make a mistake if "ent_context_init in -ltevent... no" ? Тhis error? 2)What is the latest version tevent? I'm using version 0.9.8 3)without LDFLAGS --as-neded (or filtering of the flag assembly system) build is fine
Please run the following command and tell me if there is any output (you may need to adjust the path to point to the correct library file on Gentoo):
readelf -s /usr/lib64/libtevent.so.0.9.8 |grep tevent_context_init
If this copy of libtevent is missing {{{tevent_context_init}}}, then the problem is there. Perhaps building libtevent with --as-needed resulted in that library not exporting all of the necessary functions because it couldn't be determined whether they were needed.
Also, to explain why there is a compilation failure here, it's this. There's a bug in the {{{configure}}} script. Right now, what it does is check whether the library has the tevent_context_init() function exposed, and if so, it sets the Make variables TEVENT_CFLAGS and TEVENT_LDFLAGS appropriately, so they can be used later when running make.
However, if it doesn't find tevent_context_init(), it is supposed to fail and throw an error, which it does not do. Right now it silently continues with the TEVENT_CFLAGS and TEVENT_LDFLAGS unset.
Without --as-needed, you may actually be succeeding at completing the build, but I suspect you would get a runtime error about a missing symbol when trying to open the shared library.
Replying to [comment:6 sgallagh]:
Please run the following command and tell me if there is any output (you may need to adjust the path to point to the correct library file on Gentoo): {{{ readelf -s /usr/lib64/libtevent.so.0.9.8 |grep tevent_context_init }}}
{{{ readelf -s /usr/lib64/libtevent.so.0.9.8 |grep tevent_context_init }}}
slep@mini ~ $ ls /usr/lib64/libtevent* /usr/lib64/libtevent.a /usr/lib64/libtevent.so /usr/lib64/libtevent.so.0 /usr/lib64/libtevent.so.0.9.8
slep@mini ~ $ readelf -s /usr/lib64/libtevent.so.0.9.8 |grep tevent_context_init 67: 00000000000029b0 7 FUNC GLOBAL DEFAULT 10 tevent_context_init 69: 00000000000028e0 202 FUNC GLOBAL DEFAULT 10 tevent_context_init_bynam
slep@mini ~ $ cat /var/db/pkg/sys-libs/tevent-0.9.8/LDFLAGS -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu
milestone: NEEDS_TRIAGE => SSSD 1.3.0
Hmm, strange. There's no reason that you should be failing this configure check that I can see... but you are.
Would you attach your config.log file to the ticket, please?
Specifically, I'm looking for the following lines in the config.log file in the src/ subdirectory of the tarball. Mine looks like this (when running with --as-needed):
configure:13837: checking for tevent_context_init in -ltevent configure:13862: gcc -o conftest -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wl,--as-needed conftest.c -ltevent >&5 configure:13862: $? = 0 configure:13871: result: yes
And the test program in use at this time looks like:
/* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tevent_context_init (); int main () { return tevent_context_init (); ; return 0; }
Some part of this is failing for you, since you're getting back "no" here instead of "yes", even though the symbol exists in your copy of libtevent.
attachment no-as-nedeed_config.log
attachment as-nedeed_config.log
Replying to [comment:9 sgallagh]:
Hmm, strange. There's no reason that you should be failing this configure check that I can see... but you are. Would you attach your config.log file to the ticket, please? Ок
Would you attach your config.log file to the ticket, please? Ок
Would you mind trying the attached patch to see if it resolves your problem?
Replying to [comment:12 sgallagh]:
Would you mind trying the attached patch to see if it resolves your problem? IMHO, you are doing it wrong. Configure test fails because '-ltalloc' is not passed to gcc at configure time, in compile time everything is ok. AC_CHECK_LIB has 5-th argument that sets extra libs passed to gcc while compiling test program, so it can be right to add '-ltalloc' there: {{{[AC_CHECK_LIB(tevent, tevent_context_init, [TEVENT_LIBS="-ltevent"],[],[-ltalloc])]}}}
Second try of patch to fix the configure check 0001-Require-ltalloc-for-tevent-configure-check.patch
You are absolutely correct. I miswrote that patch. (This is what happens when you try to fix a problem you can't locally reproduce).
Hopefully this new patch will work properly.
Please confirm whether the patch from 2010-07-22 worked.
owner: somebody => sgallagh status: new => assigned
Also please note that I identified two problems with as-needed on my Fedora box. A patch to fix these had been recently reviewed on list (https://fedorahosted.org/pipermail/sssd-devel/2010-July/004250.html). The problems were different from those you found, but chances are you would hit them later on.
as-needed
cc: spamslepnoga@inbox.ru => spamslepnoga@inbox.ru, jhrozek
We believe this issue to be resolved by caf595fa084d2e54dc82ca1a5659ce423b85ca0f and 8f7d6fac40cc2150e66701b00cba32d7dbe59a38
Without response from the original reporter, we are closing this bug.
fixedin: => 1.3.0 resolution: => fixed status: assigned => closed
rhbz: => 0
Metadata Update from @maksbotan: - Issue assigned to sgallagh - Issue set to the milestone: SSSD 1.3.0
SSSD is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in SSSD's github repository.
This issue has been cloned to Github and is available here: - https://github.com/SSSD/sssd/issues/1601
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.