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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 24 May 2023 18:51:11 +0300

> From: Kaushal Modi <[email-masked]>
> Date: Wed, 24 May 2023 11:39:20 -0400
> Cc: [email-masked]
> 
> This issue happened to me again, but now I know what causes it.
> 
> - I was building Emacs from a terminal with gcc 9.3.0 loaded.
> - I was launching emacsclient from a terminal with gcc 9.1.0 loaded.

Sorry, I don't understand: what does it mean "terminal with gcc X.Y.Z
loaded"? how is GCC "loaded" in those cases?

> Note to self: Ensure that the gcc versions used for building and running emacs are the exact same
> (incl the minor versions).

That's not a requirement.  What _is_ a requirement is that when you
upgrade your GCC installation, you need to restart Emacs, if the
running Emacs session was built with native compilation, so that Emacs
starts using the version of GCC that you have installed for future
compilations.  But the *.eln files that were built by libgccjit of one
version should be fully usable after you upgrade to another version.

> On the same note, is it possible for Emacs to give a more informative error that says that libgcc of
> X.Y.Z version was not found?

That error doesn't come from Emacs, it comes from the GCC compilation
driver.  We just report it, as it was reported to us.