On Fri, 5 Apr 2024 14:01:29 GMT, Julian Waters <jwat...@openjdk.org> wrote:
> I plan on adding support for using gcc to compile hsdis on Windows sometime > soon (Like proper support for gcc as a toolchain on Windows, at least enough > to support hsdis, so people can freely use any gcc instead of only being > restricted to Cygwin), what might be an elegant solution to this issue, if > you have any in mind? The proper solution is, I think, to encapsulate toolchain variables/definitions into a package, and update the build system to not assume anything about toolchains. In a proper language, I'd create like a `class Toolchain` with everything the system would need to know to use a toolchain, and then pass a `Toolchain toolchain` to all invocations that need to do anything with a toolchain. Now this is not possible with make, but I hope it can be simulated using "fake namespaces" and something like a `$(TOOLCHAIN)_COMPILER` kind of setup. That would require some major surgery of the build system, but I think it will come out better in the end. After that is done, fixing so that hsdis/binutils can be compiled with gcc on Windows will be a trivial side-effect. ------------- PR Comment: https://git.openjdk.org/jdk/pull/18400#issuecomment-2040063933