Subject: bug#63523: 29.0.90; Failing to find -lgcc when running emacsclient

From: Kaushal Modi <[email-masked]>
Date: Mon, 15 May 2023 14:46:48 -0400

--
Kaushal Modi

On Mon, May 15, 2023 at 2:32 PM Eli Zaretskii <[email-masked]> wrote:

>
> This error doesn't come from emacsclient, it comes from the async
> native compilation.  Did you upgrade your system lately, in particular
> GCC and/or Binutils?
>

I have been using the same gcc and ld versions for few years now.

> ld --version
GNU ld version 2.27-44.base.el7
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.

> gcc --version
gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> See? it's ld, the linker, complaining that it cannot find a library
> (libgcc) it needs for producing the .eln file.
>

But it works in non-daemon mode i.e. if I run emacs instead of emacsclient.

> You should verify your libgccjit installation is working correctly.
> Which GCC version do you have?
>

9.3.0

Also please see the attached screenshot. I am showing there the the
libgccjit.so should have been found (it is anyways found correctly when I
run non-daemon emacs).

> FWIW, I have no problems building the current emacs-29 branch with
> native-compilation.

Same here. The build finishes successfully. The problem shows when I launch
emacsclient.

>   I just tried.
>
> > In GNU Emacs 29.0.90 (build 3, x86_64-pc-linux-gnu, GTK+ Version
> >  3.22.30, cairo version 1.15.12) of 2023-05-12 built on
> >  kmodi-lx01.engus1.analog.com
> > Repository revision: 09d6070e56ea21a5e9720bc619c439c09e5b2680
> > Repository branch: emacs-29
>
> This is not the latest emacs-29 branch, btw (not that I expect a
> slightly outdated revision of the branch to fail to compile).
>

I just rebuilt emacs with --bootstrap now this error is gone!

> emacs --version
GNU Emacs 29.0.91
Development version c18f9f155f6a on emacs-29 branch; build date 2023-05-15.

> emacsclient --version
emacsclient 29.0.91

It looks like I landed on an intermediate commit while this issue existed
around 05/12. But as of the c18f9f155f6a commit, this issue is gone.

Thank you for looking into this!

This issue can be closed.