not really a fedora question, but i'm interested in a step-by-step description of what happens when one compiles and runs "hello, world". it's sort of a fedora question since i want to relate those steps to the essential fedora packages and where they come into play (gcc, cpp, glibc-devel, libgcc, and so on), related to things like crtbegin, crtend, etc. i'm thinking you get the idea.
i wanted to write a short tutorial showing how that process works, adding in usage of nm, readelf and/or objdump to describe what happens at each step. is there anything out there something like that? thanks.
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
On Fri, 2009-10-30 at 02:36 -0400, Robert P. J. Day wrote:
not really a fedora question, but i'm interested in a step-by-step description of what happens when one compiles and runs "hello, world". it's sort of a fedora question since i want to relate those steps to the essential fedora packages and where they come into play (gcc, cpp, glibc-devel, libgcc, and so on), related to things like crtbegin, crtend, etc. i'm thinking you get the idea.
Maybe not exactly what you're looking for but I read this book a few years ago:
http://savannah.nongnu.org/projects/pgubook/
It's now available under the GNU FDL (although I think a print edition is still available). It covers basic programming using assembler and picks apart classic examples like "Hello World" at the instruction level.
Regards, Bryn.
On Fri, 30 Oct 2009, Bryn M. Reeves wrote:
On Fri, 2009-10-30 at 02:36 -0400, Robert P. J. Day wrote:
not really a fedora question, but i'm interested in a step-by-step description of what happens when one compiles and runs "hello, world". it's sort of a fedora question since i want to relate those steps to the essential fedora packages and where they come into play (gcc, cpp, glibc-devel, libgcc, and so on), related to things like crtbegin, crtend, etc. i'm thinking you get the idea.
Maybe not exactly what you're looking for but I read this book a few years ago:
http://savannah.nongnu.org/projects/pgubook/
It's now available under the GNU FDL (although I think a print edition is still available). It covers basic programming using assembler and picks apart classic examples like "Hello World" at the instruction level.
that doesn't go as deep as i'd like. actually, after i thought about it a bit longer, i realized that i'd like a document that gets into the details of gcc debugging and optimization in the sense of actually *explaining* it. it's one thing to read the gcc manual to see what options are available, but it's quite another to truly understand what they all represent.
does such a document exist?
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
Robert P. J. Day wrote:
On Fri, 30 Oct 2009, Bryn M. Reeves wrote:
On Fri, 2009-10-30 at 02:36 -0400, Robert P. J. Day wrote:
not really a fedora question, but i'm interested in a step-by-step description of what happens when one compiles and runs "hello, world". it's sort of a fedora question since i want to relate those steps to the essential fedora packages and where they come into play (gcc, cpp, glibc-devel, libgcc, and so on), related to things like crtbegin, crtend, etc. i'm thinking you get the idea.
Maybe not exactly what you're looking for but I read this book a few years ago:
http://savannah.nongnu.org/projects/pgubook/
It's now available under the GNU FDL (although I think a print edition is still available). It covers basic programming using assembler and picks apart classic examples like "Hello World" at the instruction level.
that doesn't go as deep as i'd like. actually, after i thought about it a bit longer, i realized that i'd like a document that gets into the details of gcc debugging and optimization in the sense of actually *explaining* it. it's one thing to read the gcc manual to see what options are available, but it's quite another to truly understand what they all represent.
does such a document exist?
rday
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
Perhaps an ASM book covering the essentials will help for starters; then, books on compilers and how they work aren't hard to find on the 'net.
On 10/30/2009 10:59 PM, Robert P. J. Day wrote:
On Fri, 30 Oct 2009, Bryn M. Reeves wrote:
[...snip...] that doesn't go as deep as i'd like. actually, after i thought about it a bit longer, i realized that i'd like a document that gets into the details of gcc debugging and optimization in the sense of actually *explaining* it. it's one thing to read the gcc manual to see what options are available, but it's quite another to truly understand what they all represent.
does such a document exist?
How about http://www.redhat.com/magazine/002dec04/features/gcc/
cheers, - steve
On Sat, 2009-10-31 at 01:07 +0530, steve wrote:
On 10/30/2009 10:59 PM, Robert P. J. Day wrote:
On Fri, 30 Oct 2009, Bryn M. Reeves wrote:
[...snip...] that doesn't go as deep as i'd like. actually, after i thought about it a bit longer, i realized that i'd like a document that gets into the details of gcc debugging and optimization in the sense of actually *explaining* it. it's one thing to read the gcc manual to see what options are available, but it's quite another to truly understand what they all represent.
does such a document exist?
How about http://www.redhat.com/magazine/002dec04/features/gcc/
cheers,
- steve
It depends what you want to know about gcc. If you want and explanation of all the options on the gcc command the above link will not suffice. -- ======================================================================= Finagle's First Law: If an experiment works, something has gone wrong. ======================================================================= Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam@sbcglobal.net
On 10/31/2009 01:07 AM, steve wrote:
On 10/30/2009 10:59 PM, Robert P. J. Day wrote:
On Fri, 30 Oct 2009, Bryn M. Reeves wrote:
[...snip...] that doesn't go as deep as i'd like. actually, after i thought about it a bit longer, i realized that i'd like a document that gets into the details of gcc debugging and optimization in the sense of actually *explaining* it. it's one thing to read the gcc manual to see what options are available, but it's quite another to truly understand what they all represent.
does such a document exist?How about http://www.redhat.com/magazine/002dec04/features/gcc/
Sorry i was too quick in replying. On re-reading your mail i realized that you weren't really looking for an high level overview of what gcc does.
Anyways, with regards to the debugging gcc and optimization you might find these links useful:
http://gcc.gnu.org/onlinedocs/gccint/ http://www.cse.iitb.ac.in/grc/gccdocs.html http://en.wikibooks.org/wiki/GNU_C_Compiler_Internals http://gcc.gnu.org/wiki/
and with regards to a document which explains the details of compiling "hello, world", i've never really come across something like that (although I've searched for it). Compilers are complex beasts and the gcc more so. GCC is after all a compiler _collection_.
For just a usage reference, i guess books like these might help:
http://shop.fsf.org/product/using-gcc-gnu-compiler-collection-reference-manu... http://www.network-theory.co.uk/gcc/intro/
I haven't read either of them tho' so I'm just guessing here.
cheers, - steve
Hi,
gah !! I am really sorry for replying to my own mail the /second/ time in the same thread, but I /had/ to send this ...
On 10/31/2009 02:59 AM, steve wrote:
[...snip...] For just a usage reference, i guess books like these might help:
http://shop.fsf.org/product/using-gcc-gnu-compiler-collection-reference-manu... http://www.network-theory.co.uk/gcc/intro/ [...snip..]
The Online edition for the second book is at http://www.network-theory.co.uk/docs/gccintro/
The gnu books page points to the print edition and there is just one link pointing to the online edition from the print edition page (to encourage people to buy the book i guess).
cheers, - steve