[GHC] #8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2 ------------------------------+-------------------------------------------- Reporter: heatsink | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 7.7 System | Operating System: MacOS X Keywords: | Type of failure: GHC doesn't work at all Architecture: x86_64 | Test Case: (amd64) | Blocking: Difficulty: Unknown | Blocked By: | Related Tickets: #8561 | ------------------------------+-------------------------------------------- A recent update to the RTS uses the GCC builtin function `__builtin___clear_cache`. This function was introduced in GCC 4.3. In older GCCs that don't have this builtin function, it's treated as an undefined function, leading to a link-time error. My system has GCC 4.2.1, bundled with XCode 3.2.6. The function is called from `rts/sm/Storage.c`. It seems that x86 architectures don't need a cache flush, so a possible fix is to do nothing on GCC < 4.3.6 on x86 architectures. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2
--------------------------------------------+------------------------------
Reporter: heatsink | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.7
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC doesn't work at all | (amd64)
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets: #8561
--------------------------------------------+------------------------------
Comment (by Joachim Breitner

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2
--------------------------------------------+------------------------------
Reporter: heatsink | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.7
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC doesn't work at all | (amd64)
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets: #8561
--------------------------------------------+------------------------------
Comment (by nomeata):
Replying to [comment:1 Joachim Breitner
In [changeset:"66de8c1e8f1a101bbfe551c46edca49473f6acd0/testsuite"]: {{{ #!CommitTicketReference repository="testsuite" revision="66de8c1e8f1a101bbfe551c46edca49473f6acd0" Mark #8562 as fixed }}}
Sorry, that’s a typo. I did not do anything about #8562. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2 --------------------------------------------+------------------------------ Reporter: heatsink | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC doesn't work at all | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8561 --------------------------------------------+------------------------------ Changes (by nkpart): * cc: nkpart@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2
--------------------------------------------+------------------------------
Reporter: heatsink | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.7
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC doesn't work at all | (amd64)
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets: #8561
--------------------------------------------+------------------------------
Comment (by Austin Seipp

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2 --------------------------------------------+------------------------------ Reporter: heatsink | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC doesn't work at all | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8561 --------------------------------------------+------------------------------ Changes (by thoughtpolice): * status: new => closed * resolution: => fixed Comment: This should now be fixed, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2 --------------------------------------------+------------------------------ Reporter: heatsink | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC doesn't work at all | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8561 --------------------------------------------+------------------------------ Changes (by heatsink): * owner: simonmar => * status: closed => new * resolution: fixed => Comment: The fix only applies to linux (it's guarded by an `#if defined(linux_HOST_OS)`). On darwin, it still doesn't work. I'm attaching a patch to apply the fix to all OSes. It works for me, but I can't run the validation script because of #8266. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2
--------------------------------------------+------------------------------
Reporter: heatsink | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.7
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC doesn't work at all | (amd64)
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets: #8561
--------------------------------------------+------------------------------
Comment (by Austin Seipp

#8562: Builtin function __builtin___clear_cache is unavailable on GCC 4.2 --------------------------------------------+------------------------------ Reporter: heatsink | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC doesn't work at all | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8561 --------------------------------------------+------------------------------ Changes (by thoughtpolice): * status: new => closed * resolution: => fixed Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8562#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC