This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


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

why build start files before core gcc pass 2 ?


Dear yan and All,

Before using ct-ng, I built a toolchain as the following steps:

1 build binutils;

2 bare-metal(freestanding) gcc

  a configured with "--with-newlib" not to depend on glibc;
  b configured with "--disable-shared" to build static libgcc, because
shared libgcc will linked start files, crt*.o,  which will be built in
glibc.

3 use the bare-meta gcc builing glibc;

4 glibc is ready, so compile the full gcc.

while studying ct-ng scripts, I found ct-ng add another gcc step:

after building bare-meta gcc, ct-ng install libc headers and build
crt*.o files, then build gcc pass 2, then building glibc using gcc
pass 2, then final gcc.

What I am confused is:

The crt*.o files is linked into executable and shared, so why gcc need
these files in compiling time, why gcc need crt*.o files ?

in docs "How is a toolchain constructed.txt", it said "The start files
are a very few files that gcc needs to be able to turn on thread local
storage (TLS) on an NPTL system." But I can not grasp it.

Thanks.

Regards,
Jacky

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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