-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Hello! I am currently developing a wrapper of the PSP Toolchain for Zig, in order to be able to develop using Zig on the Sony PlayStation Portable. Currently I aim to use no external dependencies. The last external dependency to resolve is LLD.
In order to satisfy post-build tools for this platform, users need relocation sections in the final built ELF file (in order to reformat into Sony's proprietary loading specifications). I have all of my building through a build.zig script and use LLD for the -emit-relocs flag, which is the only flag missing from zig's default linking options. Since zig internally uses LLD, I believe it would be logical to nix this requirement by using a linker flag.
-emit-relocs is an option which allows the emission of relocation sections for use by post-build tools. This might also be a useful feature for other targets such as ARM Embedded Consoles such as GBA, DS, and 3DS that would likely have similar tools required.
The goal is to be able to work with the user only having the zig compiler and linker available, and simply just including the toolchain in their project with no externals. Seeing that it's one flag, I would like to propose adding -emit-relocs as a conditional flag, and I'm happy to create a patch like what was done in #3981.
Let me know your thoughts, and I'd be happy to continue this discussion.