[GHC] #14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5)

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 (Linking) | Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: None/Unknown (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- seems like validate for OSX needs some TLC, heres a bug from the linker code that maybe could use an eyeball or two. Phyx suggests someone familiar with the code base could simply do ` __attribute__ ((fallthrough)); `, which is allegedly also supported by clang? {{{ "inplace/bin/ghc-stage1" -optc-fno-stack-protector -optc-Wall -optc-Werror -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc- Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc- Wredundant-decls -optc-Wundef -optc-Iincludes -optc-Iincludes/dist -optc- Iincludes/dist-derivedconstants/header -optc-Iincludes/dist- ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-DDTRACE -optc- Irts/dist/build/./autogen -optc-Wno-error=inline -optc-O2 -optc-fomit- frame-pointer -optc-g -optc-DDYNAMIC -optc-DRtsWay=\"rts_dyn\" -fPIC -dynamic -O0 -H64m -Wall -fllvm-fill-undef-with-garbage -Werror -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -DDTRACE -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/posix/GetTime.c -o rts/dist/build/posix/GetTime.dyn_o rts/linker/MachO.c: In function 'ocGetNames_MachO': rts/linker/MachO.c:1532:17: error: error: this statement may fall through [-Werror=implicit- fallthrough=] secArray[i].info->relocation_info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ = (MachORelocationInfo*)(oc->image + section->reloff); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 1532 | = (MachORelocationInfo*)(oc->image + section->reloff); | ^ rts/linker/MachO.c:1534:13: error: note: here default: { ^~~~~~~ | 1534 | default: { }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): this pragma seems to only be needed by GCC, but not be clang (or equivalently clang does not support this pragma at statements , just definitions) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): There's a way nicer fix, to add a comment/annotation: {{{ /* Falls through. */ }}} at the line where a `break;` statement might otherwise go. For example: https://github.com/erikd/libsndfile/blob/master/src/aiff.c#L852 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I originally suggested the pragma because that's supposed to be more portable while the comment is a GCC only thing. While it'll work in this case, be adviced that GCC will no longer recognize this comment in the stricter variants of the warning e.g. `-Wimplicit-fallthrough=5` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.2 Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.6.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.2 Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5292 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker
support (master == ghc8.5)
-------------------------------------+-------------------------------------
Reporter: carter | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.2
Component: Compiler | Version: 8.3
(Linking) |
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
| (amd64)
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5292
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.3 (Linking) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: 8.6.2 => 8.6.3 Comment: This just missed the cut-off for 8.6.2,. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.3 (Linking) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.3 (Linking) | Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Actually, it looks like this shouldn't even fallthrough! Fixing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Changes (by berdario): * status: merge => new * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14613: Validate Failure On OSX -- implicit fall through error for machO linker support (master == ghc8.5) -------------------------------------+------------------------------------- Reporter: carter | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.3 (Linking) | Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5292 Wiki Page: | -------------------------------------+------------------------------------- Changes (by harpocrates): * cc: harpocrates (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14613#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC