4 ms·
Concatenate it into an amalgamated unit at build time, then. This only adds a style requirement in that you can't use linking to enforce namespacing.
by megameter 6y ago
Concatenate it into an amalgamated unit at build time, then. This only adds a style requirement in that you can't use linking to enforce namespacing.
- monocasa 6y agoTo expect the compiler to take advantage of that, you'd need to mark pretty much every function with static.
- loeg 6y ago-fwhole-program? Or -fvisibility=hidden.
- monocasa 6y agoGCC doesn't have a mature Z80 backend.
- loeg 6y agoI didn't mention GCC in that comment. The concept of default visibility is hardly GCC-specific. Also, it is not clear that the thread is still on the topic of z80 specifically or whole-project LTO generally. If you find yourself doing the latter outside of z80, you may find GCC useful. And hidden visibility is often useful a good default. If you want a z80-specific LTO option, sorry, I'm unfamiliar with any. That's a pretty niche ask.
- monocasa 6y ago> I didn't mention GCC in that comment. The concept of default visibility is hardly GCC-specific. Those options you gave are GCC-specific. I don't know of a mature Z80 compiler that supports LTO. The thread at this point is on the topic of "so your compiler doesn't support LTO, how can we 80/20 our way to the same semantics"
- Reelin 6y agoI believe the LTO implementations of modern compilers handle this for you? (https://clang.llvm.org/docs/LTOVisibility.html https://clang.llvm.org/docs/LTOVisibility.html) Edit: Wow, as a result of your other comment about GCC I was surprised to learn that none of the Z80 compilers I could find appear to support this sort of thing. It looks like there was (previously?) an effort to put together a Z80 backend for LLVM, but my search results didn't look promising.
- monocasa 6y agoYeah, it's a newer concept for the compiler space (it relies on having a lot of compiler host memory, more than you might think), and I'm not sure that the more niche compilers have had time to get this feature yet.