fixup! add add select syscall for powerpc{,64}

moved files into correct directory

Signed-off-by: Enrico Scholz <ensc@ensc.de>
fixup! ARM: implemented TLS startup code

declared __arm_set_tls in tls.h header

Signed-off-by: Enrico Scholz <ensc@ensc.de>
diet: use correct arch for 'powerpc' crosscompilers

when gcc is invoked as powerpc-...-gcc, libraries will be searched in bin-powerpc although buildsystem installed them into bin-ppc.  Translate arch in the diet wrapper.

Signed-off-by: Enrico Scholz <ensc@ensc.de>
stackgap: generalized call of startup code

Recent changes require the execution of stackgap code (which initializes
tls). Use the already existing CALL_IN_STARTCODE instead of adding a
complex #ifdef block.

Signed-off-by: Enrico Scholz <ensc@ensc.de>
stackgap: refactored register based TLS pointer code

gcc optimizes away the old code because '__thread_self' will not be
accessed.  A classical '__asm__ __volatile__()' optimization barrier is
the best solution imo.  Patch adds an __ABI_TLS_REGISTER macro in the
tls.h header to avoid code duplication.

Patch fixes powerpc64 (--> r13) and powerpc (--> r2) cases too.

Signed-off-by: Enrico Scholz <ensc@ensc.de>
stackgap: turn #warning into #error

Not setting the TLS pointer is critical and causes later program
crashes. Catch this at compile time by aborting the build.

Signed-off-by: Enrico Scholz <ensc@ensc.de>