|
|
Message-ID: <CAFftDdoJFf3DQ2GwTKo3MdcNcxJE2qZE7c8NSAc-yVBeUaVK-A@mail.gmail.com> Date: Tue, 18 Nov 2025 14:20:27 -0600 From: William Roberts <bill.c.roberts@...il.com> To: musl@...ts.openwall.com Cc: Bill Roberts <bill.roberts@...s.arm.com> Subject: Re: [PATCH 2/3] Makefile: support awk processing of .S files On Mon, Nov 17, 2025 at 8:17 PM Rich Felker <dalias@...c.org> wrote: > > On Fri, Nov 14, 2025 at 12:38:03AM -0600, Bill Roberts wrote: > > > > > > On 11/14/25 10:23 AM, Szabolcs Nagy wrote: > > > * Bill Roberts <bill.roberts@....com> [2025-11-13 13:44:27 -0600]: > > > > Don't skip .S files when post-processing with awk. > > > > > > > > Signed-off-by: Bill Roberts <bill.roberts@....com> > > > > --- > > > > Makefile | 6 ++++-- > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Makefile b/Makefile > > > > index a20bafaf..4e62e0b3 100644 > > > > --- a/Makefile > > > > +++ b/Makefile > > > > @@ -136,15 +136,17 @@ CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $< > > > > # Choose invocation of assembler to be used > > > > ifeq ($(ADD_CFI),yes) > > > > AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ - > > > > + CCS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler-with-cpp -c -o $@ - > > > > else > > > > AS_CMD = $(CC_CMD) > > > > + CCS_CMD = $(CC_CMD) > > > > endif > > > > obj/%.o: $(srcdir)/%.s > > > > $(AS_CMD) > > > > obj/%.o: $(srcdir)/%.S > > > > - $(CC_CMD) > > > > + $(CCS_CMD) > > > > > > i think the x86 cfi awk deletes # and // comments > > > which affects cpp directives in .S so you cant just > > > use the awk on .S > > > > > > i guess a hack would be to not use # comments in .s, > > > another to only preprocess first then awk then asm. > > > > > > > Personally, I would love to see all of this go to .S (capital) > > files and use the C pre-processor for all of this and add the CFI > > statements directly to the asm. However, it seems MUSL want's the assembly > > to be "pure" based on the comments and git logs I am > > seeing. I am more of a fan of seeing everything in the assembly file then > > chasing down custom scripts that do processing, but I'll do it whatever way > > the community/maintainers want. > > I don't want more preprocessing scripts. The ones that are there are > there for optional debug functionality, not for anything that alters > behavior, and it would probably be nicer if we didn't need them. > > At the same time, I don't want asm source files that require reading > include files to interpret what anything means. The long term goal is > to eliminate as many asm source files as possible, and it might make > sense to do this before doing anything that requires a lot of > redundant work on the existing ones. Really the only things that > should be asm source files Thanks for responding Rich, I was going to reach back out to see where you stood on this. I for one am pretty fond of this conceptually even though I am not a huge fan of incline assembly. I could probably start looking at MUSL with this concept and float another RFC around that. rather than inline asm are things that need > to have an asm entry point/label in order to function -- things like > __syscal_cp_asm, __unmapself, etc. I don't think I fully appreciate what you're saying here, but it will probably become clear as I look at the code. If I have any questions, I'll reach back out. Thanks Rich, Bill
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.