This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building a cross compiler, and unsure about the use of --without-headers


On Wed, Mar 16, 2011 at 3:48 PM, Kai Ruottu <kai.ruottu@wippies.com> wrote:
> 16.3.2011 16:02, David Paterson kirjoitti:
>>
>> Ah - would I copy the Newlib sources into a specific location? ?Or
>> just move the whole directory?
>
> The usual method may be to symlink the 'newlib-a.b.c/newlib' and
> 'newlib-a.b.c/libgloss' directories to the gcc-x.y.z main source
> directory, just like the 'libiberty', 'libstdc++-v3', 'libspp'
> are there, or how one puts 'gmp', 'mpfr' etc. there to be configured
> and built at the same time with the 'gcc' there (that of course
> is what once was the 'GCC sources').

Thanks Kai - that sounds pretty simple :-)  I hadn't thought of
putting the other libraries there either.

Would it work with adding Binutils as well?  That's usually built
after the libs but before GCC.  Time for some experimenting I think...
(For me, experimenting is a good way to find out how things work, and
to learn the inner workings of the system.  I'm also learning how to
add a new board support package, but that's not too hard so far.)

> So :
>
> ?- 'make all-gcc' builds only GCC and its prerequisites
> ?- 'make all-target-libgcc' builds 'libgcc' for the target
> ?- 'make install-gcc' install only GCC
> ?- 'make install-target-libgcc' installs 'libgcc'
>
> There are quite a lot "partial build" choices...

Excellent.  I'll have a look at the make targets and see what options I have.

> The Cygnus people used to have their local 'Cygnus-tree' (GNUPro srcs)
> where everything was built only in one stage. ?Putting the 'newlib'
> and 'libgloss' into the GCC sources was instructed many times in many
> sites but all people have a little NIH-attitude ("Not Invented Here")
> so they like to find other ways to do the same. Maybe they didn't like
> to do any copying (pre-install the headers) or any symlinking (put the
> 'newlib' and 'libgloss' into the "pristine" GCC sources) because that
> would be "heretic". I really don't know their reasons, or haven't
> understood the reasons at all :( ?In any case having 'newlib' and
> 'libgloss' with 'gcc', 'gas', 'bfd', 'opcodes', 'libiberty' etc. as
> subdirectories in the same sources, isn't anything new or innovative,
> just old practice.

Well, as I said I'm quite new to this, so I have no worries about
being a "heretic" :-)

Anything which makes the process simpler is good in my view - simpler
means less chance of errors.  As long as I document it properly, then
it shouldn't be a problem.

>> OK - I may try this, but as I mentioned above, which directory should
>> I put the sources in?
>
> Into the main 'gcc-4.5.2' or something directory as 'newlib' and
> 'libgloss' there, extracted from the 'newlib-1.18.0' or something
> via symlinks or copying. I would suggest symlinks and removing them
> immediately when they aren't needed any more. Having them there will
> cause weird problems if the sources are configured for some non-newlib
> target and even not using '--with-newlib' ! ?If there is any possibility
> that the target could use newlib (newlib and libgloss could be
> configured for this), then instead of the right target C library the
> newlib headers in the sources will be tried :( ?I remember this
> happening with 'armv7l-meego-linux-gnueabi' or some other target which
> had its own prebuilt glibc...

OK - good advice.  This build is specifically for one embedded project
so it shouldn't be a problem, but something to remember for the
future.

Thanks again,

David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]