mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Yuval Deutscher <yuval.d@nextsilicon.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] build: allow forcing generic implementations of library functions
Date: Tue, 16 Jun 2020 13:55:51 -0400	[thread overview]
Message-ID: <20200616175550.GJ6430@brightrain.aerifal.cx> (raw)
In-Reply-To: <20200616172223.11407-1-yuval.d@nextsilicon.com>

On Tue, Jun 16, 2020 at 08:22:23PM +0300, Yuval Deutscher wrote:
> This change allows excluding chosen functions from ARCH_OBJS thus
> causing the library to be built with non-platform-specific versions of
> them. The option can be used by setting the FORCE_GENERIC variable when
> invoking make.
> 
> Signed-off-by: Yuval Deutscher <yuval.d@nextsilicon.com>
> ---
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index bd8f5c38..c6e5a386 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -23,7 +23,8 @@ ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS))
>  BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS)))
>  ARCH_SRCS = $(sort $(wildcard $(ARCH_GLOBS)))
>  BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS)))
> -ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
> +ALL_ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
> +ARCH_OBJS = $(filter-out $(addprefix %/,$(addsuffix .o,$(FORCE_GENERIC))), $(ALL_ARCH_OBJS))
>  REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
>  ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))
>  
> -- 
> 2.25.1

Can you clarify what problem this is attempting to solve? Maybe it
could be solved better in a different way. As written, this patch
creates an option that produces broken builds unless you follow
unwritten rules about which files are valid to include in
FORCE_GENERIC. Only a very small portion of the ARCH_OBJS (mainly
string and math) are optional optimizations rather than hard
requirements.

Rich

  reply	other threads:[~2020-06-16 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 17:22 Yuval Deutscher
2020-06-16 17:55 ` Rich Felker [this message]
2020-06-17  7:49   ` Yuval Deutscher

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=20200616175550.GJ6430@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=yuval.d@nextsilicon.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).