From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12239 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Remove possibly unused lines from Makefile Date: Thu, 14 Dec 2017 23:31:25 -0500 Message-ID: <20171215043125.GH1627@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1513312297 27099 195.159.176.226 (15 Dec 2017 04:31:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2017 04:31:37 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12255-gllmg-musl=m.gmane.org@lists.openwall.com Fri Dec 15 05:31:33 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ePhen-0006nw-Gi for gllmg-musl@m.gmane.org; Fri, 15 Dec 2017 05:31:33 +0100 Original-Received: (qmail 21774 invoked by uid 550); 15 Dec 2017 04:31:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 21756 invoked from network); 15 Dec 2017 04:31:37 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12239 Archived-At: On Thu, Dec 07, 2017 at 03:55:52PM +0000, Nicholas Wilson wrote: > Hi, > > There are a couple of lines I've had to hack out of the Makefile to > get Wasm to build. In WebAssembly, we can't use crti.s/crtn.s, > because the compiler doesn't support raw assembly chunks like that. > > That should be OK, since there are default empty files in > "crt/{crti,crtn}.c". Those empty files are currently unused, as all > archs provide the assembly versions. For WebAssembly, I'm happy for > those empty C files to be used. > > There's some clever stuff at the top of the Makefile to construct > BASE_SRCS and ARCH_SRCS, and it works fine for WebAssembly: we just > compile the dummy .c files if the .s files aren't provided by the > arch. > > The problem is further down the Makefile, where an apparently > unnecessary dependency is placed on the assembly files. I can't work > out why these two lines are there, and they need to be removed in > one way or another for the Wasm build to succeed. Getting rid of > them doesn't seem to have any negative consequences for the standard > x86 build. > > Patch below. > > Thanks, > Nick > > ============ > diff --git a/Makefile b/Makefile > index d2e89979..308ddaae 100644 > --- a/Makefile > +++ b/Makefile > @@ -113,10 +113,6 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c > > obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC > > -obj/crt/$(ARCH)/crti.o: $(srcdir)/crt/$(ARCH)/crti.s > - > -obj/crt/$(ARCH)/crtn.o: $(srcdir)/crt/$(ARCH)/crtn.s > - > OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) > $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 > Looks good. I'm committing this with a message explaining the historical reasons these lines appeared and why it makes sense to remove them. Rich