public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters
@ 2022-12-05 16:10 cristian.adam at gmail dot com
  2022-12-05 16:14 ` [Bug c++/107974] " cristian.adam at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: cristian.adam at gmail dot com @ 2022-12-05 16:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

            Bug ID: 107974
           Summary: compiler can't find source file in path that is longer
                    than 255 characters
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cristian.adam at gmail dot com
  Target Milestone: ---

Created attachment 54013
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54013&action=edit
clang long path

Given the following path "c:\Projects\C++\this is a rather long path for a path
on windows where long paths are a problem with the limit of two hundred fifty
characters but there is a solution which implies adding a registry key and
configuring the project to include a manifest\hello.cpp"

g++ (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 12.2.0 is not able to
compile the source file.

The error reported is:
cc1plus.exe: fatal error: hello.cpp: No such file or directory

Note that LLVM MinGW 15.0.0's clang.exe was able to compile the file just fine.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
@ 2022-12-05 16:14 ` cristian.adam at gmail dot com
  2022-12-05 16:23 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cristian.adam at gmail dot com @ 2022-12-05 16:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

--- Comment #1 from Cristian Adam <cristian.adam at gmail dot com> ---
Visual C++ 2022 also suffers from the same problem, see
https://developercommunity.visualstudio.com/t/compiler-cant-find-source-file-in-path/10221576

For some reason clang is working fine.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
  2022-12-05 16:14 ` [Bug c++/107974] " cristian.adam at gmail dot com
@ 2022-12-05 16:23 ` pinskia at gcc dot gnu.org
  2022-12-05 16:44 ` [Bug preprocessor/107974] " cristian.adam at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-05 16:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC just does:
    file->fd = open (file->path, O_RDONLY | O_NOCTTY | O_BINARY, 0666);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
  2022-12-05 16:14 ` [Bug c++/107974] " cristian.adam at gmail dot com
  2022-12-05 16:23 ` pinskia at gcc dot gnu.org
@ 2022-12-05 16:44 ` cristian.adam at gmail dot com
  2022-12-05 16:45 ` cristian.adam at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cristian.adam at gmail dot com @ 2022-12-05 16:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

--- Comment #3 from Cristian Adam <cristian.adam at gmail dot com> ---
I've used the manifest tool from Visual C++ (mt.exe) to inject this manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application  xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings
xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>
</assembly>

with the command line:
mt.exe -nologo -manifest "cc1plus.exe.manifest"
-outputresource:"cc1plus.exe;#1"

And I was able to compile the hello.cpp source file!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
                   ` (2 preceding siblings ...)
  2022-12-05 16:44 ` [Bug preprocessor/107974] " cristian.adam at gmail dot com
@ 2022-12-05 16:45 ` cristian.adam at gmail dot com
  2022-12-05 16:48 ` cristian.adam at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cristian.adam at gmail dot com @ 2022-12-05 16:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

--- Comment #4 from Cristian Adam <cristian.adam at gmail dot com> ---
The manifest file is being mentioned at
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
                   ` (3 preceding siblings ...)
  2022-12-05 16:45 ` cristian.adam at gmail dot com
@ 2022-12-05 16:48 ` cristian.adam at gmail dot com
  2022-12-05 16:51 ` pinskia at gcc dot gnu.org
  2022-12-28 21:30 ` nightstrike at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cristian.adam at gmail dot com @ 2022-12-05 16:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

--- Comment #5 from Cristian Adam <cristian.adam at gmail dot com> ---
Created attachment 54016
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54016&action=edit
gcc long path working

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
                   ` (4 preceding siblings ...)
  2022-12-05 16:48 ` cristian.adam at gmail dot com
@ 2022-12-05 16:51 ` pinskia at gcc dot gnu.org
  2022-12-28 21:30 ` nightstrike at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-05 16:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2022-12-05

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I would suspect this is a standard issue with all mingw projects so maybe it is
best to talk with them on how to solve this overall.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
  2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
                   ` (5 preceding siblings ...)
  2022-12-05 16:51 ` pinskia at gcc dot gnu.org
@ 2022-12-28 21:30 ` nightstrike at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: nightstrike at gmail dot com @ 2022-12-28 21:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974

nightstrike <nightstrike at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nightstrike at gmail dot com

--- Comment #7 from nightstrike <nightstrike at gmail dot com> ---
Someone with build system experience could modify the build of the toolchain
binaries to include a call to windres to add the manifest. This would just be
gcc itself and not what gcc produces. I guess maybe the binutils executables
would benefit also.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-28 21:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05 16:10 [Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters cristian.adam at gmail dot com
2022-12-05 16:14 ` [Bug c++/107974] " cristian.adam at gmail dot com
2022-12-05 16:23 ` pinskia at gcc dot gnu.org
2022-12-05 16:44 ` [Bug preprocessor/107974] " cristian.adam at gmail dot com
2022-12-05 16:45 ` cristian.adam at gmail dot com
2022-12-05 16:48 ` cristian.adam at gmail dot com
2022-12-05 16:51 ` pinskia at gcc dot gnu.org
2022-12-28 21:30 ` nightstrike at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).