[GHC] #12759: Latest Debian GCC breajs GHC
#12759: Latest Debian GCC breajs GHC ----------------------------------------+-------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: Other Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+-------------------------- Just got `gcc (Debian 6.2.0-9) 6.2.0 20161019` in a recent upgrade (Debian Testing) and now: {{{
cat hello.hs main :: IO () main = putStrLn "Hello"
ghc hello.hs -o hello [1 of 1] Compiling Main ( hello.hs, hello.o ) Linking hello ... /usr/bin/ld: hello.o: relocation R_X86_64_32S against symbol `stg_bh_upd_frame_info' \ can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/lib/ghc-8.0/lib/base-4.9.0.0/libHSbase-4.9.0.0.a(Base__166.o): \ relocation R_X86_64_32S against symbol `stg_bh_upd_frame_info' can not be used when \ making a shared object; recompile with -fPIC .... }}}
The previous version of gcc in Debian Testing (gcc (Debian 6.2.0-6) 6.2.0 20161010) is fine. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breajs GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): Almost certain this is due to: https://bugs.debian.org/cgi- bin/bugreport.cgi?bug=835148 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breajs GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): Debain allows parallel installs of GCC, so for now I've worked around this issue by switching the default compiler to gcc-5 (gcc-5 (Debian 5.4.1-3) 5.4.1 20161019). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): The Debian package for GHC 8.0 now carries two patches: {{{ --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3631,14 +3631,8 @@ default_PIC :: Platform -> [GeneralFlag] default_PIC platform = case (platformOS platform, platformArch platform) of - (OSDarwin, ArchX86_64) -> [Opt_PIC] - (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in - -- OpenBSD since 5.3 release - -- (1 May 2013) we need to - -- always generate PIC. See - -- #10597 for more - -- information. - _ -> [] + (OSLinux, ArchPPC) -> [] + _ -> [Opt_PIC] -- General flags that are switched on/off when other general flags are switched -- on }}} and {{{ Description: Pass -no-pie along with -Wl,-r GHC uncoditionally passes `-Wl,-r' to gcc in `compiler/main/DriverPipeline.hs'. This fails in cases where PIE is enabled by default with the following error: . /usr/bin/ld: -r and -pie may not be used together . Fix the above error by passing `-no-pie' along with `-Wl,-r' to the compiler. Author: Ilias Tsitsimpis <i.tsitsimpis@gmail.com> Bug: https://ghc.haskell.org/trac/ghc/ticket/11834 Bug-Debian: https://bugs.debian.org/712228 Forwarded: no Index: b/compiler/main/DriverPipeline.hs =================================================================== --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2145,7 +2145,8 @@ joinObjectFiles dflags o_files output_fn osInfo = platformOS (targetPlatform dflags) ld_r args cc = SysTools.runLink dflags ([ SysTools.Option "-nostdlib", - SysTools.Option "-Wl,-r" + SysTools.Option "-Wl,-r", + SysTools.Option "-no-pie" ] ++ (if any (cc ==) [Clang, AppleClang, AppleClang51] then [] }}} Obviously these patches, in their current state, are not suitable for inclusion in GHC. It looks like the use of PIC and PIE needs to be detected at configure/compile time. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): With the above two patches, over 100 of the tests in the testsuie fail (mostly the TH related tests). Dropping those patches and configuring GHC as suggested by @hvr: {{{ ./configure \ CONF_CC_OPTS_STAGE2=-fno-PIE \ CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \ CONF_LD_LINKER_OPTS_STAGE2=-no-pie }}} results in a GHC that passes all tests. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by clint): -fno-PIE causes things using hsc2hs to break horribly -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Changes (by bgamari): * cc: bgamari (added) Comment: I am also seeing this now. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): I grabbed the source for "magic", unpacked them and tried to build them. `hsc2hs` failed so I added `-v` to the command line and this is what I got: {{{
/usr/lib/ghc-8.0/bin/hsc2hs -v '--cc=/usr/bin/gcc' '--ld=/usr/bin/gcc' '--cflag=-fno-PIE' '--cflag=-fno-stack-protector' '--lflag=-fno-PIE' '--lflag=-fno-stack-protector' '--cflag=-D__GLASGOW_HASKELL__=800' '--cflag=-Dlinux_BUILD_OS=1' '--cflag=-Dx86_64_BUILD_ARCH=1' '--cflag=-Dlinux_HOST_OS=1' '--cflag=-Dx86_64_HOST_ARCH=1' '--cflag=-Idist/build/autogen''--cflag=-include' '--cflag=dist/build/autogen/cabal_macros.h' '--lflag=-lmagic' '--cflag=-I/usr/lib/ghc-8.0/lib/base-4.9.0.0/include' '--cflag=-I/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1/include' '--cflag=-I/usr/lib/ghc-8.0/lib/include' '--lflag=-L/usr/lib/ghc-8.0/lib/base-4.9.0.0' '--lflag=-Wl,-R,/usr/lib/ghc-8.0/lib/base-4.9.0.0' '--lflag=-L/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1' '--lflag=-Wl,-R,/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1' '--lflag=-lgmp' '--lflag=-L/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0' '--lflag=-Wl,-R,/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0' '--lflag=-L/usr/lib/ghc-8.0/lib/rts' '--lflag=-Wl,-R,/usr/lib/ghc-8.0/lib/rts' '--lflag=-lm' '--lflag=-lrt' '--lflag=-ldl' '--lflag=-lffi' -o dist/build/Magic/Data.hs Magic/Data.hsc
Executing: /usr/bin/gcc -c dist/build/Magic/Data_hsc_make.c -o dist/build/Magic/Data_hsc_make.o -fno-stack-protector -fno-PIE -fno-stack-protector -D__GLASGOW_HASKELL__=800 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/lib/ghc-8.0/lib/base-4.9.0.0/include -I/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1/include -I/usr/lib/ghc-8.0/lib/include -I/usr/lib/ghc-8.0/lib/include/ Executing: /usr/bin/gcc -c dist/build/Magic/Data_hsc_utils.c -o dist/build/Magic/Data_hsc_utils.o -fno-stack-protector -fno-PIE -fno-stack-protector -D__GLASGOW_HASKELL__=800 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/lib/ghc-8.0/lib/base-4.9.0.0/include -I/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1/include -I/usr/lib/ghc-8.0/lib/include -I/usr/lib/ghc-8.0/lib/include/ Executing: /usr/bin/gcc dist/build/Magic/Data_hsc_make.o dist/build/Magic/Data_hsc_utils.o -o dist/build/Magic/Data_hsc_make -fno-PIE -fno-stack-protector -lmagic -L/usr/lib/ghc-8.0/lib/base-4.9.0.0 -Wl,-R,/usr/lib/ghc-8.0/lib/base-4.9.0.0 -L/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1 -Wl,-R,/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1 -lgmp -L/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0 -Wl,-R,/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0 -L/usr/lib/ghc-8.0/lib/rts -Wl,-R,/usr/lib/ghc-8.0/lib/rts -lm -lrt -ldl -lffi /usr/bin/ld: dist/build/Magic/Data_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): The interesting bits of `ghc --info`: {{{ [("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv -fno-builtin") ,("C compiler command","/usr/bin/gcc") ,("C compiler flags","-fno-PIE -fno-stack-protector") ,("C compiler link flags","-no-pie") ,("Haskell CPP command","/usr/bin/gcc") ,("Haskell CPP flags","-E -undef -traditional") ,("ld command","/usr/bin/ld") ,("ld flags","-no-pie") ,("ld supports compact unwind","YES") ,("ld supports build-id","YES") ,("ld supports filelist","NO") ,("ld is GNU ld","YES") ,("ar command","/usr/bin/ar") ,("ar flags","q") ,("ar supports at file","YES") ,("touch command","touch") ,("dllwrap command","/bin/false") ,("windres command","/bin/false") ,("libtool command","libtool") ,("perl command","/usr/bin/perl") ,("cross compiling","NO") ,("target os","OSLinux") ,("target arch","ArchX86_64") ,("target word size","8") ,("target has GNU nonexec stack","True") ,("target has .ident directive","True") ,("target has subsections via symbols","False") ,("Unregisterised","NO") ,("LLVM llc command","/usr/bin/llc-3.7") ,("LLVM opt command","/usr/bin/opt-3.7") ... }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by erikd): According to @hvr, this is likely a cabal bug that has been fixed (https://git.haskell.org/packages/Cabal.git/commitdiff/c30b179a73d9fd3f6edcdd...) but not released yet. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by bgamari): So I spent quite a while today working through building a tree with the new compiler. It turns out there are a number of build system issues which get in the way of this which I've fixed in Phab:D2672, Phab:D2673, and Phab:D2674. With these patches you can simply configure with, {{{ $ ./configure \ CONF_GCC_LINKER_OPTS_STAGE0=-no-pie \ CONF_LD_LINKER_OPTS_STAGE0=-no-pie \ CONF_HC_OPTS_STAGE0=-optl=-no-pie }}} and build as usual. It's not entirely clear here why the Haskell compiler options shouldn't just include `CONF_LD_LINKER_OPTS_*` with the appropriate prefix but I didn't want to change that today so instead I just passed `CONF_HC_OPTS_STAGE0` explicitly. Note that it is only necessary to pass `-no-pie` to the stage0 link; the later stages should build with `-fPIC` as this is the new compiler's default. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by rwbarton):
It's not entirely clear here why the Haskell compiler options shouldn't just include `CONF_LD_LINKER_OPTS_*` with the appropriate prefix but I didn't want to change that today so instead I just passed `CONF_HC_OPTS_STAGE0` explicitly.
You mean `CONF_GCC_LINKER_OPTS_STAGE0` :) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"bae4a55b1fb403f610b4b55a1b6fb3f03e9c2026/ghc" bae4a55b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="bae4a55b1fb403f610b4b55a1b6fb3f03e9c2026" Pass -no-pie to GCC Certain distributions (e.g. Debian and Ubuntu) have enabled PIE be default in their GCC packaging. This breaks our abuse of GCC as a linker which requires that we pass -Wl,-r, which is incompatible with PIE (since the former implies that we are generating a relocatable object file and the latter an executable). Test Plan: Validate Reviewers: hvr, austin Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D2691 GHC Trac Issues: #12759 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:13> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by rwbarton): Note that this is still open because of ticket:12755#comment:4, I guess (`-no-pie` setting should be configurable via settings file). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:14> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"d421a7e22e0be3de32376970b8c38ec308f959da/ghc" d421a7e2/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="d421a7e22e0be3de32376970b8c38ec308f959da" Pass -no-pie to GCC Certain distributions (e.g. Debian and Ubuntu) have enabled PIE be default in their GCC packaging. This breaks our abuse of GCC as a linker which requires that we pass -Wl,-r, which is incompatible with PIE (since the former implies that we are generating a relocatable object file and the latter an executable). This is a second attempt at D2691. This attempt constrasts with D2691 in that it preserves the "does gcc support -no-pie" flag in settings, allowing this to be reconfigured by `configure` during installation of a binary distribution. Thanks for @rwbarton for drawing attention to this issue. Test Plan: Validate Reviewers: austin, hvr, erikd Reviewed By: erikd Subscribers: thomie, rwbarton, erikd Differential Revision: https://phabricator.haskell.org/D2693 GHC Trac Issues: #12759 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:15> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -----------------------------+---------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as d421a7e22e0be3de32376970b8c38ec308f959da. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:16> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834 | Differential Rev(s): Phab:D2707 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => new * differential: => Phab:D2707 * resolution: fixed => * related: => #12755, #11834 Comment: It seems that the `configure` check introduced previously isn't robust enough due to some GCC silliness. Prior to 4.8 GCC apparently only warns when faced with an unknown flag, exiting with exit code 0. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:17> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834 | Differential Rev(s): Phab:D2707 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"011af2bf448c28db68a55293abaa5b294f170e37/ghc" 011af2b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="011af2bf448c28db68a55293abaa5b294f170e37" configure: Verify that GCC recognizes -no-pie flag It seems like GCC versions prior to 4.8 exit with code 0 when faced with an unrecognized flag. Silly compilers. Test Plan: Validate Reviewers: hvr, austin, ggreif Reviewed By: ggreif Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D2707 GHC Trac Issues: #12759 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:18> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834 | Differential Rev(s): Phab:D2707 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: Merged to `ghc-9.0` as 5c468247c39d885dfc4bf717ed9e0b01c478ef41. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:19> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834 | Differential Rev(s): Phab:D2707 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): @bgamari, you did mean 8.0 didn't you? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:20> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834 | Differential Rev(s): Phab:D2707 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): @erikd, nope, 9.0. Fixing tomorrows compilers today! ;) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:21> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: #12755, #11834 => #12755, #11834, #9007 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:22> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by msuchanek): * Attachment "_log.txt.xz" added. log of failed ghc build -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by msuchanek): This is still broken in 8.0.2 [ 43s] + /usr/bin/xz -dc /home/abuild/rpmbuild/SOURCES/ghc-8.0.2-src.tar.xz ... [ 48s] checking whether GCC supports -no-pie... yes ... [ 1985s] /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse- linux/bin/ld: /home/abuild/rpmbuild/BUILD/ghc-8.0.2/rts/dist/build/libHSrts.a(AutoApply.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC [ 1985s] /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse- linux/bin/ld: final link failed: Nonrepresentable section on output [ 1985s] collect2: error: ld returned 1 exit status [ 1985s] `gcc' failed in phase `Linker'. (Exit code: 1) [ 1985s] make[1]: *** [utils/ghc-cabal/ghc.mk:89: utils/ghc-cabal/dist- install/build/tmp/ghc-cabal] Error 1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:23> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by slyfox): * cc: slyfox (added) Comment: msuchanek, I suggest filing new bug so we could investigate why host ghc was failing to build stage2 for you. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:24> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a/ghc" 3625728/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a" Add support for producing position-independent executables Previously due to #12759 we disabled PIE support entirely. However, this breaks the user's ability to produce PIEs. Add an explicit flag, -fPIE, allowing the user to build PIEs. Test Plan: Validate Reviewers: rwbarton, austin, simonmar Subscribers: trommler, simonmar, trofi, jrtc27, thomie GHC Trac Issues: #12759, #13702 Differential Revision: https://phabricator.haskell.org/D3589 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:25> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12759: Latest Debian GCC breaks GHC -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12755, #11834, | Differential Rev(s): Phab:D2707 #9007 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): For the record, old (pre-8.0.2) compiler installations can be retrofitted to work with newer gccs by locating the compiler's `settings` file (e.g. `/usr/lib/ghc-7.10.3/settings`) and adding `-no-pie` to `C compiler link flags`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12759#comment:26> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC