# Re: \[PATCH 3/3\] powerpc: Include -m32 / -m64 for stack protector Kconfig test

- From: Keith Packard \<keithp@keithp.com\>
- Date: 2024-10-08 21:19:51 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2024/10/9534638
- Thread: https://ratatoskr.run/linuxppc-dev/2024/10/9534625/t.md

```text

> Why is there any restriction at all on which register can be used ? I 
> can't see such restriction in GCC documentation : 
> https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html

The clang implementation shares the same code paths as the user space
thread local storage implementation. That code uses a fixed register (2
for 32-bit, 13 for 64-bit) and a fixed offset (-0x7008 for 32-bit and
-0x7010 for 64-bit).

The new code controls the offset value with a command line parameter.

I didn't see any need to make the changes more complicated by including
support for arbitrary registers. The implementation would be reasonably
straightforward, but it would make testing a bunch harder.

The command line parsing code validates that you've selected the correct
register — if we allow other registers in the future, you'll be able to
verify whether the compiler supports that by testing at build time.

-- 
-keith
```

## Attachments

- [signature.asc](https://ratatoskr.run/linuxppc-dev/2024/10/9534638/attachment/0) (application/pgp-signature, 832 bytes)
