[PATCH v6 09/14] aarch64: ensure objects are BTI compatible

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jul 6 18:17:41 GMT 2020



On 06/07/2020 15:01, Szabolcs Nagy wrote:
> The 07/06/2020 14:37, Adhemerval Zanella via Libc-alpha wrote:
>> On 01/07/2020 11:39, Szabolcs Nagy wrote:
>>> When glibc is built with branch protection (i.e. with a gcc configured
>>> with --enable-standard-branch-protection), all glibc binaries should
>>> be BTI compatible and marked as such.
>>>
>>> It is easy to link BTI incompatible objects by accident and this is
>>> silent currently which is usually not the expectation, so this is
>>> changed into a link error. (There is no linker flag for failing on
>>> BTI incompatible inputs so all warnings are turned into fatal errors
>>> outside the test system when building glibc with branch protection.)
>>>
>>> Unfortunately, outlined atomic functions are not BTI compatible in
>>> libgcc (PR libgcc/96001), so to build glibc with current gcc use
>>> 'CC=gcc -mno-outline-atomics', this should be fixed in libgcc soon
>>> and then glibc can be built and tested without such workarounds.
>>
>> Is the outlined atomic present in any current released gcc? If so
>> should we add a configure handler to add -mno-outline-atomics for
>> such cases?
> 
> outlined atomics is supported for a while now (since
> gcc-9 i think) but it is now the default in gcc-10.
> 
> i am testing patches to fix libgcc in gcc trunk and
> then backport to gcc-10 branch.
> 
> my preference is to only support fixed gcc and use
> the -mno-outline-atomics as a temporary workaround
> so we can test the patches with gcc-10.1.0
> 
> it's not a good workaround for using the resulting
> toolchain for building user code with branch protection
> (which will have the same problem: silently dropping
> bti protection) so i think it's better to fail the build.

Right, I think it should be ok to sign it with a build failure.


More information about the Libc-alpha mailing list