undefined reference to `__aarch64_cas4_sync' error on arm64 native build

Segher Boessenkool segher at kernel.crashing.org
Tue Jan 9 00:26:47 PST 2024


On Tue, Jan 09, 2024 at 04:09:20PM +0800, Xi Ruoyao wrote:
> If GCC is configured with things like --with-arch=something, libgcc can
> contain (FP/vector) instructions unsafe to use in kernel w/o special
> handling.

No, it can not.  Please file a bug (<https://gcc.gnu.org/bugs.html>) if
this happens to you.  Thanks!

--with-arch= only sets the *default* options, the user can override this
always (with an -march= option, say).

> If libgcc is so vital GCC needs to provide a way to make it work for a
> set of compiler switches incompatible with any pre-built multilib.  For
> example, installing the source of libgcc into /usr/lib/gcc and provide a
> tool to build a libgcc.a with the specified options.

That is how things are supposed to work, already.  Either libgcc uses
only instructions that work everywhere, or libgcc is multilibbed, things
like that.  In all normal cases this is completely transparent to the
compiler user.


Segher



More information about the linux-arm-kernel mailing list