dmd
dmd copied to clipboard
Enable linker optimizations when needed on windows
This significantly reduce the executable file size
And this is what LDC is doing: https://github.com/ldc-developers/ldc/blob/3b9665bac69df0c27bc1888cca8a442df656d948/driver/linker-msvc.cpp#L130
Discussion: https://forum.dlang.org/post/[email protected]
Thanks for your pull request and interest in making D better, @ryuukk! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:andReturns:)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#14418"
I don't know if that PR is valid, if it is not, then please make appropriate changes, i'm not willing to dive deeper into DMD code base, i don't have the time
As per review, i removed the dead code, even though i believe it was needed, but i lack skills so that's a story for an other PR
I'll show you how in a few hours
This seems to fail 2 tests on Windows. The failures are linker errors.
@ryuukk any progress on this?
I can't run the test myself since the instruction on the wiki doesn't work, it's outdated
https://wiki.dlang.org/Building_under_Windows#Using_DigitalMars_make_for_running_the_test_suite
If one could update the instructions, that would be nice (make related, wich one exactly to get, and from where)
I tried this: https://sourceforge.net/projects/gnuwin32/ but it doesn't work
make.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
Indeed the instructions are outdated. However, both for building the compiler and running the tests we now have d scripts.
I don't have a windows machine, but I expect that if you run the run.d script from compiler/test directory that should run the tests. You can pass a specific directory to the program or a specific test:
run.exe fail_compilation -> will run all fail compilation tests
run.exe fail_compilation/test123456.d -> will run that specific test