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

From: Doug Davis <[email-masked]>
Date: Fri, 04 Jun 2021 12:04:01 -0400

Alan Third <[email-masked]> writes:

> On Fri, Jun 04, 2021 at 05:15:23PM +0300, Eli Zaretskii wrote:
>> > From: Niels Søndergaard <[email-masked]>
>> > Date: Fri, 4 Jun 2021 16:08:10 +0200
>> > Cc: Niels Søndergaard <[email-masked]>,
>> >  Alan Third <[email-masked]>,
>> >  Konrad Podczeck <[email-masked]>,
>> >  [email-masked]
>> >
>> > Yes, 10.2.0_4
>> >
>> > installed by Homebrew ben default on my machine

Homebrew provides binaries for gcc 11.1 and libgccjit 11.1. The
libgccjit page quotes 11.1 as the current version
(https://formulae.brew.sh/formula/libgccjit) Perhaps try to track down
why your Homebrew installation isn't finding the latest formula?

>>
>> That's the problem: AFAIK Emacs cannot be built on macOS with GCC.
>> And I don't think not specifying --with-ns avoids that problem.
>
> --with-ns is the default on macOS, so to build with GCC you need to
> specify --without-ns. But that's probably not what's wanted here.
>
> Neils, if you followed the suggestion elsewhere in this thread to set
> CC, please undo that and let configure find clang.
>
> Make sure you have the latest libgccjit installed with homebrew
> (version 11?).

With the latest gcc & libgccjit installed I'm writing this email from
the Emacs master branch on an M1 MacBook Air compiled with:

$ CFLAGS="-O3 -g3 -I/opt/homebrew/opt/libgccjit/include" LDFLAGS="-L/opt/homebrew/opt/libgccjit/lib/gcc/11/" ./configure --with-native-compilation
$ make -j7
$ src/emacs