This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Of threads and OpenBSD


The threads implementation in OpenBSD is finally getting usable, so I am
playing a bit with it and gcc-3.2.2.

I've done --enable-threads=posix, but I'm running into issues.
Specifically, OpenBSD needs to specify -pthread to the compiler to get
threads issues resolved (to link with -lpthread, currently, whereas it
used to link with -lc_r instead of -lc).

The -pthread switch is a `final' switch: linking against -lpthread only
happens on final programs, and not intermediate libraries (this wouldn't
help, since on at least a few OpenBSD architectures, doing
gcc -shared -o foo.so -lbar   will only make a final link complain that
`-lbar is missing' if it's not mentionned there as well). There's also the
issue that everything must be linked with -pthread for threads to work
(e.g., the libc holds `weak' symbols for threaded stuff, and -lpthread can
override them).

A large number of tests fail. Indeed, libstdc++ goes as far as failing on
the abi test... and then most libstdc++, g++, objc tests fail.
I could fix them manually by providing -pthread everywhere.

Is there something I'm missing ? I know that FreeBSD uses a fairly similar
setup to ours (libc_r), and I haven't really found the required knobs.

The way I see things, it's probably necessary for us to rebuild a few libs
(libstdc++) in a multilib-like environment, and to take -pthread into
accounts for a few other things (exception propagation ?).

Is there already a framework, or am I doomed to doing it all ?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]