Subject: Re: bug#48804: 27.2; compilation emacs on macOS

From: Eli Zaretskii <[email-masked]>
Date: Fri, 04 Jun 2021 21:55:50 +0300

> From: Niels Søndergaard <[email-masked]>
> Date: Fri, 4 Jun 2021 17:15:30 +0200
> Cc: Alan Third <[email-masked]>,
>  Eli Zaretskii <[email-masked]>,
>  [email-masked],
>  [email-masked]
> 
> with: ./configure --without-ns --with-x-toolkit=no -with-native-compilation --with-mailutils
> which is not what I really wants,
> 
> we’re back to the original failure:
> 
> checking libgccjit.h usability... yes
> checking libgccjit.h presence... yes
> checking for libgccjit.h... 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.
> The test program can be found here:
> <https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
> You can try compiling it yourself to investigate the issues.
> Please report the issue to your distribution if libgccjit was installed
> through that.

Don't set CC in the environment.  Instead, add the directory where the
gcc compiler driver (the 'gcc' executable file) is installed to your
PATH, but after the directory where clang is installed.  Also, make
sure you don't have on PATH a 'gcc' executable that actually calls
clang.

The problem is that you need clang as your compiler to build Emacs,
but you need to arrange for libgccjit to find 'gcc' and its C compiler
('cc1').