Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codegen: Add -nostartfiles to drop the hardcoded prelude #35

Open
wants to merge 2 commits into
base: uxn
Choose a base branch
from

Conversation

samueldr
Copy link

@samueldr samueldr commented Jul 2, 2024

This is useful mainly if you desire to use your own "prelude" for
whatever purpose you may have.

This includes, but is not limited to, prepending a prelude that is aware
of the metadata conventions.

Note that at this point in time it is not possible to trivially place
a prelude within the C code. The file always starts with bss, then text,
making things awkward at best.

It would be expected that the prelude is "bring your own" outside of
what this compiler produces.


I don't really like just adding yet another param to codegen(), but this was the trivial way to handle this.

A more proper way would be to fold all options, or codegen options, into a struct and provide that instead. This way adding options gets less verbose.


Tip: when reviewing hide whitespace changes to get a cleaner overview of the actual changes.


(Also adds a help section because we can.)

Useful for forgetful people like me.
This is useful mainly if you desire to use your own "prelude" for
whatever purpose you may have.

This includes, but is not limited to, prepending a prelude that is aware
of the [metadata conventions](https://wiki.xxiivv.com/site/metadata.html).

Note that *at this point in time* it is not possible to trivially place
a prelude within the C code. The file always starts with `bss`, then `text`,
making things awkward at best.

It would be expected that the prelude is "bring your own" outside of
what this compiler produces.
@samueldr samueldr changed the title main: Add -h argument codegen: Add -nostartfiles to drop the hardcoded prelude Jul 2, 2024
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