GNU bug report logs - #57380
29.0.50; configure --config-cache --with-native-compilation failing

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Wed, 24 Aug 2022 12:10:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57380 in the body.
You can then email your comments to 57380 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 12:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gerd Möllmann <gerd.moellmann <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 Aug 2022 12:10:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; configure --config-cache --with-native-compilation failing
Date: Wed, 24 Aug 2022 14:09:07 +0200
In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.5.1 (Build 21G83)) of 2022-08-23 built on
 Mini.fritz.box
Repository revision: 1f990d1cf95930a584a7f70f002f284e273b6fd6
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.5.1

Steps to reproduce:

./configure --config-cache --with-native-compilation
touch configure
make

or, alternatively

./configure --config-cache --with-native-compilation
./configure --config-cache --with-native-compilation

Result

The second configure, in the first recipe this is './config.status
--recheck', fails with

checking for gcc_jit_context_acquire in -lgccjit... (cached) yes
checking for libgccjit.h... (cached) yes
configure: error: The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.

Config.log says

configure:19611: checking for libgccjit.h
configure:19611: result: yes
configure:19674: gcc -o conftest -g -O2     conftest.m -lgccjit -lsqlite3   -L/opt/homebrew/Cellar/libgccjit/12.1.0/lib/gcc/current >&5
conftest.m:131:12: fatal error: 'libgccjit.h' file not found
  #include <libgccjit.h>
           ^~~~~~~~~~~~~
1 error generated.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 12:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50;
 configure --config-cache --with-native-compilation failing
Date: Wed, 24 Aug 2022 15:31:20 +0300
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Date: Wed, 24 Aug 2022 14:09:07 +0200
> 
> The second configure, in the first recipe this is './config.status
> --recheck', fails with
> 
> checking for gcc_jit_context_acquire in -lgccjit... (cached) yes
> checking for libgccjit.h... (cached) yes
> configure: error: The installed libgccjit failed to compile and run a test program using
> the libgccjit library; see config.log for the details of the failure.
> 
> Config.log says
> 
> configure:19611: checking for libgccjit.h
> configure:19611: result: yes
> configure:19674: gcc -o conftest -g -O2     conftest.m -lgccjit -lsqlite3   -L/opt/homebrew/Cellar/libgccjit/12.1.0/lib/gcc/current >&5
> conftest.m:131:12: fatal error: 'libgccjit.h' file not found
>   #include <libgccjit.h>
>            ^~~~~~~~~~~~~
> 1 error generated.

Does the command to compile the test program look different in a
config.log from a successful build?  If so, what is the difference?
(Perhaps some -I switch is missing?)  And if there's no difference,
how come the same command sometimes succeeds and sometimes fails?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 12:56:02 GMT) Full text and rfc822 format available.

Message #11 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 14:55:25 +0200
On 22-08-24 14:31 , Eli Zaretskii wrote:
>> configure:19611: checking for libgccjit.h
>> configure:19611: result: yes
>> configure:19674: gcc -o conftest -g -O2     conftest.m -lgccjit -lsqlite3   -L/opt/homebrew/Cellar/libgccjit/12.1.0/lib/gcc/current >&5
>> conftest.m:131:12: fatal error: 'libgccjit.h' file not found
>>    #include <libgccjit.h>
>>             ^~~~~~~~~~~~~
>> 1 error generated.
> 
> Does the command to compile the test program look different in a
> config.log from a successful build?  If so, what is the difference?
> (Perhaps some -I switch is missing?)  And if there's no difference,
> how come the same command sometimes succeeds and sometimes fails?

Yeah, they are vastly different:

configure:19674: gcc -o conftest -g3 -O2 -isystem 
/opt/homebrew/Cellar/libffi/3.4.2/include -isystem 
/opt/homebrew/Cellar/librsvg/2.54.4/include/librsvg-2.0 -isystem 
/opt/homebrew/Cellar/gdk-pixbuf/2.42.9/include/gdk-pixbuf-2.0 -isystem 
/opt/homebrew/Cellar/jpeg-turbo/2.1.4...

I'd bet a small mount that these come from configure.ac:4266 ff.

      if test -n "$MAC_CFLAGS" && test -n "$MAC_LIBS"; then
        CFLAGS="$CFLAGS ${MAC_CFLAGS}"
        LIBS="$LIBS ${MAC_LIBS}"
      fi
...
    AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
...
    CFLAGS=$SAVE_CFLAGS
    LIBS=$SAVE_LIBS
fi

AC_RUN_IFELSE is apparently run differently when using the cache, or 
something like that.

Hm.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 13:31:02 GMT) Full text and rfc822 format available.

Message #14 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 15:30:43 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> AC_RUN_IFELSE is apparently run differently when using the cache, or
> something like that.

Success and failure

configure:19674: gcc -o conftest -g3 -O2 ...   conftest.c
configure:19674: gcc -o conftest -g -O2  ...   conftest.m
                                                       ^^

Baffled.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 13:38:01 GMT) Full text and rfc822 format available.

Message #17 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 15:37:16 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

>
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>> AC_RUN_IFELSE is apparently run differently when using the cache, or
>> something like that.
>
> Success and failure
>
> configure:19674: gcc -o conftest -g3 -O2 ...   conftest.c
> configure:19674: gcc -o conftest -g -O2  ...   conftest.m
>                                                        ^^
>
> Baffled.

diff --git a/configure.ac b/configure.ac
index 7616e450d0..08a41a7808 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4273,6 +4273,7 @@ AC_DEFUN
       [], [libgccjit_not_found])
     AC_CHECK_HEADERS([libgccjit.h], [], [libgccjit_dev_not_found])
     # Check if libgccjit really works.
+    AC_LANG(C)
     AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
     HAVE_NATIVE_COMP=yes
     case "${opsys}" in

This makes it work for me.

It that something for emacs-28, or rather not? Guess not, but just in
case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 14:24:02 GMT) Full text and rfc822 format available.

Message #20 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 17:23:01 +0300
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Cc: 57380 <at> debbugs.gnu.org
> Date: Wed, 24 Aug 2022 15:37:16 +0200
> 
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
> 
> >
> > Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
> >
> >> AC_RUN_IFELSE is apparently run differently when using the cache, or
> >> something like that.
> >
> > Success and failure
> >
> > configure:19674: gcc -o conftest -g3 -O2 ...   conftest.c
> > configure:19674: gcc -o conftest -g -O2  ...   conftest.m
> >                                                        ^^
> >
> > Baffled.
> 
> diff --git a/configure.ac b/configure.ac
> index 7616e450d0..08a41a7808 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -4273,6 +4273,7 @@ AC_DEFUN
>        [], [libgccjit_not_found])
>      AC_CHECK_HEADERS([libgccjit.h], [], [libgccjit_dev_not_found])
>      # Check if libgccjit really works.
> +    AC_LANG(C)
>      AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
>      HAVE_NATIVE_COMP=yes
>      case "${opsys}" in
> 
> This makes it work for me.

Doh!  Do you understand why it is only needed in one of the two cases?

And doesn't it affect the following tests?

> It that something for emacs-28, or rather not? Guess not, but just in
> case.

What does this call produce in the configure script?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 14:33:02 GMT) Full text and rfc822 format available.

Message #23 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 16:32:20 +0200
On Aug 24 2022, Gerd Möllmann wrote:

> diff --git a/configure.ac b/configure.ac
> index 7616e450d0..08a41a7808 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -4273,6 +4273,7 @@ AC_DEFUN
>        [], [libgccjit_not_found])
>      AC_CHECK_HEADERS([libgccjit.h], [], [libgccjit_dev_not_found])
>      # Check if libgccjit really works.
> +    AC_LANG(C)
>      AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
>      HAVE_NATIVE_COMP=yes
>      case "${opsys}" in
>
> This makes it work for me.

That appears to be a misuse of AC_LANG_PUSH/POP.  Apparently they must
not be used inside AC_CACHE_CHECK.

diff --git a/configure.ac b/configure.ac
index 7616e450d0..39bfe7800b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2155,32 +2155,32 @@ AC_SUBST([NS_OBJ])
 AC_SUBST([NS_OBJC_OBJ])
 
 if test "${HAVE_NS}" = yes; then
+  AC_LANG_PUSH([Objective C])
   AC_CACHE_CHECK(
     [if the Objective C compiler supports instancetype],
     [emacs_cv_objc_instancetype],
-    [AC_LANG_PUSH([Objective C])
-     AC_COMPILE_IFELSE(
+    [AC_COMPILE_IFELSE(
        [AC_LANG_SOURCE([[@interface Test
                           + (instancetype)test;
                           @end]])],
        [emacs_cv_objc_instancetype=yes],
-       [emacs_cv_objc_instancetype=no])
-     AC_LANG_POP([Objective C])])
+       [emacs_cv_objc_instancetype=no])])
+  AC_LANG_POP([Objective C])
 
   if test x$emacs_cv_objc_instancetype = xyes ; then
     AC_DEFINE([NATIVE_OBJC_INSTANCETYPE], [1],
               [Define if ObjC compiler supports instancetype natively.])
   fi
 
+  AC_LANG_PUSH([Objective C])
   AC_CACHE_CHECK(
     [if the Objective C compiler defaults to C99],
     [emacs_cv_objc_c99],
-    [AC_LANG_PUSH([Objective C])
-     AC_COMPILE_IFELSE(
+    [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([], [[for (int i = 0;;);]])],
        [emacs_cv_objc_c99=yes],
-       [emacs_cv_objc_c99=no])
-     AC_LANG_POP([Objective C])])
+       [emacs_cv_objc_c99=no])])
+  AC_LANG_POP([Objective C])
 
    if test x$emacs_cv_objc_c99 = xno ; then
      GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -std=c99"

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Wed, 24 Aug 2022 16:21:01 GMT) Full text and rfc822 format available.

Message #26 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Wed, 24 Aug 2022 18:20:23 +0200
Andreas Schwab <schwab <at> suse.de> writes:

> That appears to be a misuse of AC_LANG_PUSH/POP.  Apparently they must
> not be used inside AC_CACHE_CHECK.

That explains it, I guess.

Works for me on master.  Thanks, Andreas!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57380; Package emacs. (Thu, 25 Aug 2022 09:17:02 GMT) Full text and rfc822 format available.

Message #29 received at 57380 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 57380 <at> debbugs.gnu.org
Subject: Re: bug#57380: 29.0.50; configure --config-cache
 --with-native-compilation failing
Date: Thu, 25 Aug 2022 11:16:01 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

>
> Andreas Schwab <schwab <at> suse.de> writes:
>
>> That appears to be a misuse of AC_LANG_PUSH/POP.  Apparently they must
>> not be used inside AC_CACHE_CHECK.
>
> That explains it, I guess.
>
> Works for me on master.  Thanks, Andreas!

Down from 4:30 to 3:40 for a build starting from git clean -xdf, with a
cache file outside of the worktree, with Anreas' fix.

Nice :-)




bug marked as fixed in version 29.1, send any further explanations to 57380 <at> debbugs.gnu.org and Gerd Möllmann <gerd.moellmann <at> gmail.com> Request was from Gerd Möllmann <gerd.moellmann <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 25 Aug 2022 09:17:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Sep 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.