Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e109abb-01d0-4617-9807-df29bb499642@foss.arm.com>
Date: Fri, 14 Nov 2025 00:38:03 -0600
From: Bill Roberts <bill.roberts@...s.arm.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 2/3] Makefile: support awk processing of .S files



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.


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.