[GHC] #11684: Fix tests with Clang
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Configuring GHC with `--with-gcc=clang` and then running the tests currently causes over 100 test failues. The vast majority are due to stderr differences due to Clang producing more warnings, specifically `warning: argument unused during compilation`. The obvious solution would be to filter these out in the testsuite runner. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): Apparently there is also a Clang specific `-Qunused-arguments` that disables this warning. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): If I hack `aclocal.m4` to add `-Qunused-arguments` so that it end up in the `settings` file then do `./configure --with-gcc=clang` and build, the the stage0 fails building `ghc-cabal` because GCC doesn't understand `-Qunused-arguments`. @thomie should the stage0 C compiler be using the CFLAGs from the `settings` file? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): My change modifies `FPTOOLS_SET_C_LD_FLAGS` from `aclocal.m4` as follows: {{{ diff --git a/aclocal.m4 b/aclocal.m4 index 49c575e..de24752 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -615,6 +615,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], then $2="$$2 -fno-stack-protector" fi + if $CC -c conftest.c -Qunused-arguments > /dev/null 2>&1 + then + $2="$$2 -Qunused-arguments" + fi }}} If that modifies the CFLAGS for the stage0 compiler then this is obviously the wrong approach. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): From IRC: {{{ <thomie> erikd: FPTOOLS_SET_C_LD_FLAGS also sets CONF_CC_OPTS_STAGE0 it seems <thomie> FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0], [CONF_CPP_OPTS_STAGE0]) <thomie> in configure.ac }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Changes (by erikd): * differential: => Phab:D1986 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): Turns out the warnings are coming from Clang when compiling an assembler file. The configure test therefore needs to test for that. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): That makes more sense. We can also just not pass those arguments when running the assembler. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): Looking at `compiler/main/DriverPipeline.hs` now. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): Interestingly, `DriverPipeline.hs` already optionally adds `-Qunused- arguments` when the compiler is Clang. For some reason, Debian's Clang is not being recognised as Clang. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1986 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): For some reaosn `DriverPiplelne.mkExtraObj` is calling `SysTools.runCc` directly, on assembly language files while most other assembly language files get passed through `DriverPiplelne.runPhase`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1988 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * differential: Phab:D1986 => Phab:D1988 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1988 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Erik de Castro Lopo <erikd@…>): In [changeset:"46f9a476e17714e27d893b491cc0dcf68c745249/ghc" 46f9a47/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="46f9a476e17714e27d893b491cc0dcf68c745249" DriverPipeline: Fix 'unused arguments' warnings from Clang When using Clang as the C compiler, over 100 tests were failing due to Clang reporting that some command line arguments were not being used. These warnings only occur when Clang is compiling assembler files which happens in two places, one of which already conditionally adding `-Qunused-arguments` to the command line when the compiler was Clang. This fixes the other. Test Plan: validate with clang as the C compiler Reviewers: bgamari, hvr, austin, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1998 GHC Trac Issues: #11684 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1988 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:13> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11684: Fix tests with Clang -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1988 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: 8.2.1 => 8.0.1 Comment: Merged as 02e10ffc9f26ce4cebcb9c29c45e68682d18727f. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11684#comment:14> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC