Subject: bug#42651: emacs-27.1-rc1 and wrong GnuPG libraries

From: Jeffrey Walton <[email-masked]>
Date: Sat, 1 Aug 2020 11:22:32 -0400

On Sat, Aug 1, 2020 at 11:21 AM Jeffrey Walton <[email-masked]> wrote:
>
> On Sat, Aug 1, 2020 at 11:17 AM Eli Zaretskii <[email-masked]> wrote:
> >
> > > From: Jeffrey Walton <[email-masked]>
> > > Date: Sat, 1 Aug 2020 11:14:25 -0400
> > > Cc: [email-masked]
> > >
> > > On Sat, Aug 1, 2020 at 11:11 AM Eli Zaretskii <[email-masked]> wrote:
> > > >
> > > > > From: Jeffrey Walton <[email-masked]>
> > > > > Date: Sat, 1 Aug 2020 11:05:00 -0400
> > > > > Cc: [email-masked]
> > > > >
> > > > > On Sat, Aug 1, 2020 at 11:04 AM Eli Zaretskii <[email-masked]> wrote:
> > > > > >
> > > > > > > From: Jeffrey Walton <[email-masked]>
> > > > > > > Date: Sat, 1 Aug 2020 10:51:54 -0400
> > > > > > >
> > > > > > > I was looking at the ldd dependencies of emacs-27.1-rc1. It shows a
> > > > > > > dependency on GnuPG warez:
> > > > > >
> > > > > > Why is that a problem?
> > > > >
> > > > > The wrong library.
> > > >
> > > > Which one?
> > >
> > > Both libgcrypt.so and libgpg-error.so.
> >
> > So you would like your own libraries linked into Emacs, is that the
> > issue here?  If so, I think you need to set up your build to look
> > there, by setting LDFLAGS at configure time.  Would that solve the
> > problem?
>
> LDFLAGS is set. Here are the flags I use for every package I build on Linux.
>
>  AUTOCONF_BUILD: x86_64-pc-linux-gnu
> PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
>        CPPFLAGS: -I/usr/local/include -DNDEBUG
>         ASFLAGS: -Wa,--noexecstack
>          CFLAGS: -g2 -O2 -march=native -fPIC -pthread
>        CXXFLAGS: -g2 -O2 -march=native -fPIC -pthread
>         LDFLAGS: -L/usr/local/lib -Wl,-R,'$ORIGIN/../lib'
> -Wl,-R,/usr/local/lib -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now
> -Wl,-z,noexecstack -Wl,-z,origin
>          LDLIBS: -ldl -lpthread

My bad... Here are the flags for this particular configuration
(prefix=$HOME/tmp/ok2delete):

 AUTOCONF_BUILD: x86_64-pc-linux-gnu
PKG_CONFIG_PATH: /home/jwalton/tmp/ok2delete/lib/pkgconfig
       CPPFLAGS: -I/home/jwalton/tmp/ok2delete/include -DNDEBUG
        ASFLAGS: -Wa,--noexecstack
         CFLAGS: -g2 -O2 -march=native -fPIC -pthread
       CXXFLAGS: -g2 -O2 -march=native -fPIC -pthread
        LDFLAGS: -L/home/jwalton/tmp/ok2delete/lib
-Wl,-R,'$ORIGIN/../lib' -Wl,-R,/home/jwalton/tmp/ok2delete/lib
-Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack
-Wl,-z,origin
         LDLIBS: -ldl -lpthread