Set target platform identification variables like `APPLE` and `LINUX`
as soon as the target system is identified. This makes them available
during toolchain and binutils selection.
Fixes: #23333
All of NetBSD, FreeBSD, OpenBSD and DragonFly BSD support `$ORIGIN`,
but the last two require `-z origin` as documented at
https://lekensteyn.nl/rpath.html
The `-z origin` option causes a flag bit to be set and has no effect if
the `RPATH` does not contain expandable tokens.