[PATCH 2/7] RISC-V: Add Zbb optimized memchr as ifunc

Kito Cheng kito.cheng@sifive.com
Mon May 6 13:58:17 GMT 2024


> > `target` attribute is provided by GCC 14, and `-march=+ext` will at
> > least require GCC 15 (if we add),
> > also we relaxed the canonical order requirement for `-march=`, that
> > means we can relatively easy to manipulate the ISA
> > string by just concat that? so I don't really think we need  `-march=+ext`.
>
> Then we require the Makefile author to:
> 1) parse if the current compiler flags include march (repeat for all
> variables that may be used)
> 2a) if so, then amend to that
> 2b) if not, parse if there is a configured default ISA (via "gcc -v")
> 2ba) if so, then create -march accordingly
> 2bb) if not, then <fail to amend>
>
> Bonus problem:
> If there are multiple variables that might set -march=... this gets
> even trickier because
> the order how these variables are integrated in the compiler
> invocation command is unknown.
>
> Using "-march=+zfoo" seems simpler and cleaner.

I agree it will require the compiler to parse the gcc -v to obtain the
default -march, it might be a burden,
but AArch64 also does not allow -march=+ext only it requires
-march=arch{+[no]feature}*,
so I am wondering why do we need that to resolve/improve ifunc
implementation but not `target` attribute and `.option arch, +ext`?


More information about the Libc-alpha mailing list