Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 3 Jan 2018 20:51:45 +0100
From: Jens Gustedt <jens.gustedt@...ia.fr>
Cc: musl@...ts.openwall.com
Subject: Re: pthread_attr_[g|s]etaffinity_np

Hello Szabolcs,

On Wed, 3 Jan 2018 18:41:18 +0100 Szabolcs Nagy <nsz@...t70.net> wrote:

> * Jens Gustedt <jens.gustedt@...ia.fr> [2018-01-03 16:08:22 +0100]:
> > when trying to link against OpenMP (gomp to be more precise) I ran
> > into undefined-symbol errors for these functions. For the moment I
> > am avoiding this problem by adding some weak aliases that do
> > nothing and return ENOSYS.  
> 
> i think libgomp detects support at configure time
> so if you build gcc against musl you should get a
> dummy implementation of the affinity stuff but at
> least it links. (and then all libgomp tests pass
> with gcc-6 and gcc-7)

Ok, that explains why it hasn't yet hurt people. I am testing on a
mixed environment, debian with musl in /usr/local. For all other
things static linking gcc stuff (libatomic e.g) works fine, I just ran
into that one.

The downside of these interfaces is that the state for these calls is
kept in the cpu_set_t argument. This would have to be copied /
allocated to the pthread_attr_t. That in turn would drag in malloc
etc. and thereby complicate things for the type (need for a pointer
"field") and pthread_attr_destroy (avoid memory leak).

So probably I'll keep the trivial wrappers with weak symbols inside my
own interface to OpenMP.

Thanks
Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ