LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-05-2006, 11:27 AM   #1
Mejia
LQ Newbie
 
Registered: Dec 2006
Location: Mexico
Posts: 3

Rep: Reputation: 0
Question Cross-Compiling using Scratchbox.


Hello,

I'm compiling for ARM architecture, I'm using the Scratchbox Tools(no much experience actually),

I'm following the instructions from Scratchbox webpage:

"" First we need a small piece of software to compile. "Hello World" will do fine:

#include <stdio.h>

int main(void) {
printf("Hello World!\n");

return 0;
}


Then let us compile the "Hello World" natively for X86 to see it works and to see some information about the binary produced. We assume you wrote the "Hello World" to a file named 'hello.c'. Now in the same directory where you have the 'hello.c' execute a command:

> gcc -Wall -o hello hello.c

It should not output anything and then you should have a 'hello' binary that you can run to get output of "Hello World!".

> ./hello
Hello World!

Now for running a 'file' command to see some information about the 'hello' binary:

> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
""


My question is: what can I do to change the GNU/Linux version of the "hello" file compiled. For instance: change the version from GNU/Linux 2.2.0 to GNU/Linux 2.6.18.

Your help is very appreciated.
Thanks in advance.
 
Old 12-06-2006, 05:21 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
change the version from GNU/Linux 2.2.0 to GNU/Linux 2.6.18
Are you sure the "2.2.0" denotes the kernel version? I think its another specification.
 
Old 12-06-2006, 09:06 AM   #3
Mejia
LQ Newbie
 
Registered: Dec 2006
Location: Mexico
Posts: 3

Original Poster
Rep: Reputation: 0
My Distro is Fedora and my kernel is 2.6.18, and my concern is: why the Scratchbox is compiling for GNU/Linux 2.2.0 while my Kernel is 2.6.18, then I don't think the "2.2.0" denotes the kernel version, my first guess is that I can fix this problem by patching the Scratchbox or by changing some headers, but I don't know how...

Thanks in advance !
 
Old 12-06-2006, 10:13 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you run "cc -dumpmachine | grep -i arm", does your toolchain's cc return "arm(-something)"?
 
Old 12-06-2006, 11:14 AM   #5
Mejia
LQ Newbie
 
Registered: Dec 2006
Location: Mexico
Posts: 3

Original Poster
Rep: Reputation: 0
First thanks for your help !

The following is a more real example of what is happening in my workstation when I login to the Scratchbox:

=============================
[sbox-temporal: /] > ls
bin floppy lib opt srv tools.tar
boot home lmbench-2.5 proc sys usr
cdrom host_usr login_target.sh root targets var
dev inetutils-1.4.2 media sbin tmp
etc initrd mnt scratchbox tools
[sbox-temporal: /] > cd usr
[sbox-temporal: /usr] > ls
bin include lib sbin
[sbox-temporal: /usr] > cd bin
[sbox-temporal: /usr/bin] > ls
catchsegv gencat getent locale mtrace rpcinfo zdump
cc getconf ldd localedef rpcgen tzselect
[sbox-temporal: /usr/bin] > file locale
locale: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped
[sbox-temporal: /usr/bin] > cc -dumpmachine | grep -i arm
arm-unknown-linux-gnu

[sbox-temporal: /usr/bin] >

===============================

Notes:
1. Using Fedora 5
2. with Kernel 2.6.18
3. with gcc-4.0.1 & glibc-2.3.2
4. with binutils-2.16.1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Compiling dosnlinux Programming 5 03-01-2006 11:12 AM
cross compiling cerin Linux - Software 1 02-11-2006 10:47 PM
wx widget and cross compiling guideweb Programming 0 09-20-2005 11:06 PM
cross-compiling? jon_k Programming 3 12-09-2004 09:36 AM
cross compiling with g++ hornofsalvation Linux - Newbie 2 10-09-2004 10:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration