first C source file to be compiled

Discussion in 'C Programming' started by Marc Jeambrun, Dec 1, 2006.

  1. Hello,

    I have a simple question I would like to ask to you guys... It boils
    down to a simple observation about all the C libraries existing out
    there: there must be a C source file that must be compiled first, I mean
    before all the others.

    That's why I poke my nose in a C library (GNU glibc for instance) to
    find out this mysterious file... This is indeed the library programmers
    (including me) often refer to.

    But I'm not good enough to extract from autotools-related files (in the
    glibc tarball) which C file is compiled first. Or perhaps I made a
    mistake in my way of thinking and this file is actually located elsewhere...

    Can you help me in this tremendous quest for truth finding this C source
    file ?

    Thanks in advance for your help.

    Marc Jeambrun
    Marc Jeambrun, Dec 1, 2006
    #1
    1. Advertising

  2. Marc Jeambrun

    santosh Guest

    Marc Jeambrun wrote:
    > Hello,
    >
    > I have a simple question I would like to ask to you guys... It boils
    > down to a simple observation about all the C libraries existing out
    > there: there must be a C source file that must be compiled first, I mean
    > before all the others.
    >
    > That's why I poke my nose in a C library (GNU glibc for instance) to
    > find out this mysterious file... This is indeed the library programmers
    > (including me) often refer to.
    >
    > But I'm not good enough to extract from autotools-related files (in the
    > glibc tarball) which C file is compiled first. Or perhaps I made a
    > mistake in my way of thinking and this file is actually located elsewhere...
    >
    > Can you help me in this tremendous quest for truth finding this C source
    > file ?


    There need be nothing special about the module to be compiled first. It
    depends on the command lines generated by makefiles and for projects
    like glibc(), can be quite involved, and may vary from machine to
    machine, OS to OS, compiler to compiler.

    It's also a detail of implementation and instance and hence off-topic
    here.
    santosh, Dec 1, 2006
    #2
    1. Advertising

  3. Marc Jeambrun

    Chris Dollin Guest

    Marc Jeambrun wrote:

    > I have a simple question I would like to ask to you guys... It boils
    > down to a simple observation about all the C libraries existing out
    > there: there must be a C source file that must be compiled first, I mean
    > before all the others.


    Even assuming that there must be a compiled-first file, what are you
    thinking of doing with it when you've got it?

    [It would, I think, be more than 30 years old ... if it exists at all.]

    --
    Chris "subtle, like a barrel" Dollin
    "Never ask that question!" Ambassador Kosh, /Babylon 5/
    Chris Dollin, Dec 1, 2006
    #3
  4. Marc Jeambrun said:

    > Hello,
    >
    > I have a simple question I would like to ask to you guys... It boils
    > down to a simple observation about all the C libraries existing out
    > there: there must be a C source file that must be compiled first, I mean
    > before all the others.


    Ponder no more!

    You are right - there *is* such a file. But there's no mystery about it. It
    is often published in books on the C language. For example, you can find it
    on page 1000 of K&R2, a trivial variant on page 100001 of "C: How to
    Program", 5th edition, by Deitel and Deitel, and 1001 of "C: A Reference
    Manual", 4th edition, by Harbison and Steele. I've written the page numbers
    given in binary because I know how much students like to feel involved in
    the learning process.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at the above domain, - www.
    Richard Heathfield, Dec 1, 2006
    #4
  5. Marc Jeambrun

    jacob navia Guest

    Marc Jeambrun wrote:
    > Hello,
    >
    > I have a simple question I would like to ask to you guys... It boils
    > down to a simple observation about all the C libraries existing out
    > there: there must be a C source file that must be compiled first, I mean
    > before all the others.
    >
    > That's why I poke my nose in a C library (GNU glibc for instance) to
    > find out this mysterious file... This is indeed the library programmers
    > (including me) often refer to.
    >
    > But I'm not good enough to extract from autotools-related files (in the
    > glibc tarball) which C file is compiled first. Or perhaps I made a
    > mistake in my way of thinking and this file is actually located
    > elsewhere...
    >
    > Can you help me in this tremendous quest for truth finding this C source
    > file ?
    >
    > Thanks in advance for your help.
    >
    > Marc Jeambrun


    There is a file that in many systems must be linked first.
    You are confusing (maybe) compiling and linking...

    That file is called "the startup file" or simply
    the stratup. It is normally written in assembler but it can
    be written in C too.

    Is this the file you are referring to?
    jacob navia, Dec 1, 2006
    #5
  6. Richard Heathfield wrote:

    > Marc Jeambrun said:
    >
    >> Hello,
    >>
    >> I have a simple question I would like to ask to you guys... It boils
    >> down to a simple observation about all the C libraries existing out
    >> there: there must be a C source file that must be compiled first, I mean
    >> before all the others.

    >
    > Ponder no more!
    >
    > You are right - there *is* such a file. But there's no mystery about it.
    > It is often published in books on the C language. For example, you can
    > find it on page 1000 of K&R2, a trivial variant on page 100001 of "C: How
    > to Program", 5th edition, by Deitel and Deitel, and 1001 of "C: A
    > Reference Manual", 4th edition, by Harbison and Steele. I've written the


    Richard, this is a serious error, it was
    the 7th edition of Harsteel and Humbug from 1977.



    > page numbers given in binary because I know how much students like to feel
    > involved in the learning process.
    >


    --
    "Careful with that VAX, Eugene!"
    Norbert Kolvenbach, Dec 1, 2006
    #6
  7. "Marc Jeambrun" <> wrote in message
    news:45704706$0$941$...
    > I have a simple question I would like to ask to you guys... It boils
    > down to a simple observation about all the C libraries existing out
    > there: there must be a C source file that must be compiled first, I
    > mean before all the others.


    There is no requirement that any particular file must be compiled first.
    In every large project I've seen, the source files are compiled in
    seemingly-random order.

    Linking, which is OT here, may require that some files be linked before
    others, but that typically happens after _all_ the files are compiled,
    so compilation order is again irrelevant.

    S

    --
    Stephen Sprunk "God does not play dice." --Albert Einstein
    CCIE #3723 "God is an inveterate gambler, and He throws the
    K5SSS dice at every possible opportunity." --Stephen Hawking


    --
    Posted via a free Usenet account from http://www.teranews.com
    Stephen Sprunk, Dec 1, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jd
    Replies:
    0
    Views:
    417
  2. Klaus Schneider
    Replies:
    1
    Views:
    521
    Rolf Magnus
    Dec 2, 2004
  3. lander
    Replies:
    5
    Views:
    567
    bruce barker
    Mar 5, 2008
  4. sachin

    Including compiled C source file in array

    sachin, Jun 5, 2008, in forum: C Programming
    Replies:
    14
    Views:
    476
    Flash Gordon
    Jun 9, 2008
  5. Ray Muforosky
    Replies:
    3
    Views:
    100
    Anno Siegel
    Apr 22, 2005
Loading...

Share This Page