unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
@ 2022-08-24 12:09 Gerd Möllmann
  2022-08-24 12:31 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-24 12:09 UTC (permalink / raw)
  To: 57380

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.





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 12:09 bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing Gerd Möllmann
@ 2022-08-24 12:31 ` Eli Zaretskii
  2022-08-24 12:55   ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-08-24 12:31 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57380

> From: Gerd Möllmann <gerd.moellmann@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?





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 12:31 ` Eli Zaretskii
@ 2022-08-24 12:55   ` Gerd Möllmann
  2022-08-24 13:30     ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-24 12:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57380

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.





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 12:55   ` Gerd Möllmann
@ 2022-08-24 13:30     ` Gerd Möllmann
  2022-08-24 13:37       ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-24 13:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57380

Gerd Möllmann <gerd.moellmann@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.





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 13:30     ` Gerd Möllmann
@ 2022-08-24 13:37       ` Gerd Möllmann
  2022-08-24 14:23         ` Eli Zaretskii
  2022-08-24 14:32         ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-24 13:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57380

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

>
> Gerd Möllmann <gerd.moellmann@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.





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 13:37       ` Gerd Möllmann
@ 2022-08-24 14:23         ` Eli Zaretskii
  2022-08-24 14:32         ` Andreas Schwab
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-08-24 14:23 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57380

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 57380@debbugs.gnu.org
> Date: Wed, 24 Aug 2022 15:37:16 +0200
> 
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> 
> >
> > Gerd Möllmann <gerd.moellmann@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?





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 13:37       ` Gerd Möllmann
  2022-08-24 14:23         ` Eli Zaretskii
@ 2022-08-24 14:32         ` Andreas Schwab
  2022-08-24 16:20           ` Gerd Möllmann
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2022-08-24 14:32 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Eli Zaretskii, 57380

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@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 14:32         ` Andreas Schwab
@ 2022-08-24 16:20           ` Gerd Möllmann
  2022-08-25  9:16             ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-24 16:20 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Eli Zaretskii, 57380

Andreas Schwab <schwab@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!





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

* bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing
  2022-08-24 16:20           ` Gerd Möllmann
@ 2022-08-25  9:16             ` Gerd Möllmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Möllmann @ 2022-08-25  9:16 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Eli Zaretskii, 57380

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

>
> Andreas Schwab <schwab@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 :-)





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

end of thread, other threads:[~2022-08-25  9:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 12:09 bug#57380: 29.0.50; configure --config-cache --with-native-compilation failing Gerd Möllmann
2022-08-24 12:31 ` Eli Zaretskii
2022-08-24 12:55   ` Gerd Möllmann
2022-08-24 13:30     ` Gerd Möllmann
2022-08-24 13:37       ` Gerd Möllmann
2022-08-24 14:23         ` Eli Zaretskii
2022-08-24 14:32         ` Andreas Schwab
2022-08-24 16:20           ` Gerd Möllmann
2022-08-25  9:16             ` Gerd Möllmann

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).