[PATCH 1/4] aarch64: Add tests for Guarded Control Stack

Yury Khrustalev yury.khrustalev@arm.com
Tue Jan 28 13:23:06 GMT 2025


On Tue, Jan 28, 2025 at 08:49:00AM -0300, Adhemerval Zanella Netto wrote:
> 
> On 28/01/25 07:08, Yury Khrustalev wrote:
> > On Mon, Jan 27, 2025 at 05:47:21PM -0300, Adhemerval Zanella Netto wrote:
> >>
> >> On 23/01/25 11:13, Yury Khrustalev wrote:
> >>> These tests validate that GCS tunable works as expected depending
> >>> on the GCS markings in the test binaries.
> >>>
> >>> Tests validate both static and dynamically linked binaries.
> >>>
> >>> Test will build and run on AArch64 targets only and if GCS is not
> >>> enabled on the platform running tests, they will be reported as
> >>> UNSUPPORTED.
> >>>
> >>> When linking tests a new linker command line flag -z gcs=<value>
> >>> is used. If the toolchain used to build these tests doesn't support
> >>> this flag, there will be a warning that is expected and should be
> >>> ignored.
> >>
> >> I think it would be better to add a configure check for '-z gcs=' support
> >> and do not enable them if linker does not support it.
> > 
> > Such an option would only be needed for tests however it may give an
> > impression that it can be used for the library code as well which would
> > be incorrect. I'm not sure what is the best approach here but it would
> > be good to use some sort of test-only configuration.
> 
> But this would be done automatically and only enabled during tests, as we
> for various linker options on multiple Makefiles like have-test-stb-gnu-unique,
> have-fpie, have-test-cc-trampoline, etc.

Would LIBC_LINKER_FEATURE be appropriate here. I see that for compiler flags
support there is a desinction between CC and TEST_CC so probably it's the
same for linker? But I can't find something like LIBC_TEST_LINKER_FEATURE.

Kind regards,
Yury



More information about the Libc-alpha mailing list