[GHC] #9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.8.2 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- In an attempt to close #4210 the LLVM code generator's mangler was modified in ed67d290e7389bd87a6feea269a0275e0f0f5e2f to rewrite symbol types from `@function` to `@object`. This was done in order to prevent the linker from sending reference through the PLT which breaks info tables. Unfortunately, this mangling was a simple text replacement of `@function` to `@object` in the assembler produced by LLVM and made no attempt to distinguish `.type` directives (which the mangling targets) from other occurrences of the token. As rwbarton unfortunately found out, this means that any occurrences of `"@function"` in user code (e.g. the LLVM backend itself while compiling GHC) will be rewritten to `"@object"` in the produced object. Hilarity ensues. This can be demonstrated by the simple test `main = putStrLn "@function"`, which prints `@object` in the affected releases (7.8.1 through 7.8.3 thusfar). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: highest | Milestone: Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: rwbarton@… (added) * owner: => bgamari * priority: normal => highest -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: highest | Milestone: Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D150 | -------------------------------------+------------------------------------- Changes (by bgamari): * differential: => D150 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: rwbarton Type: bug | Status: new Priority: highest | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: 9268 | Differential Revisions: Phab:D150 | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: bgamari => rwbarton * differential: D150 => Phab:D150 * milestone: => 7.8.4 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: rwbarton
Type: bug | Status: new
Priority: highest | Milestone: 7.8.4
Component: Compiler | Version: 7.8.2
(LLVM) | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: 9268 |
Differential Revisions: Phab:D150 |
-------------------------------------+-------------------------------------
Comment (by Reid Barton

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: 9268 | Differential Revisions: Phab:D150 | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: rwbarton => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: merge Priority: highest | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: 9268 | Differential Revisions: Phab:D150 | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: merge
Priority: highest | Milestone: 7.8.4
Component: Compiler | Version: 7.8.2
(LLVM) | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: 9268 |
Differential Revisions: Phab:D150 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: highest | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 (LLVM) | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: 9268 | Differential Revisions: Phab:D150 | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: closed
Priority: highest | Milestone: 7.8.4
Component: Compiler | Version: 7.8.2
(LLVM) | Keywords:
Resolution: fixed | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: 9268 |
Differential Revisions: Phab:D150 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: merge Priority: highest | Milestone: 7.8.4 Component: Compiler (LLVM) | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: 9268 | Differential Revisions: Phab:D150 -------------------------------------+------------------------------------- Changes (by rwbarton): * status: closed => merge Comment: As reported by someone on #ghc, the actual fix 5895f2b8ffba72a8393e9f712461e6e5ed7ceced was never merged, only the subsequent bbd031134a571c1020945b2548e3fc4795b5047a. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: merge
Priority: highest | Milestone: 7.8.4
Component: Compiler (LLVM) | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking: 9268
| Differential Revisions: Phab:D150
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: merge
Priority: highest | Milestone: 7.8.4
Component: Compiler (LLVM) | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking: 9268
| Differential Revisions: Phab:D150
-------------------------------------+-------------------------------------
Comment (by Erik de Castro Lopo

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: highest | Milestone: 7.8.4 Component: Compiler (LLVM) | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: 9268 | Differential Revisions: Phab:D150 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed Comment: 7.8 is quite old and this is fixed in 7.10. Closing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9439#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: closed
Priority: highest | Milestone: 7.8.4
Component: Compiler (LLVM) | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking: 9268
Related Tickets: | Differential Revisions: Phab:D150
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: closed
Priority: highest | Milestone: 7.8.4
Component: Compiler (LLVM) | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking: 9268
Related Tickets: | Differential Rev(s): Phab:D150
-------------------------------------+-------------------------------------
Comment (by Erik de Castro Lopo
participants (1)
-
GHC