Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 22863 - -main doesn't work anymore when used for linking only #13830

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

dkorpel
Copy link
Contributor

@dkorpel dkorpel commented Mar 17, 2022

Porting ldc-developers/ldc#3938 to DMD

@dlang-bot
Copy link
Contributor

dlang-bot commented Mar 17, 2022

Thanks for your pull request and interest in making D better, @dkorpel! 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: and Returns:)

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

Auto-close Bugzilla Severity Description
22863 regression [REG2.099] -main doesn't work anymore when used for linking only (without source modules)

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 "stable + dmd#13830"

src/dmd/mars.d Outdated
if (!params.oneobj)
params.objfiles.push(mainModule.objfile.toChars());
else if (modules.length == 1)
params.objfiles.insert(0, mainModule.objfile.toChars());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inserting at position 0 is just an LDC specificum for -singleobj, DMD shouldn't need it and probably just append it, as for the !oneobj case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some .debug_ranges conflicts on debug info for -main generated functions. Perhaps, is this somewhat related?

@dkorpel dkorpel force-pushed the main-reg branch 3 times, most recently from befcc75 to 3b1bce2 Compare March 18, 2022 11:32
@dkorpel dkorpel force-pushed the main-reg branch 2 times, most recently from b26f171 to 76c3836 Compare March 18, 2022 12:26
@dkorpel
Copy link
Contributor Author

dkorpel commented Mar 19, 2022

circleci:

ERROR: Found the following residual temporary files.
ERROR: Temporary files should be stored in `test_results` or explicitly removed.
?? test/foo

Not sure why it's not deleted, dmd gets passed -od=${OUTPUT_BASE} and rm_retry -r ${OUTPUT_BASE} follows.

@kinke
Copy link
Contributor

kinke commented Mar 19, 2022

-od just specifies the object files dir IIRC, doesn't affect the executable output dir.

@WalterBright
Copy link
Member

I'll defer to @kinke on this one. -Walter

@RazvanN7 RazvanN7 merged commit d8c241f into dlang:stable Mar 21, 2022
@dkorpel dkorpel deleted the main-reg branch March 21, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants