From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15339 invoked from network); 16 Jun 2020 17:56:08 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 16 Jun 2020 17:56:08 -0000 Received: (qmail 28187 invoked by uid 550); 16 Jun 2020 17:56:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28160 invoked from network); 16 Jun 2020 17:56:03 -0000 Date: Tue, 16 Jun 2020 13:55:51 -0400 From: Rich Felker To: Yuval Deutscher Cc: musl@lists.openwall.com Message-ID: <20200616175550.GJ6430@brightrain.aerifal.cx> References: <20200616172223.11407-1-yuval.d@nextsilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616172223.11407-1-yuval.d@nextsilicon.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH] build: allow forcing generic implementations of library functions 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 > --- > 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