public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope
@ 2021-03-10  0:08 unlvsur at live dot com
  2021-03-10  0:25 ` [Bug libstdc++/99499] build failure for android " unlvsur at live dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10  0:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99499
           Summary: bootstrap failure for bionic toolchains. error: '_U'
                    was not declared in this scope
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

Created attachment 50343
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50343&action=edit
error message

error: '_U' was not declared in this scope

Android is wierd

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

* [Bug libstdc++/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
@ 2021-03-10  0:25 ` unlvsur at live dot com
  2021-03-10 12:10 ` [Bug target/99499] " redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10  0:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
Probably just remove this file and use the generic one it would work?
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/config/os/bionic/ctype_base.h

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
  2021-03-10  0:25 ` [Bug libstdc++/99499] build failure for android " unlvsur at live dot com
@ 2021-03-10 12:10 ` redi at gcc dot gnu.org
  2021-03-10 16:20 ` unlvsur at live dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-10 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
          Component|libstdc++                   |target
                 CC|                            |mkuvyrkov at gcc dot gnu.org
               Host|x86_64-msys2-mingw-w64,     |x86_64-msys2-mingw-w64
                   |windows 10                  |

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Obviously _U worked at some point when that file was added. CCing Maxim to
figure out what changed and whether we want to support the old ctype constants
as well as whatever Android defines now.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
  2021-03-10  0:25 ` [Bug libstdc++/99499] build failure for android " unlvsur at live dot com
  2021-03-10 12:10 ` [Bug target/99499] " redi at gcc dot gnu.org
@ 2021-03-10 16:20 ` unlvsur at live dot com
  2021-03-10 20:53 ` unlvsur at live dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Obviously _U worked at some point when that file was added. CCing Maxim to
> figure out what changed and whether we want to support the old ctype
> constants as well as whatever Android defines now.

I guess now Android has now shifted to LLVM and no one tested that on GCC
anymore.

I tweak around the value by myself and no it does not work, unfortunately.

d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/bin/ld.exe:
d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/lib/../lib64/libstdc++.so:
undefined reference to `std::ctype<char>::ctype(unsigned short const*, bool,
unsigned long)'
d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/bin/ld.exe:
d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/lib/../lib64/libstdc++.so:
undefined reference to `std::ctype<char>::ctype(unsigned short const*, bool,
unsigned long)'
d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/bin/ld.exe:
d:/msys64/x86_64-linux-android/bin/../lib/gcc/x86_64-linux-android/11.0.1/../../../../x86_64-linux-android/lib/../lib64/libstdc++.so:
undefined reference to `std::ctype<char>::ctype(int*, unsigned short const*,
bool, unsigned long)'
collect2.exe: error: ld returned 1 exit status


Looks like we need actual values.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2021-03-10 16:20 ` unlvsur at live dot com
@ 2021-03-10 20:53 ` unlvsur at live dot com
  2021-03-10 21:07 ` unlvsur at live dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from cqwrteur <unlvsur at live dot com> ---
Hi, jonathan. I found something different from old versions of android compared
to GCC source.

https://android.googlesource.com/toolchain/gcc/+/refs/heads/ndk-r11-release/gcc-4.9/libstdc++-v3/config/os/bionic/ctype_base.h

#if defined (__ANDROID__)
#if !defined(_U)
#if !defined(_CTYPE_U)
#error Bionic header ctype.h does not define either _U nor _CTYPE_U
#endif
#define _U _CTYPE_U
#define _L _CTYPE_L
#define _N _CTYPE_N
#define _S _CTYPE_S
#define _P _CTYPE_P
#define _C _CTYPE_C
#define _X _CTYPE_X
#define _B _CTYPE_B
#endif
#endif /* __ANDROID__ */

Let me have a look on this, probably i can provide patch by myself.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2021-03-10 20:53 ` unlvsur at live dot com
@ 2021-03-10 21:07 ` unlvsur at live dot com
  2021-03-10 21:47 ` unlvsur at live dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 21:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50356
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50356&action=edit
ctype.h

ctype.h actually provides those macros. but they said

"Internal implementation detail. Do not use."


I try to use these macros directly with a simple hello world program. These 
_CTYPE_XXX macros do not exist.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2021-03-10 21:07 ` unlvsur at live dot com
@ 2021-03-10 21:47 ` unlvsur at live dot com
  2021-03-10 23:52 ` unlvsur at live dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 21:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50357
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50357&action=edit
Bionic ctype patch for libstdc++

It looks macros are defined differently on different versions of bionic. The
latest bionic those macros might no longer be accessible.

Here is an old version of it
https://github.com/gentoobionic/bionic/blob/d65ab1d9017fe191208974be49aa244688177e26/libc/include/ctype.h

To get rid of the trouble, I define macros by myself and rename those macros
from _X to _GLIBCXX_X to avoid potential collision.

Rename _U to _GLIBCXX_U for example.

Also, i clean up the indent and make blank accessible even we are using C++98
since the generic version does that too.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2021-03-10 21:47 ` unlvsur at live dot com
@ 2021-03-10 23:52 ` unlvsur at live dot com
  2021-03-10 23:54 ` unlvsur at live dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 23:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50358
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50358&action=edit
The patch works. No issue.

Jonathan, you can merge my patch to master now.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2021-03-10 23:52 ` unlvsur at live dot com
@ 2021-03-10 23:54 ` unlvsur at live dot com
  2021-03-10 23:55 ` unlvsur at live dot com
  2023-02-19 23:11 ` lbr-dev at yandex dot com
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 23:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50359
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50359&action=edit
Hello world runs successfully

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2021-03-10 23:54 ` unlvsur at live dot com
@ 2021-03-10 23:55 ` unlvsur at live dot com
  2023-02-19 23:11 ` lbr-dev at yandex dot com
  9 siblings, 0 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2021-03-10 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from cqwrteur <unlvsur at live dot com> ---
The only problem now is due to privilege issues, we cannot dynamic linking with
libstdc++-6.so

I think they can just use fast_io instead and that will avoid the bloating
here.

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

* [Bug target/99499] build failure for android bionic toolchains. error: '_U' was not declared in this scope
  2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2021-03-10 23:55 ` unlvsur at live dot com
@ 2023-02-19 23:11 ` lbr-dev at yandex dot com
  9 siblings, 0 replies; 11+ messages in thread
From: lbr-dev at yandex dot com @ 2023-02-19 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

DEV LBR <lbr-dev at yandex dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lbr-dev at yandex dot com

--- Comment #10 from DEV LBR <lbr-dev at yandex dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Obviously _U worked at some point when that file was added. CCing Maxim to
> figure out what changed and whether we want to support the old ctype
> constants as well as whatever Android defines now.

With regard to this bug, I think you can directly use the official patch of
Android NDK (see
https://android.googlesource.com/toolchain/gcc/+/44ea170a62f4bb566c5487c446a31300d1e0e319%5E%21/).

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

end of thread, other threads:[~2023-02-19 23:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10  0:08 [Bug libstdc++/99499] New: bootstrap failure for bionic toolchains. error: '_U' was not declared in this scope unlvsur at live dot com
2021-03-10  0:25 ` [Bug libstdc++/99499] build failure for android " unlvsur at live dot com
2021-03-10 12:10 ` [Bug target/99499] " redi at gcc dot gnu.org
2021-03-10 16:20 ` unlvsur at live dot com
2021-03-10 20:53 ` unlvsur at live dot com
2021-03-10 21:07 ` unlvsur at live dot com
2021-03-10 21:47 ` unlvsur at live dot com
2021-03-10 23:52 ` unlvsur at live dot com
2021-03-10 23:54 ` unlvsur at live dot com
2021-03-10 23:55 ` unlvsur at live dot com
2023-02-19 23:11 ` lbr-dev at yandex 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).