From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Remove possibly unused lines from Makefile
Date: Thu, 14 Dec 2017 23:31:25 -0500 [thread overview]
Message-ID: <20171215043125.GH1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <VI1PR0502MB388578F799B59B5C5FB38D39E7330@VI1PR0502MB3885.eurprd05.prod.outlook.com>
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
prev parent reply other threads:[~2017-12-15 4:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 15:55 Nicholas Wilson
2017-12-15 4:31 ` Rich Felker [this message]
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=20171215043125.GH1627@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).