Comment 2 for bug 1489379

------- Comment From <email address hidden> 2015-09-02 22:11 EDT-------
Today's work on this..

This is not so simple to "fix". really requires a dynamic libgcc because it uses pthreads (namely pthread_cancel).
it can go without a link-time dependency on libgcc *if* it's not built with -fexceptions.

it will run, but crash when pthread_cancel() is called.
I think this is already happening w/ other pieces of the code (libmultipath, iirc) - it's just luck it didn't crash yet.

Some testing/experiments.

$ cat test.c
#include <pthread.h>
#include <stdlib.h>

void * loop(void *arg) {

int main() {
pthread_t thread;
pthread_create(&thread, NULL, &loop, NULL);
pthread_cancel(thread); // this requires
return 0;

$ gcc -pthread -o test test.c

$ ./test; echo $?

$ ldd test => (0x00003fff81730000) => /lib/powerpc64le-linux-gnu/ (0x00003fff816e0000) => /lib/powerpc64le-linux-gnu/ (0x00003fff81500000)
/lib64/ (0x0000000050130000)

^ notice there's no dependency on libgcc_s at link-time, it's a run-time dlopen() in pthread_cancel_init()

$ find /lib -name

On installer:

~ # ./test must be installed for pthread_cancel to work

~ # find /lib -name
~ #

To be continued.