public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Vanilla cross compiling and libstdc++v3
@ 2010-04-05 14:59 Kofi Doku Atuah
  2010-04-05 15:17 ` Dave Korn
  2010-04-05 15:17 ` Nathan Froyd
  0 siblings, 2 replies; 4+ messages in thread
From: Kofi Doku Atuah @ 2010-04-05 14:59 UTC (permalink / raw)
  To: gcc

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.

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

* Re: Vanilla cross compiling and libstdc++v3
  2010-04-05 14:59 Vanilla cross compiling and libstdc++v3 Kofi Doku Atuah
  2010-04-05 15:17 ` Dave Korn
@ 2010-04-05 15:17 ` Nathan Froyd
  2010-04-05 15:38   ` Dave Korn
  1 sibling, 1 reply; 4+ messages in thread
From: Nathan Froyd @ 2010-04-05 15:17 UTC (permalink / raw)
  To: Kofi Doku Atuah; +Cc: gcc

On Mon, Apr 05, 2010 at 10:29:07AM -0430, Kofi Doku Atuah wrote:
> 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.

Have you tried configuring with --enable-languages=c?  Doing so should
ensure that libstdc++ is not configured for your target.

-Nathan

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

* Re: Vanilla cross compiling and libstdc++v3
  2010-04-05 14:59 Vanilla cross compiling and libstdc++v3 Kofi Doku Atuah
@ 2010-04-05 15:17 ` Dave Korn
  2010-04-05 15:17 ` Nathan Froyd
  1 sibling, 0 replies; 4+ messages in thread
From: Dave Korn @ 2010-04-05 15:17 UTC (permalink / raw)
  To: Kofi Doku Atuah; +Cc: gcc

On 05/04/2010 15:59, Kofi Doku Atuah wrote:
> Hello, and a pleasant good day to everyone. With no further ado:

  :)  Actually, that's a fair amount of ado simply to say:

> There's no *need* for a libstdc++ on a vanilla or 'bare metal' build.

  This is my idea of "no further ado":

/path/to/gcc/configure --disable-libstdc___v3

    cheers,
      DaveK

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

* Re: Vanilla cross compiling and libstdc++v3
  2010-04-05 15:17 ` Nathan Froyd
@ 2010-04-05 15:38   ` Dave Korn
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Korn @ 2010-04-05 15:38 UTC (permalink / raw)
  To: Nathan Froyd; +Cc: Kofi Doku Atuah, gcc

On 05/04/2010 16:10, Nathan Froyd wrote:

> 
> Have you tried configuring with --enable-languages=c?  Doing so should
> ensure that libstdc++ is not configured for your target.

  I've found it possible to build a c++ compiler with no libstdc (as per other
post).  Bare-metal COFF target, no libc; I configure using "--without-headers
--without-libs --with-newlib --disable-libc --disable-libssp --with-gnu-as
--with-gnu-ld --disable-sjlj-exceptions --disable-libstdc___v3
--enable-languages=c,c++".

  I haven't verified how useful the thing actually is in practice with no
libstdc and no libsupc.

    cheers,
      DaveK

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

end of thread, other threads:[~2010-04-05 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-05 14:59 Vanilla cross compiling and libstdc++v3 Kofi Doku Atuah
2010-04-05 15:17 ` Dave Korn
2010-04-05 15:17 ` Nathan Froyd
2010-04-05 15:38   ` Dave Korn

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