SSSD / sssd

A daemon to manage identity, authentication and authorization for centrally-managed systems.
https://sssd.io
GNU General Public License v3.0
588 stars 238 forks source link

gentoo: Linking issue in idmap test program with samba 4.10.6 #5040

Closed sssd-bot closed 1 year ago

sssd-bot commented 4 years ago

Cloned from Pagure issue: https://pagure.io/SSSD/sssd/issue/4072


I have been unable to build sssd 2.2.0 on a gentoo system due to the idmap test failing to build. As such, the output obtained from configure is

checking Samba's idmap plugin interface version... idmap test result is: 127
configure: error: Cannot determine Samba's idmap interface version, please use --with-smb-idmap-interface-version

The test program requires two additional libraries in order to be built. That would be replace-samba4 and smbd-shim-samba4.

Replacing line 63,

LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -Wl,-rpath ${sambalibdir}"

with

LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -lreplace-samba4 -lsmbd-shim-samba4 -Wl,-rpath ${sambalibdir}"

in src/external/samba.m4 produces a valid result on the idmap test.

Comments


Comment from thalman at 2020-03-13 15:44:03

Metadata Update from @thalman:

joakim-tjernlund commented 4 years ago

Please add to current release, this bug makes sssd hard to build on Gentoo. I had to apply my own patch to get sssd to build

razamatan commented 4 years ago
--- a/src/external/samba.m4     2020-05-25 03:05:00.774374354 -0700
+++ b/src/external/samba.m4     2020-05-25 03:05:45.620224889 -0700
@@ -60,7 +60,7 @@
         SAVE_CFLAGS=$CFLAGS
         SAVE_LIBS=$LIBS
         CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS $NDR_NBT_CFLAGS $NDR_KRB5PAC_CFLAGS"
-        LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -Wl,-rpath ${sambalibdir}"
+        LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -lreplace-samba4 -lsmbd-shim-samba4 -Wl,-rpath ${sambalibdir}"
         AC_RUN_IFELSE(
             [AC_LANG_SOURCE([
 #include <stdlib.h>
joakim-tjernlund commented 4 years ago

This has to be on my system:

--- a/src/external/samba.m4     2020-05-25 03:05:00.774374354 -0700
+++ b/src/external/samba.m4     2020-05-25 03:05:45.620224889 -0700
@@ -60,7 +60,7 @@
         SAVE_CFLAGS=$CFLAGS
         SAVE_LIBS=$LIBS
         CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS $NDR_NBT_CFLAGS $NDR_KRB5PAC_CFLAGS"
-        LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -Wl,-rpath ${sambalibdir}"
+        LIBS="$LIBS -L${sambalibdir} -Wl,--no-as-needed -lidmap-samba4 -lreplace-samba4 -lsmbd-shim-samba4 -Wl,-rpath ${sambalibdir}"
         AC_RUN_IFELSE(
             [AC_LANG_SOURCE([
 #include <stdlib.h>

Otherwise it still fails on some machines.

FYI, other distributions using -Wl,--as-needed will also suffer from this.

joakim-tjernlund commented 4 years ago

Any chance you can add this patch to sssd? It will unbreak dists. which build samba/sssd with --as-needed

joakim-tjernlund commented 4 years ago

Ping?

andreboscatto commented 1 year ago

Hi @joakim-tjernlund

We are going through a triage over a lot of issues, sorry to get back only now.

We wanted to confirm, is this still a valid issue? If yes, can you please go ahead and open a PR?

Kind regards

joakim-tjernlund commented 1 year ago

Hi @joakim-tjernlund

We are going through a triage over a lot of issues, sorry to get back only now.

We wanted to confirm, is this still a valid issue? If yes, can you please go ahead and open a PR?

Kind regards

No, samba has changed how the libs are linked in recent releases. Works OK now

alexey-tikhonov commented 1 year ago

Thank you for the confirmation.