Fix lack of link error when missing modules providing externals#837
Fix lack of link error when missing modules providing externals#837garrigue merged 4 commits intoocaml:4.04from
Conversation
|
@garrigue could you review? |
|
The problem seems to come from pack. |
|
No, I just checked, there is nothing removing required modules provided by the pack. |
|
Here it is, as previous, not really tested yet... |
|
OK, I'm waiting for a complete fix before reviewing. |
|
I'm keeping the 4.04 milestone for now, we'll change it if this becomes the last PR to hold up the release. |
|
It seems almost ready, except for this strange failure on w55.opt-backend using ocamlopt with flambda. |
|
By the way, your branch doesn't seem to include my addition of |
|
@chambart It looks like some of the " |
|
It's not |
|
@mshinwell effectively, I appently started that on the wrong branch. I'll rebase on 4.04 removing that. |
Also remove provided cmo from the required globals
Pack modules can require globals they provide.
8ac38af to
d0f0586
Compare
|
Looking at your code, it seems that it would be easy to turn the error into a link-time warning. |
|
@garrigue In byte code it is effectively quite simple to do a warning instead of an error. In native code, that might be a bit trickier as this is done by adding a fake dependency (loading the cmx file). We would have to distinguish it from normal dependencies. Not that much effort, but I don't know if the benefit is really worth it. Do you know any example in the wild where this might matter ? |
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
… PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
…l#837, PR#7371) * Check that all the required modules are provided Also remove provided cmo from the required globals * Remove required globals from packs when provided * Remove provided globals after adding required ones Pack modules can require globals they provide. * Dumpobj tool can print relocation information
Disable a potentially costly test.
Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com>
Since 4.03 when a module provide an external and the external is used, the module must be linked.
This was implemented by generating dummy code, in the pr #602 I changed that. It now records in the cmo file that some module is required. This correctly made module provided by cma files to be linked, but nothing checked that this was not empty at the end.
This patch add the check.
I don't have time right now to test it correclty, so I will let the CI check that it does not break any other compilation. Sorry for that, and the bug.