Hello, and a pleasant good day to everyone. With no further ado:

The process of building a simply, plain vanilla cross compiler for
arch-fmt-no_os is really probably overdone. To build, for example, a
GCC cross compiler for an i586-elf target, the build process requires
you to have a libc for the target, and then from there, the build
process uses the features in your vanilla target's libc to decide how
to configure libstdc++v3.

However, anyone building a vanilla cross compiler either doesn't yet
*have* a standard lib for his kernel project as yet, or isn't yet
interested in building an os-specific toolchain for arch-fmt-his_os as
yet. Therefore the assumption that there would be a standard library,
or libc, or even that the person even *wants* a libstdc++ with his
vanilla build is incorrect.

Normally, a hobbyist kernel-developer, or a person working on a kernel
of any sort for that matter, would begin by building a vanilla target,
which uses no libs whatsoever. Therefore the triplet lacks the 'os'
part. That is: "I'm building a cross compiler which does not target
any particular OS.".

The vanilla target is used to compile the kernel itself. A kernel
project usually provides its *own* stdlibs, in subdirectories of its
tree, Therefore there is no need for GCC to require me to build
libstdc++ for a vanilla build.

Later on, the kernel developer would usually, after implementing
syscalls, and now having actually written the system libraries for his
kernel, compile a target for arch-fmt-my_os. In *this* build, s/he
will have a libc which is either native, or a layer over his/her own
native system API. Using this libc and the relevant headers, etc, s/he
would now cross compile the arch-fmt-my_os target. NOW the developer
is interested in having libstdc++ built along with the cross compiler
since there is a need for the userspace libstdc++.

What I'm trying to say therefore is that you folks are doing a great
job, and I love your compiler, but could you please keep things simple
where they should be? There's no *need* for a libstdc++ on a vanilla
or 'bare metal' build. And the assumption that a libc, or any other
system lib even exists for a bare metal target is flawed. The cross
compiler should only depend on, or assume the existence of system libs
when it is being built with a *FULL* triplet where a target *OS* is
specified.

Currently, kernel developers need to build newlib, and create stub
blank functions for functions that *do not* exist in their kernels
just so that the unnecessary libstdc++v3 will build without problems
(REF: http://wiki.osdev.org/GCC_Cross-Compiler); yet neither newlib,
nor any other library is needed for a vanilla target. A vanilla target
should produce free-standing binaries.

Please really consider this, since there is a whole community
(http://osdev.org) whose lives would be significantly eased if you
simplify the build process for a vanilla target.

Also, it may be worth noting that the idea of assuming that everyone
will use either libc, or else just use newlib is flawed. Especially
for vanilla targets. So again, making a 'special case' for newlib is
really not a very grace solution to the problem.

--Please consider this seriously.

Reply via email to