LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   dummy.c (https://www.linuxquestions.org/questions/linux-from-scratch-13/dummy-c-655757/)

AlanScott 07-14-2008 07:45 PM

dummy.c
 
I'm new to compiling, that's why I'm trying LFS. In the book(v6.3) on the livecd the first time you do the dummy.c test, I get no response. I execute the readelf command and get nothing. Normally I know that's supposed to be a good thing, but the book says I'm supposed to look for something, is it a good thing or a bad thing?

clowenstein 07-15-2008 11:37 AM

dummy.c
 
Quote:

Originally Posted by AlanScott (Post 3214571)
I'm new to compiling, that's why I'm trying LFS. In the book(v6.3) on the livecd the first time you do the dummy.c test, I get no response. I execute the readelf command and get nothing. Normally I know that's supposed to be a good thing, but the book says I'm supposed to look for something, is it a good thing or a bad thing?

Please, nobody here can read over your shoulder to see what you are really doing.

Tell us more about what you did and what you expected to happen. Assume that few of the people who would like to help you are reading the book along with you.

Kenarkies 07-15-2008 02:30 PM

Quote:

Originally Posted by AlanScott (Post 3214571)
I'm new to compiling, that's why I'm trying LFS. In the book(v6.3) on the livecd the first time you do the dummy.c test, I get no response. I execute the readelf command and get nothing. Normally I know that's supposed to be a good thing, but the book says I'm supposed to look for something, is it a good thing or a bad thing?

Hi Alan

Probably there are not many people reading this who are using LFS (I assume this is "Linux from Scratch"). A bit of googling shows that there is another thread which looks at some problems other people were having:

http://www.linuxquestions.org/questi...ummy.c-343288/

so it would be worth looking through the answers given there. At least one customer was happy. Also the book is available separately in pdf form from their site. I haven't yet had a go at compiling the dummy.c, but if you still have trouble this can be the next step. Let us know the command steps you took and the responses from the compiler.

Ken

ciotog 07-15-2008 09:53 PM

Quote:

Originally Posted by AlanScott (Post 3214571)
I'm new to compiling, that's why I'm trying LFS.

What a coincidence! I'm new to running, that's why I entered the Boston Marathon. I'm also new to swimming, so I've decided to cross the English Channel.

;)

Kenarkies 07-15-2008 11:51 PM

Quote:

Originally Posted by ciotog (Post 3215919)
What a coincidence! I'm new to running, that's why I entered the Boston Marathon. I'm also new to swimming, so I've decided to cross the English Channel.

;)

Come on, all you good people. Just a gentle reminder that Linux is supposed to have a reputation for being helpful, particularly to "newcomers".

AlanScott 07-16-2008 06:45 AM

*Yes - It's linux from scratch, that's why it's on the linux from scratch forum section.

*It's version 6.3 of the book, the same one on the live cd. Chapter 5.7 Adjusting the toolchain.

*Kenarkies on your first post, in that thread, he actually had a return. When i run :

Code:

echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'

I get no response, and exit of 0, which everywhere else is a good thing, but here I'm supposed to be getting some kind of output. I have followed the instructions to the letter, su'ing only on the 'make install', Is there somehting else I'm supposed to be doing?

*And Kenarkies, on your second post THANK YOU!

hoes 07-16-2008 11:06 AM

change the readelf-line to: readelf -l a.out (so without the second part)
Post that output than we know whats going on.

I think you are compiling against your host and so you don't see the tools directory.

So in conclusion: * change the last command and post the result
* be as specific as you can about when and from what dir you executed the command and also print the result of 'echo $PATH'

Still the problem you have might not be a problem but more a misunderstanding of how it all works.

ciotog 07-17-2008 01:52 AM

Quote:

Originally Posted by Kenarkies (Post 3216007)
Come on, all you good people. Just a gentle reminder that Linux is supposed to have a reputation for being helpful, particularly to "newcomers".

Well I think suggesting that someone is rushing into things when they might not be ready is helpful. Alan, you'd probably get further faster starting with a different distribution (I would recommend Slackware) and start with building applications, then libraries, and so on - rather than jumping in so deep.

komodo 07-17-2008 08:25 AM

Hi Alan,

You're right, you should get some output and the fact you're not getting it is a bad thing. It actually means that during compilation of the toolchain, you missed something. I would start by checking you LFS installation of GCC by redoing the sanity check but using gcc instead of cc, as the book suggests. If that works, your cc isn't properly linked to gcc. Just work your way back from there. So, the next step would be to check on the PATH environment variable (echo $PATH). Just follow the suggestions of the book. Each time you take a step back, do the sanity check again with dummy.c and check the output.

Good luck! And, let us know what comes of it.

AlanScott 07-21-2008 07:20 PM

Ok, I don't know if this has that much to do with it, but when I execute the mv command to move the new ld to the right spot in /tools/bin, it works for the first one. However when i execute


Code:

mv -v /tools/$(gcc -dumpmachine)/bin/{ld-new,ld}

it's using the livecd gcc that has the dumpmachine output of i486, when the ld-new is in the i686 directory. my path is right, but it's not using the right gcc. This may be leading to my other problems.
I get:
Code:

echo $PATH
/tools/bin:/bin:/usr/bin

but it's not using that PATH variable when I'm compiling.

I'm following the directions on the book that's in the livecd to the letter. What is going wrong?

ciotog 07-21-2008 07:43 PM

Quote:

Originally Posted by AlanScott (Post 3222081)
Ok, I don't know if this has that much to do with it, but when I execute the mv command to move the new ld to the right spot in /tools/bin, it works for the first one. However when i execute


Code:

mv -v /tools/$(gcc -dumpmachine)/bin/{ld-new,ld}

it's using the livecd gcc that has the dumpmachine output of i486, when the ld-new is in the i686 directory. my path is right, but it's not using the right gcc. This may be leading to my other problems.
I get:
Code:

echo $PATH
/tools/bin:/bin:/usr/bin

but it's not using that PATH variable when I'm compiling.

I'm following the directions on the book that's in the livecd to the letter. What is going wrong?

This might help:

http://www.linuxfromscratch.org/pipe...er/033815.html

(follow the next few messages in the thread, that is)


All times are GMT -5. The time now is 10:40 AM.