public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100057] New: There are no freestanding C++
@ 2021-04-13  0:22 unlvsur at live dot com
  2021-04-13  0:26 ` [Bug libstdc++/100057] " unlvsur at live dot com
                   ` (41 more replies)
  0 siblings, 42 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100057
           Summary: There are no freestanding C++
           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 50574
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50574&action=edit
Error message

It is such a joke.

Although building GCC with newlib is perfectly fine, without it, it just does
not work dude.

There are no freestanding C++ :)

I am perfectly correct.

No stdint.h

I tried all combinations:

../gcc/configure --disable-nls --disable-bootstrap --disable-hosted-libstdcxx
--disable-werror --without-headers --target=x86_64-elf
--prefix=/home/cqwrteur/elf_toolchain/x86_64-elf --disable-shared

../gcc/configure --disable-nls --disable-bootstrap --disable-hosted-libstdcxx
--disable-werror --without-headers --target=x86_64-elf
--prefix=/home/cqwrteur/elf_toolchain/x86_64-elf --disable-shared --with-newlib

None of them work. They all could not find stdint.h

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
@ 2021-04-13  0:26 ` unlvsur at live dot com
  2021-04-13  0:29 ` unlvsur at live dot com
                   ` (40 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  0:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
The funny stuff is that __STDC_HOSTED__ should not be set as true. I guess GCC
incorrectly mark __STDC_HOSTED__ as 1 for C++, even we live in freestanding
environment.

#ifndef _GCC_WRAP_STDINT_H
#if __STDC_HOSTED__
# if defined __cplusplus && __cplusplus >= 201103L
#  undef __STDC_LIMIT_MACROS
#  define __STDC_LIMIT_MACROS
#  undef __STDC_CONSTANT_MACROS
#  define __STDC_CONSTANT_MACROS
# endif
# include_next <stdint.h>
#else
# include "stdint-gcc.h"
#endif
#define _GCC_WRAP_STDINT_H
#endif

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
  2021-04-13  0:26 ` [Bug libstdc++/100057] " unlvsur at live dot com
@ 2021-04-13  0:29 ` unlvsur at live dot com
  2021-04-13  0:44 ` unlvsur at live dot com
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  0:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from cqwrteur <unlvsur at live dot com> ---
Then #if 0 the header.

checking for stdalign.h... no
checking for the value of EOF... configure: error: computing EOF failed
make[1]: *** [Makefile:13313: configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory '/home/cqwrteur/myhome/gcc2_elf_build'
make: *** [Makefile:965: all] Error 2

It cannot find EOF.

So yes, libstdc++ requires stdio, even in a freestanding environment lol. I
love this :)

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
  2021-04-13  0:26 ` [Bug libstdc++/100057] " unlvsur at live dot com
  2021-04-13  0:29 ` unlvsur at live dot com
@ 2021-04-13  0:44 ` unlvsur at live dot com
  2021-04-13  0:58 ` unlvsur at live dot com
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50575
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50575&action=edit
The log file shows it does check stdio.h

conftest.c:10:10: fatal error: stdio.h: No such file or directory
   10 | #include <stdio.h>

This is just incorrect tbh.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2021-04-13  0:44 ` unlvsur at live dot com
@ 2021-04-13  0:58 ` unlvsur at live dot com
  2021-04-13  1:34 ` phdofthehouse at gmail dot com
                   ` (37 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  0:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from cqwrteur <unlvsur at live dot com> ---
Try that without --with-newlib.


checking how to hardcode library paths into programs... immediate
checking for shl_load... configure: error: Link tests are not allowed after
GCC_NO_EXECUTABLES.
make[1]: *** [Makefile:13313: configure-target-libstdc++-v3] Error 1

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2021-04-13  0:58 ` unlvsur at live dot com
@ 2021-04-13  1:34 ` phdofthehouse at gmail dot com
  2021-04-13  1:36 ` phdofthehouse at gmail dot com
                   ` (36 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: phdofthehouse at gmail dot com @ 2021-04-13  1:34 UTC (permalink / raw)
  To: gcc-bugs

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

JeanHeyd Meneide <phdofthehouse at gmail dot com> changed:

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

--- Comment #5 from JeanHeyd Meneide <phdofthehouse at gmail dot com> ---
Hey, so, I'm not much of a contributor anymore, but like. Are you sure you got
everything passed to the compiler correctly?

I was under the impression in order to turn of __STDC_HOSTED__, you need to
pass

-ffreestanding

? That defines __STDC_HOSTED__ to 0, which should make those definition checks
choose the non-__STDC_HOSTED__ branches for the #if (as shown in this basic
test: https://godbolt.org/z/7acoPT13M)

https://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2021-04-13  1:34 ` phdofthehouse at gmail dot com
@ 2021-04-13  1:36 ` phdofthehouse at gmail dot com
  2021-04-13  1:53 ` unlvsur at live dot com
                   ` (35 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: phdofthehouse at gmail dot com @ 2021-04-13  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from JeanHeyd Meneide <phdofthehouse at gmail dot com> ---
Oh, woops, my bad. This is for configuring and building GCC. I'm not sure which
option turns on -ffreestanding for building the compiler itself! But it seems
like that's missing, if __STDC_HOSTED__ is not 0.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2021-04-13  1:36 ` phdofthehouse at gmail dot com
@ 2021-04-13  1:53 ` unlvsur at live dot com
  2021-04-13  1:57 ` unlvsur at live dot com
                   ` (34 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  1:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from cqwrteur <unlvsur at live dot com> ---
I think the libstdc++'s scripting issue I can fix it.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2021-04-13  1:53 ` unlvsur at live dot com
@ 2021-04-13  1:57 ` unlvsur at live dot com
  2021-04-13  2:20 ` unlvsur at live dot com
                   ` (33 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  1:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50576
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50576&action=edit
Disable checking these macros with freestanding settings

We predefine them if they do not exist in Freestanding.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2021-04-13  1:57 ` unlvsur at live dot com
@ 2021-04-13  2:20 ` unlvsur at live dot com
  2021-04-13  2:21 ` unlvsur at live dot com
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from cqwrteur <unlvsur at live dot com> ---
looking for a compliant stdint.h in stdint.h, checking for uintmax_t... no
looking for a compliant stdint.h in inttypes.h, checking for uintmax_t... no
looking for a compliant stdint.h in sys/inttypes.h, checking for uintmax_t...
no
looking for an incomplete stdint.h in stdint.h, checking for uint32_t... no
looking for an incomplete stdint.h in inttypes.h, checking for uint32_t... no
looking for an incomplete stdint.h in sys/inttypes.h, checking for uint32_t...
no
looking for u_intXX_t types in sys/types.h, checking for u_int32_t... no
looking for u_intXX_t types in inttypes.h, checking for u_int32_t... no
looking for u_intXX_t types in sys/inttypes.h, checking for u_int32_t... no
checking what to include in include/gstdint.h... stddef.h (using manual
detection)
checking size of void *... 0
checking size of long... 0
checking size of int... 0
checking size of short... 0
checking size of char... 0
checking for type equivalent to int8_t... configure: error: no 8-bit type,
please report a bug
make[1]: *** [Makefile:13313: configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory '/home/cqwrteur/myhome/gcc2_elf_build'
make: *** [Makefile:965: all] Error 2

The issue is that there is no such header called stdint.h. What we have is
stdint-gcc.h which is automatically generated by the compiler.

We have two options.
1. just redefine them in cstdint with freestanding.
2. use autotool to include stdint-gcc.h when stdint.h does not exist.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2021-04-13  2:20 ` unlvsur at live dot com
@ 2021-04-13  2:21 ` unlvsur at live dot com
  2021-04-13  2:49 ` unlvsur at live dot com
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  2:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from cqwrteur <unlvsur at live dot com> ---
I guess nobody ever tries to build freestanding before. It just does not work
tbh.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (9 preceding siblings ...)
  2021-04-13  2:21 ` unlvsur at live dot com
@ 2021-04-13  2:49 ` unlvsur at live dot com
  2021-04-13  3:58 ` unlvsur at live dot com
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  2:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from cqwrteur <unlvsur at live dot com> ---
  if test x$gcc_no_link = xyes; then
  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES."
"$LINENO" 5


These tests are very wrong tbh. freestanding environment of course, does not
have those stuffs.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (10 preceding siblings ...)
  2021-04-13  2:49 ` unlvsur at live dot com
@ 2021-04-13  3:58 ` unlvsur at live dot com
  2021-04-13  4:36 ` unlvsur at live dot com
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  3:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from cqwrteur <unlvsur at live dot com> ---
malloc, free, memset does not exist either.

Need to replace them with __builtin_malloc, __builtin_free, __builtin_memset if
that is available.

Then it is libquadmath's issue. no errno.h


In file included from ../../../gcc/libquadmath/math/llroundq.c:21:
../../../gcc/libquadmath/quadmath-imp.h:24:10: fatal error: errno.h: No such
file or directory
   24 | #include <errno.h>

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (11 preceding siblings ...)
  2021-04-13  3:58 ` unlvsur at live dot com
@ 2021-04-13  4:36 ` unlvsur at live dot com
  2021-04-13  5:12 ` unlvsur at live dot com
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  4:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from cqwrteur <unlvsur at live dot com> ---
../gcc/configure --disable-nls --disable-bootstrap --disable-hosted-libstdcxx
--disable-werror --with-newlib --target=x86_64-elf
--prefix=/home/cqwrteur/elf_toolchain/x86_64-elf --without-headers
--with-newlib --disable-libstdcxx-verbose --enable-languages=c,c++
--disable-libquadmath --disable-libssp

Finally got the shit working. so frustrating.

Can we just disable those stuff by default if we put --disable-hosted-libstdcxx
here?

it will disable all languages besides c, c++. libgcc will be built with
-ffreestanding. quadmath, ssp whatever would get disabled. and
--without-headers and --with-newlib should work here?

And cstdint header file does not work either since it fails to detect stdint.h
for configure at build time.

Although manually remove the __HAVE_STDINT_H__ macro and include stdint.h would
work.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (12 preceding siblings ...)
  2021-04-13  4:36 ` unlvsur at live dot com
@ 2021-04-13  5:12 ` unlvsur at live dot com
  2021-04-13  7:50 ` unlvsur at live dot com
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  5:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from cqwrteur <unlvsur at live dot com> ---
there is another stuff mentioned in osdev. we need to disable red zone. we need
redzone multilib

https://wiki.osdev.org/Libgcc_without_red_zone

I suggest to add this into gcc itself

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (13 preceding siblings ...)
  2021-04-13  5:12 ` unlvsur at live dot com
@ 2021-04-13  7:50 ` unlvsur at live dot com
  2021-04-13  8:12 ` unlvsur at live dot com
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  7:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50577
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50577&action=edit
my own stuff

i just removed all emergency heap, bad_alloc nonsense. it looks like memset is
not available.

my own issue here

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (14 preceding siblings ...)
  2021-04-13  7:50 ` unlvsur at live dot com
@ 2021-04-13  8:12 ` unlvsur at live dot com
  2021-04-13  8:14 ` unlvsur at live dot com
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from cqwrteur <unlvsur at live dot com> ---
d:\cross_toolchains\x86_64-elf\x86_64-elf\include\c++\11.0.1\bit:37:10: fatal
error: ext/numeric_traits.h: No such file or directory
   37 | #include <ext/numeric_traits.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

#include<bit>

int main();

This is wrong

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (15 preceding siblings ...)
  2021-04-13  8:12 ` unlvsur at live dot com
@ 2021-04-13  8:14 ` unlvsur at live dot com
  2021-04-13  8:46 ` rguenth at gcc dot gnu.org
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #16)
> d:\cross_toolchains\x86_64-elf\x86_64-elf\include\c++\11.0.1\bit:37:10:
> fatal error: ext/numeric_traits.h: No such file or directory
>    37 | #include <ext/numeric_traits.h>
>       |          ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> 
> #include<bit>
> 
> int main();
> 
> This is wrong

we have nothing basically.


of course. No std::to_address. std::move. std::forward etc

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (16 preceding siblings ...)
  2021-04-13  8:14 ` unlvsur at live dot com
@ 2021-04-13  8:46 ` rguenth at gcc dot gnu.org
  2021-04-13  8:48 ` unlvsur at live dot com
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-13  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> ---
So first of all --disable-hosted-libstdcxx doesn't work up to its standard? 
But maybe it's just specifics for x86_64-elf and other targets work fine here.

Did you try forcing -ffreestanding for target library build with
CFLAGS_FOR_TARGET="-g -O2 -ffreestanding" ../configure ....?

Because libstdc++ may not be the only target library with the stdint.h issue.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (17 preceding siblings ...)
  2021-04-13  8:46 ` rguenth at gcc dot gnu.org
@ 2021-04-13  8:48 ` unlvsur at live dot com
  2021-04-13  8:51 ` unlvsur at live dot com
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from cqwrteur <unlvsur at live dot com> ---
(In reply to Richard Biener from comment #18)
> So first of all --disable-hosted-libstdcxx doesn't work up to its standard? 
> But maybe it's just specifics for x86_64-elf and other targets work fine
> here.
> 
> Did you try forcing -ffreestanding for target library build with
> CFLAGS_FOR_TARGET="-g -O2 -ffreestanding" ../configure ....?
> 
> Because libstdc++ may not be the only target library with the stdint.h issue.

dude never works.

That is why people are not using C++ for writing operating system.

Also why people like Linux hate C++ so much.

Anyone who attempted to write OS in C++ feel the same way. That is why C is
still the only language for writing OS kernel.

You give reasons for Trolls like Richard Stallman and Linus to attack this
language

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (18 preceding siblings ...)
  2021-04-13  8:48 ` unlvsur at live dot com
@ 2021-04-13  8:51 ` unlvsur at live dot com
  2021-04-13  8:57 ` rguenth at gcc dot gnu.org
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #19)
> (In reply to Richard Biener from comment #18)
> > So first of all --disable-hosted-libstdcxx doesn't work up to its standard? 
> > But maybe it's just specifics for x86_64-elf and other targets work fine
> > here.
> > 
> > Did you try forcing -ffreestanding for target library build with
> > CFLAGS_FOR_TARGET="-g -O2 -ffreestanding" ../configure ....?
> > 
> > Because libstdc++ may not be the only target library with the stdint.h issue.
> 
> dude never works.
> 
> That is why people are not using C++ for writing operating system.
> 
> Also why people like Linux hate C++ so much.
> 
> Anyone who attempted to write OS in C++ feel the same way. That is why C is
> still the only language for writing OS kernel.
> 
> You give reasons for Trolls like Richard Stallman and Linus to attack this
> language

https://forum.osdev.org/viewtopic.php?f=8&t=23947

The same freaking issue was been mentioned 10 years ago. No one actually tries
to fix this until I come.

There are a lot of historical issues with GCC implementations and I tried to
submit patches to fix them.

like BUFSIZ macro on windows, which is wrong for 30 years (just fixed in GCC11
because I reported the bug).
addcarry. (still does not work)

The freestanding C++ is an absolute joke. Not just because of the reason of
exception handling. The GCC team did a horrible job in the past.

Of course LLVM is even worse, but I am not going to trash talk about that here.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (19 preceding siblings ...)
  2021-04-13  8:51 ` unlvsur at live dot com
@ 2021-04-13  8:57 ` rguenth at gcc dot gnu.org
  2021-04-13  9:06 ` unlvsur at live dot com
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-13  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> ---
Dude, this is a bugreporting system, not a trolling place.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (20 preceding siblings ...)
  2021-04-13  8:57 ` rguenth at gcc dot gnu.org
@ 2021-04-13  9:06 ` unlvsur at live dot com
  2021-04-13  9:24 ` redi at gcc dot gnu.org
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

cqwrteur <unlvsur at live dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #22 from cqwrteur <unlvsur at live dot com> ---
Not trolling. Just to build this and prove a point here for this because it was
claimed --disable-hosted-libstdcxx working and using newlib is not standard
compliant etc.

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

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (21 preceding siblings ...)
  2021-04-13  9:06 ` unlvsur at live dot com
@ 2021-04-13  9:24 ` redi at gcc dot gnu.org
  2021-04-13  9:27 ` redi at gcc dot gnu.org
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #0)
> There are no freestanding C++ :)

You are confused. The fact that libstdc++ has a freestanding mode which still
has certain requirements doesn't mean "there are no freestanding C++".

GCC is just one implementation, you can't make such a generalization about "no
freestanding C++" from one implementation.

> I am perfectly correct.

No, you are confused.





(In reply to cqwrteur from comment #10)
> I guess nobody ever tries to build freestanding before. It just does not
> work tbh.

Have you tried building the compiler first, without building libstdc++ at all,
then using that compiler to build the freestanding libstdc++?

Lots of people build with newlib, every day. Instead of assuming nobody ever
does it and it's broken until you come along, maybe assume you're doing it
wrong.



(In reply to cqwrteur from comment #19)
>That is why people are not using C++ for writing operating system.

There's a chicken and egg situation. Nobody is doing it, so the configuration
to do it is not widely used and not as smooth as the default hosted
configuration.

If you want it to work, try being constructive instead of an irratating prick.


(In reply to cqwrteur from comment #12)
> Then it is libquadmath's issue. no errno.h

So --disable-libquadmath



(In reply to cqwrteur from comment #20)
> The freestanding C++ is an absolute joke. Not just because of the reason of
> exception handling. The GCC team did a horrible job in the past.


I've told you before that your attitude makes people ignore you and dismiss you
as an irritating person that nobody wants to work with or help.

If you think GCC is so bad, create your own compiler and stop bothering us and
insulting people.

Your ability to communicate politely and reasonably is an absolute joke and
every time I see you've reported a new "bug" I die a little bit inside.

Instead of reporting a bug and then spamming it with new comments every  time
you try something different, spend some time trying things FIRST and then
report a focused, detailed bug about specific issues.

Nobody wants to read your stream of consciousness rants.

I'm closing this as invalid.

Report a separate bug for concrete issues like "please add a new option for a
freestanding build that implies --disable-hosted-libstdcxx 
--disable-libquadmath and all other relevant options" (which will probably be
closed as INVALID or WONTFIX).

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (22 preceding siblings ...)
  2021-04-13  9:24 ` redi at gcc dot gnu.org
@ 2021-04-13  9:27 ` redi at gcc dot gnu.org
  2021-04-13  9:41 ` redi at gcc dot gnu.org
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13  9:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #16)
> d:\cross_toolchains\x86_64-elf\x86_64-elf\include\c++\11.0.1\bit:37:10:
> fatal error: ext/numeric_traits.h: No such file or directory
>    37 | #include <ext/numeric_traits.h>
>       |          ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> 
> #include<bit>
> 
> int main();
> 
> This is wrong

This is a regression, please report a separate bug about this part.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (23 preceding siblings ...)
  2021-04-13  9:27 ` redi at gcc dot gnu.org
@ 2021-04-13  9:41 ` redi at gcc dot gnu.org
  2021-04-13 10:01 ` unlvsur at live dot com
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #24)
> This is a regression, please report a separate bug about this part.

Reported as Bug 100060, fix already written (because when you report a clear,
focused bug report about specific issues, it gets dealt with).

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (24 preceding siblings ...)
  2021-04-13  9:41 ` redi at gcc dot gnu.org
@ 2021-04-13 10:01 ` unlvsur at live dot com
  2021-04-13 10:32 ` unlvsur at live dot com
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #26 from cqwrteur <unlvsur at live dot com> ---
yes. i tried that first and Then report a bug here. whats wrong with it? wasn't
bugzilla designed for the stuff here? you asked me not to put you in the CC
list and i did. Whats the complain here?

1. i do build things with newlib and i know It works. However It was actually
you who said newlib is not standard compliant etc. That is why i would like to
have a try to see whether It works or not because i tried That before and It
didn't. i wasn't claiming something wrong.
2. i am not the first person who tried that. i believe a lot of people tried
that before and they failed. That is why newlib is very popular. However It
still does not change the fact using C++ to write OS kernel stuffs are
fruastrating.
3. newlib is a panacea to the issue. because There are still a lot of places
WHERE you cannot use newlib. like writing UEFI barebones or windows kernel
which require the Binary to be PE format Instead of elf format.
4. When people build stuffs with newlib they usually do not disable libstdcxx
verbose which leads to at least 60kb of Binary bloat of binutils (c++filt)+the
dependency of stdio which make exception handling much hard to use
5. Yes. I love to try All options because i want to solve problems. i want to
ensure My library works without operating system and on various platforms, not
just Linux or windows. i want to kill stdio. That is why i keep building All
sorts of cross toolchains or Even hosted cross toolchains in the first place.
People who do not use cross compilers are actually problem creators since they
do not know What is Going to happen with their own mess
6. Sure GCC`s implementation is not the only option. However We only have 3
options currently. libstdc++. libc++. msvc STL. msvc STL is windows only. every
other option is dead out. including famous STLPort.
7. The fruastation of using C++ is exactly why OSdevs like linus hate the
language because We do create issues for ourselves.

Get Outlook for Android<https://aka.ms/AAb9ysg>

________________________________
From: redi at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
Sent: Tuesday, April 13, 2021 5:24:53 AM
To: unlvsur@live.com <unlvsur@live.com>
Subject: [Bug libstdc++/100057] There are no freestanding C++

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D100057&amp;data=04%7C01%7C%7C6b91e3ef37c449fdc96408d8fe5dff7b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637539026953147227%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=LdwLt6enWUifwfT4Y05iDygnveuN8Y35bxAS0iAwO%2B0%3D&amp;reserved=0

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #0)
> There are no freestanding C++ :)

You are confused. The fact that libstdc++ has a freestanding mode which still
has certain requirements doesn't mean "there are no freestanding C++".

GCC is just one implementation, you can't make such a generalization about "no
freestanding C++" from one implementation.

> I am perfectly correct.

No, you are confused.





(In reply to cqwrteur from comment #10)
> I guess nobody ever tries to build freestanding before. It just does not
> work tbh.

Have you tried building the compiler first, without building libstdc++ at all,
then using that compiler to build the freestanding libstdc++?

Lots of people build with newlib, every day. Instead of assuming nobody ever
does it and it's broken until you come along, maybe assume you're doing it
wrong.



(In reply to cqwrteur from comment #19)
>That is why people are not using C++ for writing operating system.

There's a chicken and egg situation. Nobody is doing it, so the configuration
to do it is not widely used and not as smooth as the default hosted
configuration.

If you want it to work, try being constructive instead of an irratating prick.


(In reply to cqwrteur from comment #12)
> Then it is libquadmath's issue. no errno.h

So --disable-libquadmath



(In reply to cqwrteur from comment #20)
> The freestanding C++ is an absolute joke. Not just because of the reason of
> exception handling. The GCC team did a horrible job in the past.


I've told you before that your attitude makes people ignore you and dismiss you
as an irritating person that nobody wants to work with or help.

If you think GCC is so bad, create your own compiler and stop bothering us and
insulting people.

Your ability to communicate politely and reasonably is an absolute joke and
every time I see you've reported a new "bug" I die a little bit inside.

Instead of reporting a bug and then spamming it with new comments every  time
you try something different, spend some time trying things FIRST and then
report a focused, detailed bug about specific issues.

Nobody wants to read your stream of consciousness rants.

I'm closing this as invalid.

Report a separate bug for concrete issues like "please add a new option for a
freestanding build that implies --disable-hosted-libstdcxx
--disable-libquadmath and all other relevant options" (which will probably be
closed as INVALID or WONTFIX).

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

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (25 preceding siblings ...)
  2021-04-13 10:01 ` unlvsur at live dot com
@ 2021-04-13 10:32 ` unlvsur at live dot com
  2021-04-13 10:50 ` redi at gcc dot gnu.org
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-04-13 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

cqwrteur <unlvsur at live dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #27 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #25)
> (In reply to Jonathan Wakely from comment #24)
> > This is a regression, please report a separate bug about this part.
> 
> Reported as Bug 100060, fix already written (because when you report a
> clear, focused bug report about specific issues, it gets dealt with).

I would like to say I would rather fixing bugs by myself instead of reporting
because I find issues every day.

How to commit code to gcc? what's the permission requirement?

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (26 preceding siblings ...)
  2021-04-13 10:32 ` unlvsur at live dot com
@ 2021-04-13 10:50 ` redi at gcc dot gnu.org
  2021-08-21  8:50 ` unlvsur at live dot com
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13 10:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #28 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #26)
> yes. i tried that first and Then report a bug here. whats wrong with it?
> wasn't bugzilla designed for the stuff here? you asked me not to put you in
> the CC list and i did. Whats the complain here?

That "There is no freestanding in C++" and "I'm perfectly correct" are not bug
reports, and "It is such a joke." doesn't persuade anybody to try and help you.


> 
> 1. i do build things with newlib and i know It works. However It was
> actually you who said newlib is not standard compliant etc.

In what context?

I might have said some part of newlib is not conforming, but that's true for
most software.



> 2. i am not the first person who tried that. i believe a lot of people tried
> that before and they failed. That is why newlib is very popular. However It
> still does not change the fact using C++ to write OS kernel stuffs are
> fruastrating.

Sure. But "it's frustrating" is too vague to do anything about.

If you want to make it less frustrating, report specific, detailed bug reports.
"It is such a joke" is not helpful and gets your bugs closed.


> 4. When people build stuffs with newlib they usually do not disable
> libstdcxx verbose which leads to at least 60kb of Binary bloat of binutils
> (c++filt)+the dependency of stdio which make exception handling much hard to
> use

It's not a gcc bug if people don't use the existing options that would help
them.



(In reply to cqwrteur from comment #27)
> How to commit code to gcc? what's the permission requirement?


https://gcc.gnu.org/contribute.html

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (27 preceding siblings ...)
  2021-04-13 10:50 ` redi at gcc dot gnu.org
@ 2021-08-21  8:50 ` unlvsur at live dot com
  2021-08-23 10:08 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-08-21  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

cqwrteur <unlvsur at live dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #29 from cqwrteur <unlvsur at live dot com> ---
I really want a fix to the script. Thank you !!!

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (28 preceding siblings ...)
  2021-08-21  8:50 ` unlvsur at live dot com
@ 2021-08-23 10:08 ` redi at gcc dot gnu.org
  2021-08-23 10:16 ` unlvsur at live dot com
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-23 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-23
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #30 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #29)
> I really want a fix to the script. Thank you !!!

This is too vague to do anything about.

Be precise.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (29 preceding siblings ...)
  2021-08-23 10:08 ` redi at gcc dot gnu.org
@ 2021-08-23 10:16 ` unlvsur at live dot com
  2021-08-23 10:19 ` unlvsur at live dot com
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-08-23 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #31 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #30)
> (In reply to cqwrteur from comment #29)
> > I really want a fix to the script. Thank you !!!
> 
> This is too vague to do anything about.
> 
> Be precise.

compile gcc things like with --target=x86_64-elf. then use
--disable-hosted-libstdcxx build those headers without any libc, not even
newlib since newlib might implement some things which are not appropriate.

Better addon x86_64-elf -mno-red-zone multilibs too.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (30 preceding siblings ...)
  2021-08-23 10:16 ` unlvsur at live dot com
@ 2021-08-23 10:19 ` unlvsur at live dot com
  2021-12-29 22:17 ` pixel@nobis-crew.org
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-08-23 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #32 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #31)
> (In reply to Jonathan Wakely from comment #30)
> > (In reply to cqwrteur from comment #29)
> > > I really want a fix to the script. Thank you !!!
> > 
> > This is too vague to do anything about.
> > 
> > Be precise.
> 
> compile gcc things like with --target=x86_64-elf. then use
> --disable-hosted-libstdcxx build those headers without any libc, not even
> newlib since newlib might implement some things which are not appropriate.
> 
> Better addon x86_64-elf -mno-red-zone multilibs too.

This not only allows C++ to run in baremetal, but also allows libcs themselves
to be implemented with C++.

Today the cross compiler build process is like this:

binutils-gdb -> gcc without headers but only build libgcc -> libgcc -> libc ->
rebuild gcc -> libgcc -> libstdc++ -> other libs.

In the future, it should be
binutils-gdb -> gcc without headers but only build libgcc + disable-hosted
libstdc++ -> libgcc -> libc -> rebuild gcc -> libgcc -> libstdc++ -> other
libs.

This will solve the boostrapping problems for libcs like mlibc which is written
in C++20.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (31 preceding siblings ...)
  2021-08-23 10:19 ` unlvsur at live dot com
@ 2021-12-29 22:17 ` pixel@nobis-crew.org
  2021-12-29 23:04 ` pixel@nobis-crew.org
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pixel@nobis-crew.org @ 2021-12-29 22:17 UTC (permalink / raw)
  To: gcc-bugs

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

Nicolas Noble <pixel@nobis-crew.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pixel@nobis-crew.org

--- Comment #33 from Nicolas Noble <pixel@nobis-crew.org> ---
I'll echo a bit the sentiment in this thread, with a nuance: there's definitely
documentation needed around how to make a freestanding libstdc++, or how to use
the --disable-hosted-libstdcxx flag properly.

I've been trying to make a bare metal mips compiler out of gcc 11.2.0 using the
following flags:

../configure --target=mipsel-none-elf --without-isl --disable-nls
--disable-threads --disable-shared --disable-libssp --disable-libstdcxx-pch
--disable-libgomp --disable-werror --without-headers
--with-as=/usr/local/bin/mipsel-none-elf-as
--with-ld=/usr/local/bin/mipsel-none-elf-ld --enable-languages=c,c++
--disable-hosted-libstdcxx

This works with the following make statements:

make all-gcc
make install-strip-gcc
make all-target-libgcc
make install-strip-target-libgcc

This makes and installs a proper compiler for C, and some basic C++, but
without bare metal C++ headers such as type traits.

When trying to do run:

make all-target-libstdc++-v3

Then we end up with the error

checking for shl_load... configure: error: Link tests are not allowed after
GCC_NO_EXECUTABLES.

At the moment, I don't understand if it's possible to spawn a cross compiler
with a freestanding libc and libstdc++.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (32 preceding siblings ...)
  2021-12-29 22:17 ` pixel@nobis-crew.org
@ 2021-12-29 23:04 ` pixel@nobis-crew.org
  2021-12-29 23:57 ` unlvsur at live dot com
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pixel@nobis-crew.org @ 2021-12-29 23:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #34 from Nicolas Noble <pixel@nobis-crew.org> ---
After some digging, I found out this in the acinclude.m4 file of the
libstdc++-v3 folder:

AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
  AC_ARG_ENABLE([hosted-libstdcxx],
    AC_HELP_STRING([--disable-hosted-libstdcxx],
                   [only build freestanding C++ runtime support]),,
    [case "$host" in
        arm*-*-symbianelf*)
            enable_hosted_libstdcxx=no
            ;;
        *)
            enable_hosted_libstdcxx=yes
            ;;
     esac])


Basically, it looks like the "disable hosted libstdc++" flag is only honored
when building on a host triple that's arm + symbian. The documentation +
reporting for this is extremely misguiding. The documentation should at least
specify this only works in a very narrow context, and the configure script
should probably error out if the user asks for a feature it can't actually
provide.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (33 preceding siblings ...)
  2021-12-29 23:04 ` pixel@nobis-crew.org
@ 2021-12-29 23:57 ` unlvsur at live dot com
  2021-12-29 23:57 ` unlvsur at live dot com
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-12-29 23:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #35 from cqwrteur <unlvsur at live dot com> ---
(In reply to Nicolas Noble from comment #34)
> After some digging, I found out this in the acinclude.m4 file of the
> libstdc++-v3 folder:
> 
> AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
>   AC_ARG_ENABLE([hosted-libstdcxx],
>     AC_HELP_STRING([--disable-hosted-libstdcxx],
>                    [only build freestanding C++ runtime support]),,
>     [case "$host" in
>         arm*-*-symbianelf*)
>             enable_hosted_libstdcxx=no
>             ;;
>         *)
>             enable_hosted_libstdcxx=yes
>             ;;
>      esac])
> 
> 
> Basically, it looks like the "disable hosted libstdc++" flag is only honored
> when building on a host triple that's arm + symbian. The documentation +
> reporting for this is extremely misguiding. The documentation should at
> least specify this only works in a very narrow context, and the configure
> script should probably error out if the user asks for a feature it can't
> actually provide.

wg21 just did a crappy job on this shit and GCC does not give a shit on
freestanding either.

You do not have std::addressof, std::move, std::array but the fucking ISO
forces you to use EH and RTTI.

C++ considered harmful for embedded and kernel.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (34 preceding siblings ...)
  2021-12-29 23:57 ` unlvsur at live dot com
@ 2021-12-29 23:57 ` unlvsur at live dot com
  2021-12-30 10:19 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-12-29 23:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #36 from cqwrteur <unlvsur at live dot com> ---
(In reply to Nicolas Noble from comment #34)
> After some digging, I found out this in the acinclude.m4 file of the
> libstdc++-v3 folder:
> 
> AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
>   AC_ARG_ENABLE([hosted-libstdcxx],
>     AC_HELP_STRING([--disable-hosted-libstdcxx],
>                    [only build freestanding C++ runtime support]),,
>     [case "$host" in
>         arm*-*-symbianelf*)
>             enable_hosted_libstdcxx=no
>             ;;
>         *)
>             enable_hosted_libstdcxx=yes
>             ;;
>      esac])
> 
> 
> Basically, it looks like the "disable hosted libstdc++" flag is only honored
> when building on a host triple that's arm + symbian. The documentation +
> reporting for this is extremely misguiding. The documentation should at
> least specify this only works in a very narrow context, and the configure
> script should probably error out if the user asks for a feature it can't
> actually provide.

DEATH TO WG21

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (35 preceding siblings ...)
  2021-12-29 23:57 ` unlvsur at live dot com
@ 2021-12-30 10:19 ` redi at gcc dot gnu.org
  2021-12-30 10:25 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-30 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #37 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Oh shut up, you tedious clown. Cut the attacks and abuse or I'll block every
account you try to create here (as happens in every other venue where you try
to share your opinions by attacking people).

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (36 preceding siblings ...)
  2021-12-30 10:19 ` redi at gcc dot gnu.org
@ 2021-12-30 10:25 ` redi at gcc dot gnu.org
  2021-12-30 10:56 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-30 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #38 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nicolas Noble from comment #33)
> At the moment, I don't understand if it's possible to spawn a cross compiler
> with a freestanding libc and libstdc++.

A GCC bootstrap needs a hosted libstdc++, because it's built with C++. If you
want to disable hosted libstdc++ you need to also build with
--disable-bootstrap.


(In reply to Nicolas Noble from comment #34)
> After some digging, I found out this in the acinclude.m4 file of the
> libstdc++-v3 folder:
> 
> AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
>   AC_ARG_ENABLE([hosted-libstdcxx],
>     AC_HELP_STRING([--disable-hosted-libstdcxx],
>                    [only build freestanding C++ runtime support]),,
>     [case "$host" in
>         arm*-*-symbianelf*)
>             enable_hosted_libstdcxx=no
>             ;;
>         *)
>             enable_hosted_libstdcxx=yes
>             ;;
>      esac])
> 
> 
> Basically, it looks like the "disable hosted libstdc++" flag is only honored
> when building on a host triple that's arm + symbian.

No, that code snippet is the action-if-not-given clause, which means it runs if
you do not use --disable-hosted-libstdcxx or --enable-hosted-libstdcxx, i.e.
the default for symbian is freestanding, the default for other systems is
hosted. But you can override the default.

>  The documentation +
> reporting for this is extremely misguiding. The documentation should at
> least specify this only works in a very narrow context, and the configure
> script should probably error out if the user asks for a feature it can't
> actually provide.

No, the docs don't say that because it's not true, you've just completely
misunderstood the configure script.


I'm closing this bug, because "cqwrteur" is a moron who can't report useful
bugs.

If you need help building freestanding please use the gcc-help mailing list, or
the libstdc++ list, or open a new bug. Stay away from everything cqwrteur
reports, because it's toxic garbage and I'm not interested in dealing with his
nonsense.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (37 preceding siblings ...)
  2021-12-30 10:25 ` redi at gcc dot gnu.org
@ 2021-12-30 10:56 ` redi at gcc dot gnu.org
  2021-12-30 11:31 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-30 10:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #39 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #38)
> (In reply to Nicolas Noble from comment #33)
> > At the moment, I don't understand if it's possible to spawn a cross compiler
> > with a freestanding libc and libstdc++.
> 
> A GCC bootstrap needs a hosted libstdc++, because it's built with C++. If
> you want to disable hosted libstdc++ you need to also build with
> --disable-bootstrap.

Actually I think the problem in this case comes from the libtool setup which
doesn't respect GCC_NO_EXECUTABLES macro used for cross compilers. You might be
able to get past that error by adding --disable-dlopen to your configure
command.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (38 preceding siblings ...)
  2021-12-30 10:56 ` redi at gcc dot gnu.org
@ 2021-12-30 11:31 ` redi at gcc dot gnu.org
  2021-12-30 18:37 ` unlvsur at live dot com
  2021-12-30 18:39 ` unlvsur at live dot com
  41 siblings, 0 replies; 43+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-30 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #40 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I opened Bug 103866 for this build error.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (39 preceding siblings ...)
  2021-12-30 11:31 ` redi at gcc dot gnu.org
@ 2021-12-30 18:37 ` unlvsur at live dot com
  2021-12-30 18:39 ` unlvsur at live dot com
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-12-30 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #41 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #38)
> (In reply to Nicolas Noble from comment #33)
> > At the moment, I don't understand if it's possible to spawn a cross compiler
> > with a freestanding libc and libstdc++.
> 
> A GCC bootstrap needs a hosted libstdc++, because it's built with C++. If
> you want to disable hosted libstdc++ you need to also build with
> --disable-bootstrap.
> 
> 
> (In reply to Nicolas Noble from comment #34)
> > After some digging, I found out this in the acinclude.m4 file of the
> > libstdc++-v3 folder:
> > 
> > AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
> >   AC_ARG_ENABLE([hosted-libstdcxx],
> >     AC_HELP_STRING([--disable-hosted-libstdcxx],
> >                    [only build freestanding C++ runtime support]),,
> >     [case "$host" in
> >         arm*-*-symbianelf*)
> >             enable_hosted_libstdcxx=no
> >             ;;
> >         *)
> >             enable_hosted_libstdcxx=yes
> >             ;;
> >      esac])
> > 
> > 
> > Basically, it looks like the "disable hosted libstdc++" flag is only honored
> > when building on a host triple that's arm + symbian.
> 
> No, that code snippet is the action-if-not-given clause, which means it runs
> if you do not use --disable-hosted-libstdcxx or --enable-hosted-libstdcxx,
> i.e. the default for symbian is freestanding, the default for other systems
> is hosted. But you can override the default.
> 
> >  The documentation +
> > reporting for this is extremely misguiding. The documentation should at
> > least specify this only works in a very narrow context, and the configure
> > script should probably error out if the user asks for a feature it can't
> > actually provide.
> 
> No, the docs don't say that because it's not true, you've just completely
> misunderstood the configure script.
> 
> 
> I'm closing this bug, because "cqwrteur" is a moron who can't report useful
> bugs.
> 
> If you need help building freestanding please use the gcc-help mailing list,
> or the libstdc++ list, or open a new bug. Stay away from everything cqwrteur
> reports, because it's toxic garbage and I'm not interested in dealing with
> his nonsense.

lol.

who is the true moron? std::addressof, std::array and std::move etc are not
freestanding but bitching C programmers use C for writing kernel and embedded.

When will be herbceptions? C++ EH is a total historical mistake.

C++ is an absolute joke for embedded and kernel developments.


From: Linus Torvalds
Subject: Re: Compiling C++ kernel module + Makefile
Date: Mon, 19 Jan 2004 22:46:23 -0800 (PST)


On Tue, 20 Jan 2004, Robin Rosenberg wrote:
> 
> This is the "We've always used COBOL^H^H^H^H" argument. 

In fact, in Linux we did try C++ once already, back in 1992.

It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

The fact is, C++ compilers are not trustworthy. They were even worse in 
1992, but some fundamental facts haven't changed:

 - the whole C++ exception handling thing is fundamentally broken. It's 
   _especially_ broken for kernels.
 - any compiler or language that likes to hide things like memory
   allocations behind your back just isn't a good choice for a kernel.
 - you can write object-oriented code (useful for filesystems etc) in C, 
   _without_ the crap that is C++.

In general, I'd say that anybody who designs his kernel modules for C++ is 
either 
 (a) looking for problems
 (b) a C++ bigot that can't see what he is writing is really just C anyway
 (c) was given an assignment in CS class to do so.

Feel free to make up (d).

        Linus

Linus is totally correct.

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

* [Bug libstdc++/100057] There are no freestanding C++
  2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
                   ` (40 preceding siblings ...)
  2021-12-30 18:37 ` unlvsur at live dot com
@ 2021-12-30 18:39 ` unlvsur at live dot com
  41 siblings, 0 replies; 43+ messages in thread
From: unlvsur at live dot com @ 2021-12-30 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #42 from cqwrteur <unlvsur at live dot com> ---
And std::format shit is an absolute log4j vuln but wg21 wastes time on this
instead of fixing iostream.

LOL.

We see wg21 as a joke.

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

end of thread, other threads:[~2021-12-30 18:39 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13  0:22 [Bug libstdc++/100057] New: There are no freestanding C++ unlvsur at live dot com
2021-04-13  0:26 ` [Bug libstdc++/100057] " unlvsur at live dot com
2021-04-13  0:29 ` unlvsur at live dot com
2021-04-13  0:44 ` unlvsur at live dot com
2021-04-13  0:58 ` unlvsur at live dot com
2021-04-13  1:34 ` phdofthehouse at gmail dot com
2021-04-13  1:36 ` phdofthehouse at gmail dot com
2021-04-13  1:53 ` unlvsur at live dot com
2021-04-13  1:57 ` unlvsur at live dot com
2021-04-13  2:20 ` unlvsur at live dot com
2021-04-13  2:21 ` unlvsur at live dot com
2021-04-13  2:49 ` unlvsur at live dot com
2021-04-13  3:58 ` unlvsur at live dot com
2021-04-13  4:36 ` unlvsur at live dot com
2021-04-13  5:12 ` unlvsur at live dot com
2021-04-13  7:50 ` unlvsur at live dot com
2021-04-13  8:12 ` unlvsur at live dot com
2021-04-13  8:14 ` unlvsur at live dot com
2021-04-13  8:46 ` rguenth at gcc dot gnu.org
2021-04-13  8:48 ` unlvsur at live dot com
2021-04-13  8:51 ` unlvsur at live dot com
2021-04-13  8:57 ` rguenth at gcc dot gnu.org
2021-04-13  9:06 ` unlvsur at live dot com
2021-04-13  9:24 ` redi at gcc dot gnu.org
2021-04-13  9:27 ` redi at gcc dot gnu.org
2021-04-13  9:41 ` redi at gcc dot gnu.org
2021-04-13 10:01 ` unlvsur at live dot com
2021-04-13 10:32 ` unlvsur at live dot com
2021-04-13 10:50 ` redi at gcc dot gnu.org
2021-08-21  8:50 ` unlvsur at live dot com
2021-08-23 10:08 ` redi at gcc dot gnu.org
2021-08-23 10:16 ` unlvsur at live dot com
2021-08-23 10:19 ` unlvsur at live dot com
2021-12-29 22:17 ` pixel@nobis-crew.org
2021-12-29 23:04 ` pixel@nobis-crew.org
2021-12-29 23:57 ` unlvsur at live dot com
2021-12-29 23:57 ` unlvsur at live dot com
2021-12-30 10:19 ` redi at gcc dot gnu.org
2021-12-30 10:25 ` redi at gcc dot gnu.org
2021-12-30 10:56 ` redi at gcc dot gnu.org
2021-12-30 11:31 ` redi at gcc dot gnu.org
2021-12-30 18:37 ` unlvsur at live dot com
2021-12-30 18:39 ` unlvsur at live 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).