-
Notifications
You must be signed in to change notification settings - Fork 701
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
Include cmm-sources
when linking shared objects
#7252
Conversation
Previously we neglected to include such objects. Fixes haskell#7182.
Essentially just copying the existing CmmSources test but building with `--enable-executable-dynamic`
5c3d7f0
to
5f69122
Compare
Anyone fancy merging this patch? |
This should also end up in the 3.6 branch. |
ghcOptRPaths = rpaths | ||
ghcOptRPaths = rpaths, | ||
ghcOptInputFiles = toNubListR | ||
[tmpDir </> x | x <- cObjs ++ cxxObjs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echoing @phadej's question:
This change is something else? We don't need cmmObjs nor asmObjs however?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the question. Before the files weren't even passed the the linker, now they are. It is possible that these other files are also needed but this patch fixes the issue for cxxObjs, as claimed, and other files types are out-of-scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the question.
Rephrasing as I understand it: Is this part of the "Include cmm-sources and asm-sources when linking shared objects" goal? If yes, why aren't cmmObjs and asmObjs included here too (as in cProfObjs/cSharedObjs)?
this patch fixes the issue for cxxObjs
wasn't it cmm and asm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cObjs
contains all the objs you list as it is constructed from cLikeFiles (which contains asm, cmm, c etc).
cabal/Cabal/src/Distribution/Simple/GHC.hs
Line 554 in 5f69122
let cLikeFiles = fromNubListR $ mconcat |
The confusion steps from having lines cObjs = map (`replaceExtension` objExtension) cLikeFiles and cObjs = map (`replaceExtension` objExtension) cSrcs Rename the first to In particular this is confusing because it seems that there is split to "C, asm, cmm" and "C++" (cxx). However THere is code like let cProfObjs = map (`replaceExtension` ("p_" ++ objExtension))
(cSources libBi ++ cxxSources libBi)
cSharedObjs = map (`replaceExtension` ("dyn_" ++ objExtension))
(cSources libBi ++ cxxSources libBi) why that doesn't include There are a lot of questions, and variable naming & code structure doesn't give answers. |
I am not sure if @phadej is requesting changes or just suggesting an improvement. We didn't modify the names in this confusing code. This patch is critical to build ghc-debug with 9.2 so needs to be in the 3.6 branch. |
@mpickering I'm not a maintainer of Cabal, so my comments can be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mpickering - this is clear and even tests!
Anyone want to merge this? |
As long as we're agreed there will be a follow up for @phadej's commentary, yes @mpickering - consider it merged |
Can we have an issue for
Just to remind us when this code is touched another time. |
@emilypi, can you also backport to the 3.6 branch? |
@bgamari There is no 3.6 branch yet |
The changelog entry isn't there. @mpickering or @bgamari could you add one in a follow-up pr? |
Ahh, I see. Cabal hasn't forked yet; support for GHC 9.2 has merely been added.
Sure. |
* GHC: Rename cLikeFiles -> cLikeSources * changelog: Add entry for haskell#7252 * Add name change convention for c-like objects Co-authored-by: Emily Pillmore <emilypi@cohomolo.gy>
* GHC: Rename cLikeFiles -> cLikeSources * changelog: Add entry for haskell#7252 * Add name change convention for c-like objects Co-authored-by: Emily Pillmore <emilypi@cohomolo.gy>
Fixes #7182
Patch is by @bgamari, I have just rebased it on master as requested by @phadej in #7183
Please include the following checklist in your PR:
changelog.d
directory).Please also shortly describe how you tested your change. Bonus points for added tests!