[LLVMdev] Linking modules with different targetdata (Was: Casting between address spaces and address space) semantics

Matthijs Kooijman matthijs at stdin.nl
Wed Aug 6 09:25:49 PDT 2008


Hi Chris,

I've put this into a seperate reply, since it is really a seperate issue.

> >> You can see this in Linker::LinkModules, basically one randomly
> >> overrides the other unless one modules is empty, in which case the non-
> >> empty  one wins.
> > Shouldn't this give a warning instead of silently picking one?
> What would the warning say?  There is nothing useful the linker could  
> tell the user, and having a low level tool like the llvm linker  
> library emit warnings (where? to stderr?) is extremely impolite for  
> some clients.  If a specific client cares about this, it should check  
> and report in its own way.

The linker already reports errors through an ErrorMsg output argument on
LinkInModule, though looking at it now, the other methods of llvm::Linker
don't have any way of outputting things. Since this wouldn't really be an
error but a warning, doing this in Linker is probably too much fuss anyway.
Which would change my point slightly: Perhaps llvm-link and/or llmv-ld should
check the targetdata's and give a warning if they don't match?

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080806/fda3a421/attachment.sig>


More information about the llvm-dev mailing list