Page MenuHomeFreeBSD

sys: rename preprocessed assembly-language files to .S
ClosedPublic

Authored by ehem_freebsd_m5p.com on Jul 25 2022, 7:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 9:26 AM
Unknown Object (File)
Oct 18 2024, 12:36 AM
Unknown Object (File)
Oct 2 2024, 8:05 AM
Unknown Object (File)
Oct 2 2024, 4:15 AM
Unknown Object (File)
Sep 30 2024, 10:25 PM
Unknown Object (File)
Sep 30 2024, 4:55 PM
Unknown Object (File)
Sep 30 2024, 2:09 PM
Unknown Object (File)
Sep 25 2024, 3:17 PM

Details

Summary

Even though assembly-language .s files aren't supposed to be run through
cpp, clearly all of these are being preprocessed (#include is a strong
indicator). A few potentially non-preprocessed files remain named .s.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Bit of filename cleanup which seems overdue. Most assembly language files come from contrib and those are consistently <something>.S. Most of these are for i386 or the linux_*.s files. Everywhere else is <something>.S. Notably AMD64, ARM64 and PowerPC don't have a single .s file besides the linux_*.s files.

.S has won the battle for favored assembly-language source filename pattern.

Note that it's not just a preference for one of two equivalent extensions, but .s and .S actually have a different meaning. The former uses/used the assembler directly, while the latter uses the compiler driver and passes the input through the preprocessor. This change may be [probably is] the right thing to do, but the motivation should be "these files are supposed to be preprocessed via the compiler driver" or more likely "these files are already being preprocessed via the compiler driver" via bespoke Make rules, and thus the .s to .S change is really making the extension consistent with the use.

sys/modules/linux64/Makefile
85

this is strange - I'm not sure why the linker script had a .s extension in the first place

ehem_freebsd_m5p.com retitled this revision from sys: rename asm.s files to asm.S to sys: rename preprocessed assembly-language files to .S.Jul 26 2022, 9:49 PM
ehem_freebsd_m5p.com edited the summary of this revision. (Show Details)
ehem_freebsd_m5p.com marked an inline comment as done.

Updating message as per @emaste's comment. Removing the renaming of the *.lds.s files since those do appear to be a distinct situation.

I've got nothing beyond what others have suggested and you've done... Thanks!

This revision is now accepted and ready to land.Jul 26 2022, 9:55 PM

Copied to GitHub. I'm wondering about renaming the "linux*_vdso.lds.s" files to "linux*_vdso.lds" since I believe that is the more common pattern for linker scripts.

sys/modules/linux64/Makefile
85

Yeah did look a bit odd. Fairly likely this shouldn't be part of D35908.