[GHC] #12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: FreeBSD Architecture: | Type of failure: Building GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- While trying to build GHC 8.0.1 on FreeBSD 11.x, I come across following compiler error: {{{ /usr/local/bin/clang-cpp38 -DPROFILING -DTHREADED_RTS -DDEBUG -fno- stack-protector -O2 -pipe -Qunused-arguments -I/usr/local/include -fstack-protector -fno-strict-aliasing -Wall -Wall -Wextra -Wstrict- prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Waggregate-return -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Iincludes -Iincludes/dist -Iincludes/dist- derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -fno-strict-aliasing -fno-common -Irts/dist/build/autogen -Wno-unknown-pragmas -O2 -fomit-frame- pointer -g -DRtsWay=\"rts_v\" -MM -x c rts/posix/OSMem.c -MF rts/dist/build/.depend-v-p-dyn-l-debug-thr-thr_debug-thr_l-thr_p- debug_dyn-thr_dyn-thr_debug_dyn-l_dyn-thr_l_dyn.c_asm.bit rts/posix/OSMem.c:158:5: error: USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE # error USE_LARGE_ADDRESS_SPACE needs MAP_NORESERVE ^ 1 error generated. }}} From some [https://svnweb.freebsd.org/base/head/sys/sys/mman.h?r1=273249&r2=273250& investigation], it turns out when it was there, it was not even implemented. The value of `__FreeBSD_version` (in case you plan to add conditional based on it), where it is [https://svnweb.freebsd.org/base/head/sys/sys/param.h?r1=273250&r2=273249&pathrev=273250 changed] is `1100039`. Let me know if you need more information. Thanks for looking -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: Ashish SHUKLA | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Erik de Castro Lopo): You can get around this by configuring GHC with `--disable-large-address- space` and rebuilding it. This turns off the large address space features to give the same behavior as versions of GHC before 8.0. It would also be interesting to test whether `#defined MAP_NO_RESERVE 0` at the top of `rts/posix/OSMem.c` and configuring with `--enable-large- address-space` results in a working compiler. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dmm): I had no issue building stack and purescript with ghc 8.0.1 on FreeBSD 11 after adding #define MAP_NORESERVE 0 to rts/posix/OSMem.c Building 8.0.2 now with same define. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dmm): While 8.0.2 did build fine, I see lots of these on console: {{{ swap_pager_getswapspace(8): failed swap_pager_getswapspace(14): failed swap_pager_getswapspace(9): failed ... }}} That may have existed for 8.0.1 too and I missed it. Given the nature of use for MAP_NORESERVE change, it may be responsible for this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): I think info about this should at least be added to https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/FreeBSD -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I've noted this on [[Building/Preparation/FreeBSD]]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12695: Build failure due to MAP_NORESERVE being removed in FreeBSD 11.x and later -------------------------------------+------------------------------------- Reporter: abbe | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: FreeBSD | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #15348 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * related: => #15348 * milestone: => 8.6.1 Comment: Note that the two-step allocator is now supported on FreeBSD. See #15348. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12695#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC