I tried to create a shared library which is linked to OpenMP (libgomp) on Solaris. But I always get a relocation Error:
ld: fatal: relocation error: R_386_TLS_LE: file /vol/gcc-4.3/lib/gcc/i386-pc-solaris2.10/4.3.2/libgomp.a(team.o): symbol gomp_tls_data: relocation illegal when building a shared object
Below I've posted a minimal example of my code:
func.c
uname -a [10028]
SunOS opteron 5.10 Generic_139556-08 i86pc i386 i86pc Solaris
During my search in the internet I found that you get such an error if you don't compile with -fPIC. But I've done that. Is this probably a problem of the gcc installed on system. With my Macbook everything works fine.
Please help me!
Aw, hell. Google gives nine results for "relocation illegal when building a shared object". The third one is this thread.
Screw it, I'll just guess. Uh... Did you try without that flag? What about using it when linking, instead of compiling?