unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
@ 2018-02-12  6:18 Robert Cochran
  2018-02-12 15:39 ` Michael Heerdegen
  2018-02-12 19:13 ` Glenn Morris
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Cochran @ 2018-02-12  6:18 UTC (permalink / raw)
  To: 30431


Build fails with an undefined symbol reference:

CCLD     temacs
/usr/bin/ld: image.o: undefined reference to symbol 'png_set_sig_bytes@@PNG16_0'
//usr/lib64/libpng16.so.16: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:606: temacs] Error 1
make[1]: Leaving directory '/home/Sora/Programming/emacs/src'
make: *** [Makefile:418: src] Error 2

OS is Fedora 27 amd64, libpng is libpng.1.6.31-1.fc27.x86_64

Please let me know if more details are required.

Thanks!


In GNU Emacs 27.0.50 (build 1, x86_64-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-02-08 built on SoraLaptop
Repository revision: a710f8aa61ca73054109dc4f926d1ac6aabdd849
Windowing system distributor 'Fedora Project', version 11.0.11906000
System Description: Fedora 27 (Workstation Edition)

Recent messages:
Loading battery...done
Loading time...done
Loading gnus...done
Loading paren...done
Loading /home/Sora/.emacs.d/customize.el (source)...done
(New file)
Loading /home/Sora/quicklisp/slime-helper.el (source)...done
Starting Emacs daemon.
Restarting server
When done with this frame, type C-x 5 0

Configured using:
 'configure --prefix=/home/Sora/local --with-dbus --with-gif --with-jpeg
 --with-png --with-tiff --with-xft --with-xpm --with-x-toolkit=athena
 --with-gpm=no --with-modules --with-gnutls --with-gconf
 --with-imagemagick --with-rsvg --with-libotf --with-m17n_flt
 build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security
 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
 --param=ssp-buffer-size=4 -grecord-gcc-switches
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  global-auto-complete-mode: t
  auto-complete-mode: t
  paredit-mode: t
  whitespace-mode: t
  show-paren-mode: t
  display-time-mode: t
  display-battery-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime dig mailcap emacsbug sendmail slime-fancy slime-trace-dialog
slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
cl-extra flymake-proc flymake warnings elec-pair lisp-mnt gud apropos
compile etags xref project arc-mode archive-mode hyperspec thingatpt
browse-url cl slime-autoloads org-rmail org-mhe org-irc org-info
org-gnus nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec epa derived epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus-win org-docview doc-view jka-compr image-mode dired dired-loaddefs
org-bibtex bibtex org-bbdb org-w3m org-element avl-tree generator org
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint
ob-core ob-eval org-compat org-macs org-loaddefs format-spec cal-menu
calendar cal-loaddefs firestorm-notes ace-window avy
auto-complete-config auto-complete popup paredit-menu paredit
interactify-count-lines lisp-family maybe-bussard-lua lua-mode advice
edmacro kmacro rx comint ansi-color ring maybe-gnu-c cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
ispell-email ispell rotate-split neato-graph-bar ert help-mode pp
find-func ewoc debug tls gnutls whitespace finder-inf tex-site info
package easymenu epg-config url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars
deeper-blue-theme paren gnus seq byte-opt gv bytecomp byte-compile cconv
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
time-date mail-utils mm-util mail-prsvr wid-edit cl-loaddefs cl-lib time
battery cus-start cus-load server mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 440328 43165)
 (symbols 48 48296 4)
 (miscs 40 132 141)
 (strings 32 128361 4226)
 (string-bytes 1 3894108)
 (vectors 16 46648)
 (vector-slots 8 898336 24044)
 (floats 8 317 228)
 (intervals 56 403 0)
 (buffers 992 14))

-- 
~Robert Cochran

GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE  E7B9 EC9A 872C 41B2 77C2





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12  6:18 bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure Robert Cochran
@ 2018-02-12 15:39 ` Michael Heerdegen
  2018-02-12 16:07   ` Michael Heerdegen
  2018-02-12 19:13 ` Glenn Morris
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2018-02-12 15:39 UTC (permalink / raw)
  To: 30431

Robert Cochran <robert+Emacs@cochranmail.com> writes:

> Build fails with an undefined symbol reference:
>
> CCLD     temacs
> /usr/bin/ld: image.o: undefined reference to symbol 'png_set_sig_bytes@@PNG16_0'
> //usr/lib64/libpng16.so.16: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:606: temacs] Error 1
> make[1]: Leaving directory '/home/Sora/Programming/emacs/src'
> make: *** [Makefile:418: src] Error 2
>
> OS is Fedora 27 amd64, libpng is libpng.1.6.31-1.fc27.x86_64

Same build error here on Debian testing.  Dropping the cited commit
doesn't seem to help, though.


Michael.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12 15:39 ` Michael Heerdegen
@ 2018-02-12 16:07   ` Michael Heerdegen
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2018-02-12 16:07 UTC (permalink / raw)
  To: 30431

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Same build error here on Debian testing.  Dropping the cited commit
> doesn't seem to help, though.

This commit has been reverted now.  After cleaning up the working tree,
the problem is gone for me.

I guess we can close this report?


Thanks,

Michael.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12  6:18 bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure Robert Cochran
  2018-02-12 15:39 ` Michael Heerdegen
@ 2018-02-12 19:13 ` Glenn Morris
  2018-02-12 19:42   ` Paul Eggert
  1 sibling, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2018-02-12 19:13 UTC (permalink / raw)
  To: Robert Cochran; +Cc: Paul Eggert, 30431


AFAICS, the issue is that the CHECK_MODULES method sets PNG_LIBS (and
PNG_CFLAGS), whereas the old method sets LIBPNG (and PNG_CFLAGS).

So revert the reversion, and then apply eg:

--- a/configure.ac
+++ b/configure.ac
@@ -3613,7 +3613,9 @@ elif test "${with_png}" != no; then
     AC_CHECK_HEADER([png.h], [HAVE_PNG=yes])
   elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
    EMACS_CHECK_MODULES([PNG], [libpng >= 1.0.0])
-   if test $HAVE_PNG = no; then
+   if test $HAVE_PNG = yes; then
+    LIBPNG="$PNG_LIBS"
+   else
     # Test old way in case pkg-config doesn't have it (older machines).
     AC_MSG_CHECKING([for libpng not configured by pkg-config])
 

(Might want to move the "append -lz to LIBPNG" to outside the conditional too.)






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12 19:13 ` Glenn Morris
@ 2018-02-12 19:42   ` Paul Eggert
  2018-02-12 21:31     ` Werner LEMBERG
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Eggert @ 2018-02-12 19:42 UTC (permalink / raw)
  To: Glenn Morris, Robert Cochran; +Cc: 30431

On 02/12/2018 11:13 AM, Glenn Morris wrote:
> AFAICS, the issue is that the CHECK_MODULES method sets PNG_LIBS (and
> PNG_CFLAGS), whereas the old method sets LIBPNG (and PNG_CFLAGS).
>
> So revert the reversion, and then apply eg:
>
> --- a/configure.ac
> +++ b/configure.ac
> @@ -3613,7 +3613,9 @@ elif test "${with_png}" != no; then
>       AC_CHECK_HEADER([png.h], [HAVE_PNG=yes])
>     elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
>      EMACS_CHECK_MODULES([PNG], [libpng >= 1.0.0])
> -   if test $HAVE_PNG = no; then
> +   if test $HAVE_PNG = yes; then
> +    LIBPNG="$PNG_LIBS"
> +   else
>       # Test old way in case pkg-config doesn't have it (older machines).
>       AC_MSG_CHECKING([for libpng not configured by pkg-config])

Thanks, Glenn. Werner, does that work for you?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12 19:42   ` Paul Eggert
@ 2018-02-12 21:31     ` Werner LEMBERG
  2018-02-13  0:42       ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: Werner LEMBERG @ 2018-02-12 21:31 UTC (permalink / raw)
  To: eggert; +Cc: 30431

>> -   if test $HAVE_PNG = no; then
>> +   if test $HAVE_PNG = yes; then
>> +    LIBPNG="$PNG_LIBS"
>> +   else
> 
> Thanks, Glenn. Werner, does that work for you?

It works just fine, thanks!


    Werner





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure
  2018-02-12 21:31     ` Werner LEMBERG
@ 2018-02-13  0:42       ` Paul Eggert
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggert @ 2018-02-13  0:42 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: 30431

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On 02/12/2018 01:31 PM, Werner LEMBERG wrote:
>>> -   if test $HAVE_PNG = no; then
>>> +   if test $HAVE_PNG = yes; then
>>> +    LIBPNG="$PNG_LIBS"
>>> +   else
>> Thanks, Glenn. Werner, does that work for you?
> It works just fine, thanks!
>
>
>      Werner

Thanks for checking. I installed the attached patch, which attempts to 
implement Glenn's suggestion.


[-- Attachment #2: 0001-Work-if-libpng-is-in-usr-local-2nd-try.patch --]
[-- Type: text/x-patch, Size: 3726 bytes --]

From 52d34fbc84c1d87a41c435a0db9494d768ebc667 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 12 Feb 2018 16:39:56 -0800
Subject: [PATCH] Work if libpng is in /usr/local (2nd try)

Problem reported by Werner Lemberg in:
https://lists.gnu.org/r/emacs-devel/2018-02/msg00304.html
with a further fix suggested by Glenn Morris in Bug#30431#14.
* configure.ac: Try pkg-config before libpng-config.
Adjust LIBPNG accordingly, and append -lz regardless of
whether it was pkg-config.
---
 configure.ac | 75 ++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 42 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index f2a8332d71..cb452e053b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3612,39 +3612,48 @@ AC_DEFUN
   if test "$opsys" = mingw32; then
     AC_CHECK_HEADER([png.h], [HAVE_PNG=yes])
   elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
-    AC_MSG_CHECKING([for png])
-    png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` &&
-    png_ldflags=`(libpng-config --ldflags) 2>&AS_MESSAGE_LOG_FD` || {
-      # libpng-config does not work; configure by hand.
-      # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
-      # in /usr/include/libpng.
-      if test -r /usr/include/libpng/png.h &&
-	 test ! -r /usr/include/png.h; then
-	png_cflags=-I/usr/include/libpng
-      else
-	png_cflags=
-      fi
-      png_ldflags='-lpng'
-    }
-    SAVE_CFLAGS=$CFLAGS
-    SAVE_LIBS=$LIBS
-    CFLAGS="$CFLAGS $png_cflags"
-    LIBS="$png_ldflags -lz -lm $LIBS"
-    AC_LINK_IFELSE(
-      [AC_LANG_PROGRAM([[#include <png.h>]],
-	 [[return !png_get_channels (0, 0);]])],
-      [HAVE_PNG=yes
-       PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"`
-       LIBPNG=$png_ldflags
-       # $LIBPNG requires explicit -lz in some cases.
-       # We don't know what those cases are, exactly, so play it safe and
-       # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ.
-       if test -n "$LIBPNG" && test -z "$LIBZ"; then
-	 LIBPNG="$LIBPNG -lz"
-       fi])
-    CFLAGS=$SAVE_CFLAGS
-    LIBS=$SAVE_LIBS
-    AC_MSG_RESULT([$HAVE_PNG])
+    EMACS_CHECK_MODULES([PNG], [libpng >= 1.0.0])
+    if test $HAVE_PNG = yes; then
+      LIBPNG=$PNG_LIBS
+    else
+      # Test old way in case pkg-config doesn't have it (older machines).
+      AC_MSG_CHECKING([for libpng not configured by pkg-config])
+
+      png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` &&
+      png_ldflags=`(libpng-config --ldflags) 2>&AS_MESSAGE_LOG_FD` || {
+	# libpng-config does not work; configure by hand.
+	# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
+	# in /usr/include/libpng.
+	if test -r /usr/include/libpng/png.h &&
+	   test ! -r /usr/include/png.h; then
+	  png_cflags=-I/usr/include/libpng
+	else
+	  png_cflags=
+	fi
+	png_ldflags='-lpng'
+      }
+      SAVE_CFLAGS=$CFLAGS
+      SAVE_LIBS=$LIBS
+      CFLAGS="$CFLAGS $png_cflags"
+      LIBS="$png_ldflags -lz -lm $LIBS"
+      AC_LINK_IFELSE(
+	[AC_LANG_PROGRAM([[#include <png.h>]],
+	   [[return !png_get_channels (0, 0);]])],
+	[HAVE_PNG=yes
+	 PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"`
+	 LIBPNG=$png_ldflags])
+      CFLAGS=$SAVE_CFLAGS
+      LIBS=$SAVE_LIBS
+      AC_MSG_RESULT([$HAVE_PNG])
+    fi
+
+    # $LIBPNG requires explicit -lz in some cases.
+    # We don't know what those cases are, exactly, so play it safe and
+    # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ.
+    case " $LIBPNG ",$LIBZ in
+      *' -lz '*, | *' ',?*) ;;
+      *) LIBPNG="$LIBPNG -lz" ;;
+    esac
   fi
 fi
 if test $HAVE_PNG = yes; then
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-13  0:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12  6:18 bug#30431: 27.0.50; "Work even if libpng is install in /usr/local" causes build failure Robert Cochran
2018-02-12 15:39 ` Michael Heerdegen
2018-02-12 16:07   ` Michael Heerdegen
2018-02-12 19:13 ` Glenn Morris
2018-02-12 19:42   ` Paul Eggert
2018-02-12 21:31     ` Werner LEMBERG
2018-02-13  0:42       ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).