Skip to content

substitute with sed, the way bfd's Makefile does - #2

Closed
Parth wants to merge 8 commits into
allyourcodebase:masterfrom
zibudi:borrow-the-substitutions
Closed

Parth wants to merge 8 commits into
allyourcodebase:masterfrom
zibudi:borrow-the-substitutions

Conversation

@Parth

@Parth Parth commented Aug 28, 2026

Copy link
Copy Markdown

find_replace.zig was 31 lines doing a literal string replace, standing in for what bfd's own Makefile runs:

elf32-target.h : elfxx-target.h
	sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new

On all thirteen substitutions this port makes — the seven elfxx-*.h pairs and the six peXXigen.c variants — the two agree byte for byte.

genscripts.zig already spawns the host's sh, and the script it runs uses the host's sed, cat, mkdir and rm to write every ldscripts/*.x. So sed here is not a new kind of dependency, only a more visible one.

@Parth

Parth commented Aug 28, 2026

Copy link
Copy Markdown
Author

Opened by mistake against the wrong repo — this belongs on a fork. Closing; apologies for the noise.

@Parth Parth closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant