NetBSD Problem Report #53688

From gson@gson.org  Sat Oct 27 12:10:58 2018
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 787267A167
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 27 Oct 2018 12:10:58 +0000 (UTC)
Message-Id: <20181027121054.55EF8989376@guava.gson.org>
Date: Sat, 27 Oct 2018 15:10:54 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: emacs25 linking fails with undefined reference to epoxy_has_glx
X-Send-Pr-Version: 3.95

>Number:         53688
>Category:       pkg
>Synopsis:       emacs25 build fails with undefined reference to epoxy_has_glx
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    leot
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 27 12:15:00 +0000 2018
>Closed-Date:    Sun Oct 28 12:22:27 +0000 2018
>Last-Modified:  Mon Jan 14 20:25:00 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD 8.0 or -current
>Organization:
>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

When I try to build the editors/emacs25 packge on either NetBSD 8.0
or -current, it fails with the error message

  /usr/pkgsrc/editors/emacs25/work/.buildlink/lib/libgdk-3.so: undefined reference to `epoxy_has_glx'

The NetBSD-current test run was on a freshly installed OS, using a
pkgsrc.tar.gz from ftp.netbsd.org with a timestamp of Oct 27 02:14
UTC.  In an earlier test on NetBSD-current where I accidentally used
the pkgsrc.tar.gz from Oct 20, emacs25 built successfully, so the
problem must have been introduced in the meantime, perhaps by
gtk3+-3.24.1.

Riccardo Mottola reported the same problem but with emacs26, on -current:

  http://mail-index.netbsd.org/current-users/2018/10/23/msg034424.html

In the ensuing discussion, Greg Troxel asked:
> And did it build libepoxy in this case?

Yes, both with the Oct 20 and the Oct 27 pkgsrc.  With the Oct 20
pkgsrc, the log from building emacs25 from scratch contains:

  => Returning to build of gtk3+-3.22.30nb3
  [...]
  => Full dependency libepoxy>=1.2nb2: NOT found
  [...]
  => Fetching libepoxy-1.4.3.tar.gz

and with the Oct 27 pkgsrc:

  => Returning to build of gtk3+-3.24.1
  [...]
 => Full dependency libepoxy>=1.4: NOT found
  [...]
  => Fetching libepoxy-1.4.3.tar.gz

Only in the latter case does /usr/pkg/lib/libgdk-3.so contain a
reference to epoxy_has_glx.

Comparing gtk3/work/.work.log between the two pkgsrc versions, the
first line mentioning epoxy in the Oct 20 one is

  [*] /usr/pkgsrc/x11/gtk3/work/.tools/bin/pkg-config --exists --print-errors pango pangocairo gdk-pixbuf-2.0 >= 2.30.0 cairo >= 1.14.0 cairo-gobject >= 1.14.0 gio-unix-2.0 >= 2.49.4 fontconfig x11 xext xinerama xi xrandr xcursor xfixes xcomposite xdamage    cairo-xlib epoxy >= 1.0

and in the Oct 27 one:

  [*] /usr/pkgsrc/x11/gtk3/work/.tools/bin/pkg-config --exists --print-errors pango pangocairo gdk-pixbuf-2.0 >= 2.30.0 cairo >= 1.14.0 cairo-gobject >= 1.14.0 gio-unix-2.0 >= 2.53.4 fontconfig x11 xext xinerama xi xrandr xcursor xfixes xcomposite xdamage    cairo-xlib epoxy >= 1.4 

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->leot
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Sat, 27 Oct 2018 12:24:19 +0000
Responsible-Changed-Why:
I have probably break it (due missing BUILDLINK_API_DEPENDS.libepoxy
in buildlink3.mk).


From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53688 CVS commit: pkgsrc/x11/gtk3
Date: Sat, 27 Oct 2018 12:28:28 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Sat Oct 27 12:28:28 UTC 2018

 Modified Files:
 	pkgsrc/x11/gtk3: buildlink3.mk

 Log Message:
 gtk3: Add a missing BUILDLINK_API_DEPENDS.libepoxy in buildlink3.mk

 libepoxy>=1.4 is needed but in buildlink3.mk no such bond was specified leading
 to link issues when building packages including gtk3 bl3.

 Should fix PR pkg/53688.


 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 pkgsrc/x11/gtk3/buildlink3.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: leot@NetBSD.org
State-Changed-When: Sat, 27 Oct 2018 12:45:47 +0000
State-Changed-Why:
After:

 cvs rdiff -u -r1.34 -r1.35 pkgsrc/x11/gtk3/buildlink3.mk

the problem should be fixed.

Andreas, can you please retry to rebuild emacs25 (or any other
problematic package) - `make replace' should be enough - and
let me know if the problem is fixed.

If yes I will then revbump due that change.

Sorry for breaking that and thank you!


From: Andreas Gustafsson <gson@gson.org>
To: leot@NetBSD.org
Cc: gnats-bugs@NetBSD.org, Riccardo Mottola <riccardo.mottola@libero.it>, Greg Troxel <gdt@lexort.com>
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to epoxy_has_glx)
Date: Sat, 27 Oct 2018 16:56:22 +0300

 > Andreas, can you please retry to rebuild emacs25 (or any other
 > problematic package) - `make replace' should be enough - and
 > let me know if the problem is fixed.

 I did a "make replace" in both x11/gtk3 and editors/emacs25 on the 8.0
 system, but the emacs build still failed the same way as before.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to epoxy_has_glx)
Date: Sat, 27 Oct 2018 19:47:50 +0200

 Hello Andreas,

 Andreas Gustafsson writes:
 >
 >  > Andreas, can you please retry to rebuild emacs25 (or any other
 >  > problematic package) - `make replace' should be enough - and
 >  > let me know if the problem is fixed.
 >  =

 >  I did a "make replace" in both x11/gtk3 and editors/emacs25 on the 8.0
 >  system, but the emacs build still failed the same way as before.

 I can reproduce that too now.
 Maya (thanks!) suggested to add `-Wl,--verbose' to show more
 information about what's going on and indeed adding that to
 `temacs$(EXEEXT):' target in ${WRKSRC}/src/Makefile points out the
 following:

  libepoxy.so.0 needed by /tmp/pkgsrc/editors/emacs25/work/.buildlink/lib/l=
 ibgtk-3.so
  found libepoxy.so.0 at /usr/X11R7/lib/libepoxy.so.0

 (Unfortunately I have still no idea why that happens, but I guess
 that previously this probably worked accidentally because no
 `epoxy_has_glx' was used (i.e. native epoxy 1.3.1 wasn't problematic in
 that case))

From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53688 CVS commit: pkgsrc/editors/emacs25
Date: Sat, 27 Oct 2018 20:36:51 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Sat Oct 27 20:36:51 UTC 2018

 Modified Files:
 	pkgsrc/editors/emacs25: Makefile distinfo
 Added Files:
 	pkgsrc/editors/emacs25/patches: patch-configure patch-configure.ac

 Log Message:
 emacs25: Do not (manually) inject X11 LDFLAGS via configure

 On NetBSD and OpenBSD the configure script injects LD_SWITCH_X_SITE_RPATH
 (e.g.  `-Wl,-rpath,/usr/X11R7/lib') early as LDFLAGS leading to link with
 possible X11 native libraries when it is not requested.

 Should fix PR pkg/53688.

 Bump PKGREVISION

 Thanks to <maya> for debug-fu help!


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/editors/emacs25/Makefile
 cvs rdiff -u -r1.8 -r1.9 pkgsrc/editors/emacs25/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/editors/emacs25/patches/patch-configure \
     pkgsrc/editors/emacs25/patches/patch-configure.ac

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53688 CVS commit: pkgsrc/editors/emacs26
Date: Sat, 27 Oct 2018 20:58:39 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Sat Oct 27 20:58:39 UTC 2018

 Modified Files:
 	pkgsrc/editors/emacs26: Makefile distinfo
 Added Files:
 	pkgsrc/editors/emacs26/patches: patch-configure patch-configure.ac

 Log Message:
 emacs26: Do not (manually) inject X11 LDFLAGS via configure

 On NetBSD and OpenBSD the configure script injects LD_SWITCH_X_SITE_RPATH
 (e.g.  `-Wl,-rpath,/usr/X11R7/lib') early as LDFLAGS leading to link with
 possible X11 native libraries when it is not requested.

 Should fix PR pkg/53688.

 Bump PKGREVISION

 Thanks to <maya> for debug-fu help!


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/editors/emacs26/Makefile
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/editors/emacs26/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/editors/emacs26/patches/patch-configure \
     pkgsrc/editors/emacs26/patches/patch-configure.ac

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to epoxy_has_glx)
Date: Sat, 27 Oct 2018 23:04:12 +0200

 Leonardo Taccari writes:
 > (Unfortunately I have still no idea why that happens, but I guess
 > that previously this probably worked accidentally because no
 > `epoxy_has_glx' was used (i.e. native epoxy 1.3.1 wasn't problematic in
 > that case))

 emacs25 configure script was basically injecting
 `-Wl,-rpath,/usr/X11R7/lib' (or similar) early in the LDFLAGS on
 NetBSD and OpenBSD so that's probably why it always tried to link
 against native X11 libraries if it was able to find them.

 emacs25-25.3nb10 (and emacs26-26.1nb3) should now work.

 Andreas can you please try it and let me know if that fixes the
 problem also for you?


 Thank you!

From: Andreas Gustafsson <gson@gson.org>
To: Leonardo Taccari <leot@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to epoxy_has_glx)
Date: Sun, 28 Oct 2018 14:16:19 +0200

 Leonardo Taccari wrote:
 >  emacs25-25.3nb10 (and emacs26-26.1nb3) should now work.
 >  
 >  Andreas can you please try it and let me know if that fixes the
 >  problem also for you?

 Yes, emacs25 now builds successfully for me on both 8.0 and -current.
 Thank you!
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: feedback->closed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Sun, 28 Oct 2018 12:22:27 +0000
State-Changed-Why:
Fixed in emacs25-25.3nb10 and emacs26-26.1nb3.

Thank you Andreas for the PR, analysis and feedback!


From: Riccardo Mottola <riccardo.mottola@libero.it>
To: Andreas Gustafsson <gson@gson.org>, leot@NetBSD.org
Cc: gnats-bugs@NetBSD.org, Greg Troxel <gdt@lexort.com>
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to
 epoxy_has_glx)
Date: Sun, 28 Oct 2018 19:25:15 +0100

 Hi,

 On 10/27/18 3:56 PM, Andreas Gustafsson wrote:
 >> Andreas, can you please retry to rebuild emacs25 (or any other
 >> problematic package) - `make replace' should be enough - and
 >> let me know if the problem is fixed.
 > I did a "make replace" in both x11/gtk3 and editors/emacs25 on the 8.0
 > system, but the emacs build still failed the same way as before.


 I also did try "replacing" liboeboxy again, then gtk3 and then emacs, 
 but no help.


 Riccardo

From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53688 (emacs25 build fails with undefined reference to epoxy_has_glx)
Date: Sun, 28 Oct 2018 21:17:40 +0100

 Hello Riccardo,

 Riccardo Mottola writes:
 > I also did try "replacing" liboeboxy again, then gtk3 and then emacs, 
 > but no help.

 Does this happen also with emacs25-25.3nb10 and/or emacs26-26.1nb3?
 (both should contain a fix for this PR)

From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53688 CVS commit: pkgsrc/editors/vim-gtk3
Date: Mon, 14 Jan 2019 20:20:22 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Mon Jan 14 20:20:22 UTC 2019

 Modified Files:
 	pkgsrc/editors/vim-gtk3: Makefile

 Log Message:
 vim-gtk3: Fix gtk3 build after gtk3 3.24.1 update

 vim-gtk3 was affected by a problem similar to PR pkg/53688, and
 the test failed to recognize gtk3 due `undefined reference to
 `epoxy_has_glx'' when `checking for GTK - version >= 3.0.0' in the
 configure phase because instead of linking to pkgsrc libepoxy it
 linked against builtin libepoxy.  Despite that it successfully
 built without gtk3 support but gvim failed at run time with
 `E25: GUI cannot be used: Not enabled at compile time' error.

 Sort x11 bl3 includes so instead of failing at run time it fails
 at build time when linking vim.

 Add a kludge to override `--x-libraries' and `--x-includes' passed
 by x11.buildlink3.mk to avoid linking against builtin libepoxy and
 fix gtk3 support.

 Thanks to and discussed with <rhialto> and <morr>!


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 pkgsrc/editors/vim-gtk3/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.