Skip to content

Conversation

@aykevl
Copy link
Member

@aykevl aykevl commented Sep 8, 2020

By modifying the linker script a bit and adding the NRO0 header directly in the assembly, it's possible to craft an ELF file that can be converted straight to a binary (using objcopy or similar) that is a NRO file. This avoids custom code for NRO files or an extra build step.

With another change, .nro files are recognized by TinyGo so that this will create a ready-to-run NRO file:

tinygo build -o test.nro -target=nintendoswitch examples/serial

The dev branch is currently broken for the Switch, #1368 fixes that (and when I rebase the changes on top of that branch, I get a working .nro file).

The end goal is to get tinygo run -target=nintendoswitch to work, that will require some more changes besides this one.

By modifying the linker script a bit and adding the NRO0 header directly
in the assembly, it's possible to craft an ELF file that can be
converted straight to a binary (using objcopy or similar) that is a NRO
file. This avoids custom code for NRO files or an extra build step.

With another change, .nro files are recognized by TinyGo so that this
will create a ready-to-run NRO file:

    tinygo build -o test.nro -target=nintendoswitch examples/serial
@deadprogram
Copy link
Member

@aykevl now that #1368 has been merged, we can merge this PR, correct?

@deadprogram
Copy link
Member

@aykevl looks like this PR is ready to merge.

@aykevl
Copy link
Member Author

aykevl commented Sep 12, 2020

Yes, it's ready.

@deadprogram
Copy link
Member

Awesome, thanks @aykevl now merging.

@deadprogram deadprogram merged commit 9e599ba into dev Sep 12, 2020
@deadprogram deadprogram deleted the nintendoswitch-nro branch September 12, 2020 16:38
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.

3 participants