public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
@ 2022-01-21  5:50 unlvsur at live dot com
  2022-01-21  5:51 ` [Bug c++/104157] " unlvsur at live dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  5:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104157
           Summary: libc++ does not work properly with x86_64-w64-mingw32
                    host, but works fine with x86_64-linux-gnu host
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

d:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\c++\v1\cstddef:44:25:
error: no include path in which to search for stddef.h
   44 | #include_next <stddef.h>
      |                         ^
d:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\c++\v1\cstddef:49:9:
error: 'ptrdiff_t' has not been declared in '::'
   49 | using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
      |         ^~~~~~~~~
d:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\c++\v1\cstddef:50:9:
error: 'size_t' has not been declared in '::'
   50 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      |         ^~~~~~
d:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\c++\v1\cstddef:53:9:
error: 'max_align_t' has not been declared in '::'


It cannot find the include path correctly for libc++ when host is windows.

D:\hg\fast_io\examples\0001.helloworld>aarch64-linux-android-g++ -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-android-g++
COLLECT_LTO_WRAPPER=d:/x86_64-windows-gnu/aarch64-linux-android/bin/../libexec/gcc/aarch64-linux-android/12.0.1/lto-wrapper.exe
Target: aarch64-linux-android
Configured with: ../../../../gcc/configure --disable-nls --disable-werror
--target=aarch64-linux-android
--prefix=/home/cqwrteur/toolchains/gnu/x86_64-w64-mingw32/aarch64-linux-android
--enable-languages=c,c++ --disable-libstdcxx-verbose --disable-multilib
--with-gxx-libcxx-include-dir=/home/cqwrteur/toolchains/gnu/x86_64-w64-mingw32/aarch64-linux-android/aarch64-linux-android/include/c++/v1
--host=x86_64-w64-mingw32
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220121 (experimental) (GCC)

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
@ 2022-01-21  5:51 ` unlvsur at live dot com
  2022-01-21  8:43 ` pinskia at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  5:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
D:\hg\fast_io\examples\0001.helloworld>aarch64-linux-android-g++ -o helloworld
helloworld.cc -Ofast -std=c++23 -s -flto -I../../include -Wall -stdlib=libc++
-std=c++2b

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
  2022-01-21  5:51 ` [Bug c++/104157] " unlvsur at live dot com
@ 2022-01-21  8:43 ` pinskia at gcc dot gnu.org
  2022-01-21  8:47 ` unlvsur at live dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2022-01-21

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Where is the target stddef.h located?
Can you add -v while compiling and provide the full output?

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
  2022-01-21  5:51 ` [Bug c++/104157] " unlvsur at live dot com
  2022-01-21  8:43 ` pinskia at gcc dot gnu.org
@ 2022-01-21  8:47 ` unlvsur at live dot com
  2022-01-21  8:51 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
Created attachment 52253
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52253&action=edit
error message on windows

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2022-01-21  8:47 ` unlvsur at live dot com
@ 2022-01-21  8:51 ` pinskia at gcc dot gnu.org
  2022-01-21  8:54 ` unlvsur at live dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
inside d:\x86_64-windows-gnu\aarch64-linux-android can you find all files
called stddef.h and print their path?

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2022-01-21  8:51 ` pinskia at gcc dot gnu.org
@ 2022-01-21  8:54 ` unlvsur at live dot com
  2022-01-21  9:00 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from cqwrteur <unlvsur at live dot com> ---
(In reply to Andrew Pinski from comment #4)
> inside d:\x86_64-windows-gnu\aarch64-linux-android can you find all files
> called stddef.h and print their path?

D:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\c++\v1
D:\x86_64-windows-gnu\aarch64-linux-android\aarch64-linux-android\include\linux
D:\x86_64-windows-gnu\aarch64-linux-android\lib\gcc\aarch64-linux-android\12.0.1\include

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2022-01-21  8:54 ` unlvsur at live dot com
@ 2022-01-21  9:00 ` pinskia at gcc dot gnu.org
  2022-01-21  9:02 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You say it works with the host as linux, can you show the output of -v while
compiling?

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2022-01-21  9:00 ` pinskia at gcc dot gnu.org
@ 2022-01-21  9:02 ` pinskia at gcc dot gnu.org
  2022-01-21  9:07 ` unlvsur at live dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
By the way the order looks wrong:


d:\x86_64-windows-gnu\aarch64-linux-android\bin\../lib/gcc/aarch64-linux-android/12.0.1/include

d:\x86_64-windows-gnu\aarch64-linux-android\bin\../lib/gcc/aarch64-linux-android/12.0.1/include-fixed

d:\x86_64-windows-gnu\aarch64-linux-android\bin\../lib/gcc/aarch64-linux-android/12.0.1/../../../../aarch64-linux-android/include

d:/x86_64-windows-gnu/aarch64-linux-android/lib/gcc/../../aarch64-linux-android/include/c++/v1

C++ includes should be first. really

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2022-01-21  9:02 ` pinskia at gcc dot gnu.org
@ 2022-01-21  9:07 ` unlvsur at live dot com
  2022-01-21  9:08 ` unlvsur at live dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from cqwrteur <unlvsur at live dot com> ---
Created attachment 52254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52254&action=edit
result from linux

Yes on linux include/v1/c++ goes first.


BTW Can we just make 

--with-gxx-libcxx-include-dir=$PREFIX/$TARGET/include/c++/v1 by default unless
users set it?
It is annoying to set this every time for configuring. It should by default the
same as libstdc++

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

* [Bug c++/104157] libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2022-01-21  9:07 ` unlvsur at live dot com
@ 2022-01-21  9:08 ` unlvsur at live dot com
  2022-01-21  9:18 ` [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last) pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from cqwrteur <unlvsur at live dot com> ---
(In reply to Andrew Pinski from comment #6)
> You say it works with the host as linux, can you show the output of -v while
> compiling?

Same issue happens with x86_64-ubuntu-linux-gnu target, x86_64-w64-mingw32 host
too.

Looks like we have some issues dealing with this on windows at the compiler
side.

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

* [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last)
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2022-01-21  9:08 ` unlvsur at live dot com
@ 2022-01-21  9:18 ` pinskia at gcc dot gnu.org
  2022-01-21  9:20 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  9:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED
            Summary|libc++ does not work        |-std=libc++ does not with
                   |properly with               |cross compilers and moving
                   |x86_64-w64-mingw32 host,    |the install around (places
                   |but works fine with         |the include path last)
                   |x86_64-linux-gnu host       |
     Ever confirmed|1                           |0

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #8)
> Created attachment 52254 [details]
> result from linux
> 
> Yes on linux include/v1/c++ goes first.

The main difference is the addition of:
-iprefix
d:\x86_64-windows-gnu\aarch64-linux-android\bin\../lib/gcc/aarch64-linux-android/12.0.1/

The problem is somewhere in add_standard_paths 


My guess is if you move the install directory for the linux case, the problem
on Linux will show up too.

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

* [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last)
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (9 preceding siblings ...)
  2022-01-21  9:18 ` [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last) pinskia at gcc dot gnu.org
@ 2022-01-21  9:20 ` pinskia at gcc dot gnu.org
  2022-01-21  9:36 ` unlvsur at live dot com
  2022-01-21  9:38 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Somehow add_standard_paths is doing the wrong thing when -iprefix is applied
but I have no idea how or why. This definitely needs to be fixed but it is a
low priority as -std=libc++ is not used that much, especially with
non-sysrooted cross compilers.

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

* [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last)
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (10 preceding siblings ...)
  2022-01-21  9:20 ` pinskia at gcc dot gnu.org
@ 2022-01-21  9:36 ` unlvsur at live dot com
  2022-01-21  9:38 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-01-21  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from cqwrteur <unlvsur at live dot com> ---
well. plus canadian cross back compiler From windows to linux.
probably only i cross compile Linux programs on windows.(several other people
downloaded my toolchains.)


Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: pinskia at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
Sent: Friday, January 21, 2022 4:20:19 AM
To: unlvsur@live.com <unlvsur@live.com>
Subject: [Bug c++/104157] -std=libc++ does not with cross compilers and moving
the install around (places the include path last)

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

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Somehow add_standard_paths is doing the wrong thing when -iprefix is applied
but I have no idea how or why. This definitely needs to be fixed but it is a
low priority as -std=libc++ is not used that much, especially with
non-sysrooted cross compilers.

--
You are receiving this mail because:
You reported the bug.
You are on the CC list for the bug.

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

* [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last)
  2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
                   ` (11 preceding siblings ...)
  2022-01-21  9:36 ` unlvsur at live dot com
@ 2022-01-21  9:38 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #12)
> well. plus canadian cross back compiler From windows to linux.
> probably only i cross compile Linux programs on windows.(several other
> people downloaded my toolchains.)

Yes but hardly anyone uses -std=libc++ in general :). And using non-sysroot
these days is not really supported and for good reasons.

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

end of thread, other threads:[~2022-01-21  9:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21  5:50 [Bug c++/104157] New: libc++ does not work properly with x86_64-w64-mingw32 host, but works fine with x86_64-linux-gnu host unlvsur at live dot com
2022-01-21  5:51 ` [Bug c++/104157] " unlvsur at live dot com
2022-01-21  8:43 ` pinskia at gcc dot gnu.org
2022-01-21  8:47 ` unlvsur at live dot com
2022-01-21  8:51 ` pinskia at gcc dot gnu.org
2022-01-21  8:54 ` unlvsur at live dot com
2022-01-21  9:00 ` pinskia at gcc dot gnu.org
2022-01-21  9:02 ` pinskia at gcc dot gnu.org
2022-01-21  9:07 ` unlvsur at live dot com
2022-01-21  9:08 ` unlvsur at live dot com
2022-01-21  9:18 ` [Bug c++/104157] -std=libc++ does not with cross compilers and moving the install around (places the include path last) pinskia at gcc dot gnu.org
2022-01-21  9:20 ` pinskia at gcc dot gnu.org
2022-01-21  9:36 ` unlvsur at live dot com
2022-01-21  9:38 ` pinskia at gcc dot gnu.org

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).