[PATCH 1/4] aarch64: Add tests for Guarded Control Stack
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Tue Jan 28 14:28:40 GMT 2025
On 28/01/25 10:23, Yury Khrustalev wrote:
> 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.
I think we should LIBC_LINKER_FEATURE for now, it is used on some tests enablement
like have-z-execstack. But the CC and TEST_CC is a good point and we might
get back to this if/when CC and TEST_CC uses a liker with different support
(which I think was not taking in consideration for TEST_CC addition).
More information about the Libc-alpha
mailing list