mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: setcontext/getcontext/makecontext missing?
Date: Thu, 4 Feb 2016 10:41:38 -0500	[thread overview]
Message-ID: <20160204154137.GN9349@brightrain.aerifal.cx> (raw)
In-Reply-To: <20160204145409.GB9915@port70.net>

On Thu, Feb 04, 2016 at 03:54:09PM +0100, Szabolcs Nagy wrote:
> * Short, Todd <tshort@akamai.com> [2016-02-04 14:09:30 +0000]:
> > 
> > It appears that setcontext/getcontext/makecontext are declared in
> > ./include/ucontext.h, but there???s no definitions for them in
> > musl. These three functions are part of libc/glibc.so:
> > 
> 
> these are deprecated posix apis.
> 
> > Since the functions are declared, is there any intent to put them into musl?
> > 
> 
> they have unclear semantics and only possible to
> implement in asm (hence it is a significant effort
> to add them).

There's been some interest in adding them and they were on a long-term
goal list, but I'm not sure it makes sense anymore. All the major
users of this API have been moving _off_ of it, because it's
deprecated and impossible to use correctly - see the rationale here:

http://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html

So it's rather unfortunate (but typical OpenSSL nonsense) that they've
adding a new use of it.

> > I ran into this when attempting to compile OpenSSL with musl. In
> > the OpenSSL master branch, I???m able to do:
> > 
> > CC=musl-gcc ./config
> > make depend
> > make
> > 
> > However, ld fails because there is an undefined reference to
> > setcontext, getcontext and makecontext. This is new async
> > functionality in OpenSSL that uses these APIS.
> > 
> 
> imho that's an openssl bug.
> 
> if they really need the *context apis, then use adequate
> (link-time) configure check for them.

Agree strongly. There's at least one other major POSIX/POSIX-like
system that lacks them.

> but looking at
> http://git.openssl.org/?p=openssl.git;a=commit;h=a3667c316ae60ef454fb804221c3ca44af30a9aa
> this async lib is probably misguided, but they can
> implement the api with pthreads in a portable way.

Indeed.

Rich


  reply	other threads:[~2016-02-04 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 14:09 Short, Todd
2016-02-04 14:54 ` Szabolcs Nagy
2016-02-04 15:41   ` Rich Felker [this message]
2016-02-04 16:22     ` u-uy74
2016-02-04 17:01       ` Szabolcs Nagy
2016-02-05  9:21         ` u-uy74
2016-02-04 19:24       ` Rich Felker
2016-02-05  9:58         ` u-uy74
2016-02-07  5:20           ` Justin Cormack
2016-02-07 10:05             ` u-uy74

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=20160204154137.GN9349@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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).