From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: bug#29186: building guile-emacs fails: required libaries not found: libjpeg Date: Wed, 08 Nov 2017 15:46:40 +0100 Message-ID: <87k1z0hlpr.fsf@gnu.org> References: <87po8vm4iv.fsf@gnu.org> <874lq6hbxn.fsf@netris.org> <87h8u6m311.fsf@gnu.org> <878tfhlxia.fsf@gnu.org> <20171108101226.GD1815@macbook41> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCReA-0006CQ-EP for bug-guix@gnu.org; Wed, 08 Nov 2017 09:48:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCRe6-0004rP-N2 for bug-guix@gnu.org; Wed, 08 Nov 2017 09:48:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:49172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eCRe6-0004rF-Gf for bug-guix@gnu.org; Wed, 08 Nov 2017 09:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eCRe6-0002UR-9w for bug-guix@gnu.org; Wed, 08 Nov 2017 09:48:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171108101226.GD1815@macbook41> (Efraim Flashner's message of "Wed, 8 Nov 2017 12:12:26 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Efraim Flashner Cc: 29186@debbugs.gnu.org --=-=-= Content-Type: text/plain Efraim Flashner writes: >> + (add-before 'configure 'setenv >> + (lambda _ >> + (setenv "CFLAGS" "-g"))) >> (add-after 'unpack 'autogen >> (lambda _ >> (zero? (system* "sh" "autogen.sh")))))))))) > > Couldn't this be a make-flag or a configure-flag? Yes, as a configure flags also works. However, I tracked down the segfault, backported a patch and and now it builds with -O2. New patch attached. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-guile-emacs-Resurrect-fixes-29186.patch Content-Transfer-Encoding: quoted-printable >From f6633adf4c5ceee3a63da9a3909a94c22f55b68a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 7 Nov 2017 08:08:21 +0100 Subject: [PATCH] gnu: guile-emacs: Resurrect, fixes #29186. * gnu/packages/patches/guile-emacs-fix-configure.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/emacs.scm (guile-emacs): Use it. Add workaround for src/deps dir creation. Fixes #29186. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 7 +- .../patches/guile-emacs-fix-configure.patch | 208 +++++++++++++++++= ++++ 3 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/guile-emacs-fix-configure.patch diff --git a/gnu/local.mk b/gnu/local.mk index ecee15b1d..71392d86c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -712,6 +712,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/guile-present-coding.patch \ %D%/packages/patches/guile-relocatable.patch \ %D%/packages/patches/guile-rsvg-pkgconfig.patch \ + %D%/packages/patches/guile-emacs-fix-configure.patch \ %D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \ %D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \ %D%/packages/patches/gtk2-theme-paths.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 45e0635de..502d83b5f 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -276,6 +276,7 @@ editor (without an X toolkit)" ) (uri (git-reference (url "git://git.hcoop.net/git/bpt/emacs.git") (commit "41120e0f595b16387eebfbf731fff70481de1b4b"))) + (patches (search-patches "guile-emacs-fix-configure.patch")) (sha256 (base32 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6")))) @@ -294,7 +295,11 @@ editor (without an X toolkit)" ) `(modify-phases ,phases (add-after 'unpack 'autogen (lambda _ - (zero? (system* "sh" "autogen.sh")))))))))) + (zero? (system* "sh" "autogen.sh")))) + ;; Build sometimes fails: deps/dispnew.d: No such file or direc= tory + (add-before 'build 'make-deps-dir + (lambda _ + (zero? (system* "mkdir" "-p" "src/deps")))))))))) =20 ;;; diff --git a/gnu/packages/patches/guile-emacs-fix-configure.patch b/gnu/pac= kages/patches/guile-emacs-fix-configure.patch new file mode 100644 index 000000000..374972359 --- /dev/null +++ b/gnu/packages/patches/guile-emacs-fix-configure.patch @@ -0,0 +1,208 @@ +Two patches here backporting fixes from emacs master. + +From dfcb3b6ff318e47b84a28cfc43f50bec42fa3570 Mon Sep 17 00:00:00 2001 +From: Jan Nieuwenhuizen +Date: Tue, 7 Nov 2017 18:48:03 +0100 +Subject: [PATCH 1/2] backport: Port jpeg configuration to Solaris 10 with = Sun + C. + +* configure.ac: Check for jpeglib 6b by trying to link it, instead +of relying on cpp magic that has problems in practice. Check for +both jpeglib.h and jerror.h features. Remove special case for +mingw32, which should no longer be needed (and if it were needed, +should now be addressable by hotwiring emacs_cv_jpeglib). +Fixes: bug#20332 + + From fdf532b9c915ad9ba72155646d29d0f530fd72ec Mon Sep 17 00:00:00 2001 + From: Paul Eggert + Date: Wed, 15 Apr 2015 18:30:01 -0700 + Subject: [PATCH] Port jpeg configuration to Solaris 10 with Sun C. + + * configure.ac: Check for jpeglib 6b by trying to link it, instead + of relying on cpp magic that has problems in practice. Check for + both jpeglib.h and jerror.h features. Remove special case for + mingw32, which should no longer be needed (and if it were needed, + should now be addressable by hotwiring emacs_cv_jpeglib). + Fixes: bug#20332 +--- + configure.ac | 72 ++++++++++++++++++++++++++++---------------------------= ----- + 1 file changed, 34 insertions(+), 38 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2445db4886..36fa8eb390 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3014,44 +3014,40 @@ AC_SUBST(LIBXPM) + ### mingw32 doesn't use -ljpeg, since it loads the library dynamically. + HAVE_JPEG=3Dno + LIBJPEG=3D +-if test "${opsys}" =3D "mingw32"; then +- if test "${with_jpeg}" !=3D "no"; then +- dnl Checking for jpeglib.h can lose because of a redefinition of +- dnl HAVE_STDLIB_H. +- AC_CHECK_HEADER(jerror.h, HAVE_JPEG=3Dyes, HAVE_JPEG=3Dno) +- fi +- AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpe= g).])dnl +- if test "${HAVE_JPEG}" =3D "yes"; then +- AC_DEFINE(HAVE_JPEG) +- AC_EGREP_CPP([version=3D *(6[2-9]|[7-9][0-9])], +- [#include +- version=3DJPEG_LIB_VERSION +-], +- [AC_DEFINE(HAVE_JPEG)], +- [AC_MSG_WARN([libjpeg found, but not version 6b or later]) +- HAVE_JPEG=3Dno]) +- fi +-elif test "${HAVE_X11}" =3D "yes" || test "${HAVE_W32}" =3D "yes"; then +- if test "${with_jpeg}" !=3D "no"; then +- dnl Checking for jpeglib.h can lose because of a redefinition of +- dnl HAVE_STDLIB_H. +- AC_CHECK_HEADER(jerror.h, +- [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=3Dyes)]) +- fi +- +- AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpe= g).])dnl +- if test "${HAVE_JPEG}" =3D "yes"; then +- AC_DEFINE(HAVE_JPEG) +- AC_EGREP_CPP([version=3D *(6[2-9]|[7-9][0-9])], +- [#include +- version=3DJPEG_LIB_VERSION +-], +- [AC_DEFINE(HAVE_JPEG)], +- [AC_MSG_WARN([libjpeg found, but not version 6b or later]) +- HAVE_JPEG=3Dno]) +- fi +- if test "${HAVE_JPEG}" =3D "yes"; then +- LIBJPEG=3D-ljpeg ++if test "${with_jpeg}" !=3D "no"; then ++ AC_CACHE_CHECK([for jpeglib 6b or later], ++ [emacs_cv_jpeglib], ++ [OLD_LIBS=3D$LIBS ++ for emacs_cv_jpeglib in yes -ljpeg no; do ++ case $emacs_cv_jpeglib in ++ yes) ;; ++ no) break;; ++ *) LIBS=3D"$LIBS $emacs_cv_jpeglib";; ++ esac ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision. */ ++ #include /* jpeglib.h needs FILE and size_t. */ ++ #include ++ #include ++ char verify[JPEG_LIB_VERSION < 62 ? -1 : 1]; ++ struct jpeg_decompress_struct cinfo; ++ ]], ++ [[ ++ jpeg_create_decompress (&cinfo); ++ WARNMS (&cinfo, JWRN_JPEG_EOF); ++ jpeg_destroy_decompress (&cinfo); ++ ]])], ++ [emacs_link_ok=3Dyes], ++ [emacs_link_ok=3Dno]) ++ LIBS=3D$OLD_LIBS ++ test $emacs_link_ok =3D yes && break ++ done]) ++ if test "$emacs_cv_jpeglib" !=3D no; then ++ HAVE_JPEG=3Dyes ++ AC_DEFINE([HAVE_JPEG], 1, ++ [Define to 1 if you have the jpeg library (typically -ljpeg).]) ++ test "$emacs_cv_jpeglib" !=3D yes && LIBJPEG=3D$emacs_cv_jpeglib + fi + fi + AC_SUBST(LIBJPEG) +--=20 +Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org +Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com + +From f761b92d520b72954be28ad66eb82d1a96c785fb Mon Sep 17 00:00:00 2001 +From: Jan Nieuwenhuizen +Date: Wed, 8 Nov 2017 14:05:43 +0100 +Subject: [PATCH 2/2] backport fix for #24065: calloc loop when compiling w= ith + -O2. + +This patch fixes + + EMACSLOADPATH=3D '../src/bootstrap-emacs' -batch --no-site-file --no-s= ite-lisp -l autoload \ + --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ + --eval "(setq generated-autoload-file (expand-file-name + (unmsys--file-name + \"../../git-checkout/lisp/calendar/cal-loaddefs.el\")))" \ + -f batch-update-autoloads ../../git-checkout/lisp/calendar + make[2]: *** [Makefile:466: ../../git-checkout/lisp/calendar/cal-loadd= efs.el] Segmentation fault + +in gdb seen as + + in calloc (nmemb=3D, size=3Dsize@entry=3D1) at gmalloc.c:1510 + +I did not find malloc-fixing commits from emacs master to cleanly +cherry-pick, so this patch replaces the relevant part in configure +(emacs 53da55b8cc45e76b836ebaadd23f46e92d25abce). + +* configure.ac: backport system_malloc/hybrid_malloc detection. +--- + configure.ac | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 36fa8eb390..3cc1794f37 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1966,7 +1966,25 @@ case "$opsys" in + darwin|mingw32|sol2-10) system_malloc=3Dyes ;; + esac +=20 ++hybrid_malloc=3D ++system_malloc=3Dyes ++ ++test "$CANNOT_DUMP" =3D yes || ++case "$opsys" in ++ ## darwin ld insists on the use of malloc routines in the System framew= ork. ++ darwin | mingw32 | nacl | sol2-10) ;; ++ cygwin) hybrid_malloc=3Dyes ++ system_malloc=3D ;; ++ *) test "$ac_cv_func_sbrk" =3D yes && system_malloc=3D$emacs_cv_sanitiz= e_address;; ++esac ++ ++if test "${system_malloc}" !=3D yes && test "${doug_lea_malloc}" !=3D yes= \ ++ && test "${UNEXEC_OBJ}" =3D unexelf.o; then ++ hybrid_malloc=3Dyes ++fi ++ + GMALLOC_OBJ=3D ++HYBRID_MALLOC=3D + if test "${system_malloc}" =3D "yes"; then + AC_DEFINE([SYSTEM_MALLOC], 1, + [Define to 1 to use the system memory allocator, even if it is not +@@ -1975,6 +1993,14 @@ if test "${system_malloc}" =3D "yes"; then + GNU_MALLOC_reason=3D" + (The GNU allocators don't work with this system configuration.)" + VMLIMIT_OBJ=3D ++elif test "$hybrid_malloc" =3D yes; then ++ AC_DEFINE(HYBRID_MALLOC, 1, ++ [Define to use gmalloc before dumping and the system malloc after.]) ++ HYBRID_MALLOC=3D1 ++ GNU_MALLOC=3Dno ++ GNU_MALLOC_reason=3D" (only before dumping)" ++ GMALLOC_OBJ=3Dgmalloc.o ++ VMLIMIT_OBJ=3D + else + test "$doug_lea_malloc" !=3D "yes" && GMALLOC_OBJ=3Dgmalloc.o + VMLIMIT_OBJ=3Dvm-limit.o +@@ -1993,10 +2019,11 @@ else + of the main data segment.]) + fi + fi ++AC_SUBST([HYBRID_MALLOC]) + AC_SUBST(GMALLOC_OBJ) + AC_SUBST(VMLIMIT_OBJ) +=20 +-if test "$doug_lea_malloc" =3D "yes" ; then ++if test "$doug_lea_malloc" =3D "yes" && test "$hybrid_malloc" !=3D yes; t= hen + if test "$GNU_MALLOC" =3D yes ; then + GNU_MALLOC_reason=3D" + (Using Doug Lea's new malloc from the GNU C Library.)" +--=20 +Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org +Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com + --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--