[GHC] #13666: The fake gcc can't handle trailing backslashes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[GHC] #13666: The fake gcc can't handle trailing backslashes

GHC - devs mailing list
#13666: The fake gcc can't handle trailing backslashes
----------------------------------------+---------------------------------
           Reporter:  niklasl           |             Owner:  (none)
               Type:  bug               |            Status:  new
           Priority:  low               |         Milestone:
          Component:  Driver            |           Version:  8.0.1
           Keywords:                    |  Operating System:  Windows
       Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
          Test Case:                    |        Blocked By:
           Blocking:                    |   Related Tickets:
Differential Rev(s):                    |         Wiki Page:
----------------------------------------+---------------------------------
 The fake gcc will choke on trailing backslashes in arguments, like
 -Iinclude\ or -Llibs\. `realgcc` handles them fine. It seems to insert as
 spurious quote or terminating a quote too early.

 Error message:
 {{{
 .\test-ghc.c:1:20: fatal error: test-inc"/header.h: Invalid argument
 compilation terminated.
 }}}

 Found here: [https://github.com/idris-lang/Idris-dev/issues/3801]

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The fake gcc can't handle trailing backslashes

GHC - devs mailing list
#13666: The fake gcc can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Description changed by niklasl:

@@ -2,2 +2,2 @@
- -Iinclude\ or -Llibs\. `realgcc` handles them fine. It seems to insert as
- spurious quote or terminating a quote too early.
+ `-Iinclude\` or `-Llibs\`. `realgcc` handles them fine. It seems to insert
+ as spurious quote or terminating a quote too early.

New description:

 The fake gcc will choke on trailing backslashes in arguments, like
 `-Iinclude\` or `-Llibs\`. `realgcc` handles them fine. It seems to insert
 as spurious quote or terminating a quote too early.

 Error message:
 {{{
 .\test-ghc.c:1:20: fatal error: test-inc"/header.h: Invalid argument
 compilation terminated.
 }}}

 Found here: [https://github.com/idris-lang/Idris-dev/issues/3801]

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The fake gcc can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The fake gcc can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by bgamari):

 "Fake gcc" here means ghc invoked on a C source file.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The fake gcc can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The fake gcc can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by niklasl):

 I meant the gcc wrapper in `driver/gcc`. I just didn't find a good word
 for it.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes (was: The fake gcc can't handle trailing backslashes)

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Description changed by niklasl:

@@ -1,1 +1,1 @@
- The fake gcc will choke on trailing backslashes in arguments, like
+ The gcc wrapper will choke on trailing backslashes in arguments, like

New description:

 The gcc wrapper will choke on trailing backslashes in arguments, like
 `-Iinclude\` or `-Llibs\`. `realgcc` handles them fine. It seems to insert
 as spurious quote or terminating a quote too early.

 Error message:
 {{{
 .\test-ghc.c:1:20: fatal error: test-inc"/header.h: Invalid argument
 compilation terminated.
 }}}

 Found here: [https://github.com/idris-lang/Idris-dev/issues/3801]

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * Attachment "0001-Handle-trailing-backslashes-in-gcc-wrapper.patch"
 added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * status:  new => patch


Comment:

 Added a patch. The trailing backslash escapes the quote, so it needs to be
 escaped.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * Attachment "0001-Handle-trailing-backslashes-in-gcc-wrapper.2.patch"
 added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * Attachment "0001-Handle-trailing-backslashes-in-gcc-wrapper.patch"
 added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * Attachment "0001-Handle-trailing-backslashes-in-gcc-wrapper.patch"
 added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by niklasl):

 * Attachment "0001-Handle-trailing-backslashes-in-gcc-wrapper.2.patch"
 added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by bgamari):

 Should we disregard one of these? They look identical.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by niklasl):

 Yes, they're the same patch.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by Phyx-):

 Unless I'm misunderstanding, is it not sufficient to add `|| *src == '\\'`
 to line 62?
 https://github.com/ghc/ghc/blob/master/driver/utils/cwrapper.c#L62, that
 would be logically more consistent because it means you're adding a
 character to the list of characters that need escaping.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #13709        |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by Phyx-):

 * related:   => #13709


Comment:

 Also I'm dropping the driver all together (see #13709), but this change
 would still be useful as this file is used for other things.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #13709        |  Differential Rev(s):  Phab:D3628
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by Phyx-):

 * differential:   => Phab:D3628


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  patch
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #13709        |  Differential Rev(s):  Phab:D3628
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by Tamar Christina <tamar@…>):

 In [changeset:"bca56bd040de64315564cdac4b7e943fc8a75ea0/ghc" bca56bd/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="bca56bd040de64315564cdac4b7e943fc8a75ea0"
 Fix slash escaping in cwrapper.c

 Summary: Escape `\` in paths on Windows in `cwapper.c` when we re-output
 the paths.

 Test Plan: ./validate

 Reviewers: austin, bgamari

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13666

 Differential Revision: https://phabricator.haskell.org/D3628
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13666: The gcc wrapper can't handle trailing backslashes

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13666: The gcc wrapper can't handle trailing backslashes
---------------------------------+----------------------------------------
        Reporter:  niklasl       |                Owner:  (none)
            Type:  bug           |               Status:  closed
        Priority:  low           |            Milestone:
       Component:  Driver        |              Version:  8.0.1
      Resolution:  fixed         |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #13709        |  Differential Rev(s):  Phab:D3628
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by Phyx-):

 * status:  patch => closed
 * resolution:   => fixed


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13666#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets