#193 libbsd linking issues when lmdb is enabled


The check for liblmdb fails when linking to libbsd because the library path for the check is not complete.

For example, compare the check for smfi_version vs lmdb:

configure:16987: gcc -std=gnu99 -o conftest -pthread -g -O0 -I/opt/zimbra/sendmail/include -I/opt/zimbra/libxml2/include/libxml2 -I/opt/zimbra/cyrus-sasl- -I/opt/zimbra/libxml2/include -I/opt/zimbra/curl/include -I/opt/zimbra/libbsd/include -I/opt/zimbra/openssl-1.0.1f/include -I/opt/zimbra/libtool-2.2.6b/include -pthread -L/opt/zimbra/sendmail/lib -L/opt/zimbra/openssl-1.0.1f/lib -L/opt/zimbra/cyrus-sasl- -L/opt/zimbra/openldap- -L/opt/zimbra/libtool-2.2.6b/lib -L/opt/zimbra/libxml2/lib -L/opt/zimbra/libbsd/lib -Wl,-rpath,/opt/zimbra/libbsd/lib -Wl,-rpath,/opt/zimbra/openssl-1.0.1f/lib -Wl,-rpath,/opt/zimbra/cyrus-sasl- -Wl,-rpath,/opt/zimbra/openldap- -Wl,-rpath,/opt/zimbra/libtool-2.2.6b/lib conftest.c -lmilter -lbsd >&5

configure:19118: gcc -std=gnu99 -o conftest -pthread -I/opt/zimbra/libxml2/include/libxml2 -I/opt/zimbra/cyrus-sasl- -I/opt/zimbra/libxml2/include -I/opt/zimbra/curl/include -I/opt/zimbra/libbsd/include -I/opt/zimbra/openssl-1.0.1f/include -I/opt/zimbra/libtool-2.2.6b/include -L/opt/zimbra/openldap/lib conftest.c -llmdb -lbsd >&5
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lbsd

For lmdb, the -L/rpath bits are completely missing the pieces for libbsd, even though the path to libbsd is part of LDFLAGS


  • Quanah Gibson-Mount

    Problem appears to be this line:


    I think it should probably be something like:

                        LDFLAGS="$saved_ldflags -L$mdbpath/lib"
  • Quanah Gibson-Mount

    This fixed the build issue for me.

  • Murray S. Kucherawy

    Try this instead:

    LDFLAGS="-L$mdbpath/lib $STRL_LIBS"

  • Quanah Gibson-Mount

    That resolves the issue as well.

  • Murray S. Kucherawy

    Starting a 2.9.1 beta shortly; watch the opendkim lists for the announcement. This way we can be sure this and other issues are indeed fixed before releasing.

  • Quanah Gibson-Mount

    Never mind, it does NOT fix the issue. I built on the wrong platform.

    On the 3 platforms that have the issue, the above solution still fails with:

    configure:19118: gcc -std=gnu99 -o conftest -pthread -I/opt/zimbra/libxml2/include/libxml2 -I/opt/zimbra/cyrus-sasl- -I/opt/zimbra/libxml2/include -I/opt/zimbra/curl/include -I/opt/zimbra/libbsd/include -I/opt/zimbra/openssl-1.0.1f/include -I/opt/zimbra/libtool-2.2.6b/include -L/opt/zimbra/openldap/lib -lbsd conftest.c -llmdb -lbsd >&5
    /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lbsd
    /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lbsd
    collect2: ld returned 1 exit status
    configure:19118: $? = 1
    configure: failed program was:

  • Murray S. Kucherawy

    Can you attach a config.log from that run?

  • Murray S. Kucherawy

    • Priority: 1 --> 5
  • Murray S. Kucherawy

    Looks like I'm throwing away user-provided CPPFLAGS, LDFLAGS, etc. Need to fix that.

  • Murray S. Kucherawy

    Fixed in 2.9.1.Beta1.

  • Murray S. Kucherawy

    v2.9.1 released.

  • Murray S. Kucherawy

    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks