[GHC] #7790: Add dummy undefined symbols to indicate ways

#7790: Add dummy undefined symbols to indicate ways -----------------------------+---------------------------------------------- Reporter: ezyang | Owner: ezyang Type: task | Status: new Priority: normal | Component: Compiler Version: | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Currently, "way" information is not recorded into object files; it is only recorded into 'hi' files. This means if you are using, say, rts/Linker.c (say, if you're GHCi or a dynamic plugins package), if you mess up and load an object file compiled the wrong way, you will be very sad. I think a cute trick we could play is to define a bunch of dummy symbols per-way, and add them as undefined symbols to objects, to indicate what way they were compiled, e.g. with the `-u` linker flag. Various RTS's export the symbols of ways they support, and attempting to link an object with an incompatible RTS results in a link error. Are there any problems with this scheme? If not, I'll go ahead and implement it. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7790 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7790: Add dummy undefined symbols to indicate ways ---------------------------------+------------------------------------------ Reporter: ezyang | Owner: ezyang Type: task | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * difficulty: => Unknown * milestone: => 7.8.1 Comment: Sounds good to me. We also put the compiler version in as a comment, in `nativeGen/AsmCodeGen.lhs`: {{{ -- And just because every other compiler does, lets stick in -- an identifier directive: .ident "GHC x.y.z" (if platformHasIdentDirective platform then let compilerIdent = text "GHC" <+> text cProjectVersion in text ".ident" <+> doubleQuotes compilerIdent else empty) }}} so it might be worth also putting the way in there, just to make the information easier to find. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7790#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC