mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: Sebastian Kemper <sebastian_ml@gmx.net>
Subject: Re: Robust shared mutexes?
Date: Sun, 27 Nov 2016 12:37:44 +0100	[thread overview]
Message-ID: <20161127113744.GY5749@port70.net> (raw)
In-Reply-To: <20161127105425.GA14788@hotdamn.lan>

* Sebastian Kemper <sebastian_ml@gmx.net> [2016-11-27 11:54:34 +0100]:
> On Sun, Nov 27, 2016 at 12:01:10AM +0100, Szabolcs Nagy wrote:
> > * Rich Felker <dalias@libc.org> [2016-11-26 17:56:18 -0500]:
> > > On Sat, Nov 26, 2016 at 11:51:05PM +0100, Sebastian Kemper wrote:
> > > > 
> > > > http://lists.openembedded.org/pipermail/openembedded-core/2016-March/119214.html
> > > > 
> > > > It says musl doesn't have process shared mutexes so one should set
> > > > apr_cv_process_shared_works=no. I take it that is correct?
> > > 
> > > No, it's incorrect and I have no idea where that idea came from. I'll
> > > ask Khem.
> > > 
> > 
> > apr might care about sharing mutexes across i386 vs x86_64 ?
> > 
> > that does not work (glibc ditto)
> 
> Hello Szabolcs, list,
> 
> I installed a Gentoo musl-1.1.15 x86_64 chroot on my computer. Then I
> ran ./configure in apr-1.5.2 in the musl chroot and also outside the
> chroot in a glibc-2.22 environment.
> 
> The outcome was the same except for apr_cv_mutex_robust_shared:
> 
> ac_cv_func_setpgrp_void         musl yes glibc yes
> ac_cv_file__dev_zero            musl yes glibc yes
> apr_cv_tcp_nodelay_with_cork    musl yes glibc yes
> apr_cv_mutex_recursive          musl yes glibc yes
> ac_cv_func_pthread_rwlock_init  musl yes glibc yes
> apr_cv_type_rwlock_t=yes        musl yes glibc yes
> apr_cv_process_shared_works     musl yes glibc yes
> apr_cv_mutex_robust_shared      musl no  glibc yes
> 
> I've posted the corresponding part from config.log below. It fails
> because musl doesn't define PTHREAD_MUTEX_ROBUST_NP (glibc does). And
> apr uses PTHREAD_MUTEX_ROBUST_NP. It means that I should set
> apr_cv_mutex_robust_shared=no when cross-compiling this apr, I suppose
> :)

the standard name is PTHREAD_MUTEX_ROBUST since posix2008,
so this is an apr bug.

> configure:25459: checking for robust cross-process mutex support
> configure:25500: gcc -o conftest -g -O2 -DLINUX -D_REENTRANT -D_GNU_SOURCE  conftest.c -lpthread >&5
> conftest.c: In function 'main':
> conftest.c:197:47: error: 'PTHREAD_MUTEX_ROBUST_NP' undeclared (first use in this function)
>      if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP))
>                                                ^

i think they should use the standard name and provide
their own definition on legacy systems

#ifndef PTHREAD_MUTEX_ROBUST
#define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP
#endif


  reply	other threads:[~2016-11-27 11:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26 21:49 Sebastian Kemper
2016-11-26 22:24 ` Rich Felker
2016-11-26 22:51   ` Sebastian Kemper
2016-11-26 22:56     ` Rich Felker
2016-11-26 23:01       ` Szabolcs Nagy
2016-11-27 10:54         ` Sebastian Kemper
2016-11-27 11:37           ` Szabolcs Nagy [this message]
2016-11-27 11:51           ` Alexander Monakov
2016-11-27 16:26             ` Sebastian Kemper
2016-11-26 23:02       ` Sebastian Kemper
2016-11-28 21:36       ` Khem Raj
2016-11-28 21:53         ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161127113744.GY5749@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    --cc=sebastian_ml@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).