[GHC] #13883: T5435_dyn_asm fails with ld.gold

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I'm seeing `T5435_dyn_asm` fail with Phab:D3449 using the gold linker. Specifically, {{{ =====> T5435_dyn_asm(normal) 1 of 1 [0, 0, 0] cd "./rts/T5435_dyn_asm.run" && $MAKE -s --no-print-directory T5435_dyn_asm T5435_dyn_asm failed with ['initArray1', 'initArray2', 'ctors2', 'ctors1', 'success'], see all.T for details *** unexpected failure for T5435_dyn_asm(normal) }}} It seems that the ctor list in `T5435_asm.c` is in order `ctors2,ctors1` as it expects that constructors are run in reverse order, yet somehow with gold the constructors are being run in forward order. I've searched high and low for a document specifying this behavior, but the best I can come up with is GCC's [[https://gcc.gnu.org/onlinedocs/gccint/Initialization.html|internals manual]]. I currently don't have a great answer for why gold flips the order. I suspected that the (enabled by default) `--ctors-in-init-array` flag might have something to do with it, but alas that doesn't appear to be the case. Anyways, given that this most certainly isn't GHC's fault and the order requirements aren't well specified anyways, I'm just going to accept the new ordering. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13883: T5435_dyn_asm fails with ld.gold
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => new * resolution: fixed => Comment: I don't believe this is supposed to be closed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): Not sure if relevant, but I'm currently observing `T5435_v_asm_a`, `T5435_v_asm_b` and `T5435_v_gcc` fail with segfault when I compile with these settings: {{{ BuildFlavour = quick ifneq "$(BuildFlavour)" "" include mk/flavours/$(BuildFlavour).mk endif GhcRtsHcOpts += -O0 -DDEBUG -fPIC -g3 GhcDebugged = YES GhcStage2HcOpts += -DDEBUG STRIP_CMD = : }}} Test suite output: {{{ =====> T5435_v_asm_a(normal) 1 of 3 [0, 0, 0] cd "./rts/T5435_v_asm_a.run" && $MAKE -s --no-print-directory T5435_v_asm_a Wrong exit code for T5435_v_asm_a()(expected 0 , actual 2 ) Stdout ( T5435_v_asm_a ): Makefile:85: recipe for target 'T5435_v_asm_a' failed Stderr ( T5435_v_asm_a ): make[2]: *** [T5435_v_asm_a] Segmentation fault (core dumped) *** unexpected failure for T5435_v_asm_a(normal) =====> T5435_v_asm_b(normal) 2 of 3 [0, 1, 0] cd "./rts/T5435_v_asm_b.run" && $MAKE -s --no-print-directory T5435_v_asm_b Wrong exit code for T5435_v_asm_b()(expected 0 , actual 2 ) Stdout ( T5435_v_asm_b ): Makefile:87: recipe for target 'T5435_v_asm_b' failed Stderr ( T5435_v_asm_b ): make[2]: *** [T5435_v_asm_b] Segmentation fault (core dumped) *** unexpected failure for T5435_v_asm_b(normal) =====> T5435_v_gcc(normal) 3 of 3 [0, 2, 0] cd "./rts/T5435_v_gcc.run" && $MAKE -s --no-print-directory T5435_v_gcc Wrong exit code for T5435_v_gcc()(expected 0 , actual 2 ) Stdout ( T5435_v_gcc ): Makefile:81: recipe for target 'T5435_v_gcc' failed Stderr ( T5435_v_gcc ): make[2]: *** [T5435_v_gcc] Segmentation fault (core dumped) *** unexpected failure for T5435_v_gcc(normal) }}} Somehow `./validate` passes, so I'm guessing one of the parameters I'm passing to GHC is making a difference. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Omer, which linker are you using? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13883: T5435_dyn_asm fails with ld.gold -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): ld.gold. This is on Xubuntu 18.04. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13883#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC