mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: feature request: flag to disable math library build
Date: Thu, 11 Oct 2012 19:28:58 -0400	[thread overview]
Message-ID: <20121011232858.GA254@brightrain.aerifal.cx> (raw)
In-Reply-To: <20121011193738.GL24157@port70.net>

On Thu, Oct 11, 2012 at 09:37:38PM +0200, Szabolcs Nagy wrote:
> * Szabolcs Nagy <nsz@port70.net> [2012-10-11 20:17:09 +0200]:
> > if you don't like such hacks then you can add
> > 
> > SRCS:=$(filter-out src/complex/%,$(SRCS))
> > SRCS:=$(filter-out src/math/%,$(SRCS))
> > 
> > to your config.mak
> > 
> > i'm not sure how safe is this: libc uses some math
> > functions (at least stdio uses frexpl for printf)
> 
> these are the math functions used by other parts
> of libc (mostly float scan and print):
> 
> M = \
> __fpclassifyl \
> copysign \
> copysignl \
> fabs \
> fmod \
> fmodl \
> frexp \
> frexpl \
> scalbn \
> scalbnl \
> 
> so you need
> 
> SRCS := $(SRCS) $(M:%=src/math/%.c)
> 
> (not tested)

Note that this breaks if any of the above functions ever depend on
other math functions or internal math modules, not to mention if the
set of math functions used by the other part of the library ever
changes. I'm generally opposed to this kind of feature switching
because it has huge maintenance cost keeping track of all possible
configurations and ensuring none of them are broken.

I think the problem of extreme slowness building on emulated or
low-end hardware could be better addressed by using distcc, cross
compiling, or other approaches that leverage a more-powerful cpu
instead of omitting parts of libc. (Anyway, isn't musl only a tiny
percentage of the total build time?)

Rich


  reply	other threads:[~2012-10-11 23:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 17:30 John Spencer
2012-10-11 18:17 ` Szabolcs Nagy
2012-10-11 19:37   ` Szabolcs Nagy
2012-10-11 23:28     ` Rich Felker [this message]
2012-10-11 23:57       ` Luca Barbato
2012-10-12  0:24       ` John Spencer
2012-10-13  7:23       ` Isaac Dunham
2012-10-13 12:26         ` Rich Felker
2012-10-13 23:49           ` Isaac Dunham
2012-10-13 23:53             ` Rich Felker
2012-10-13 13:42         ` John Spencer
2012-10-13 20:13           ` Rich Felker
2012-10-12  0:32     ` John Spencer
2012-10-12  0:17       ` 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=20121011232858.GA254@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --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).