LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2009, 07:22 PM   #1
jvilla1983
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Rep: Reputation: 0
Compiling a kernel for the Sega Dreamcast..


Hi,

I'm attempting to do a build of linux for the Sega Dreamcast and I'm running into a few issues..

First, I followed the instructions on this page..

http://www.linuxfordevices.com/c/a/L...ega-Dreamcast/

It's a very old tutorial and I found that many of the items listed for download, wouldn't compile on my way newer version of GCC (the gcc listed is 3.x.x, I'm using 4.2.2).

I decided to try using the instructions posted with newer versions.. I was pretty shocked that it worked and both gcc and busybox compiled.

The next problem was the kernel, which was old as well. So, I decided to try the latest stable linux kernel (2.6.31.6). This is where I'm running into problems..

I first tried this.. make ARCH=sh CROSS_COMPILE=sh4-linux-

it gave me this output..

Code:
  CHK     include/linux/version.h
make[1]: `include/asm-sh/machtypes.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-sh
  CC      kernel/bounds.s
cc1: error: command line option ‘-m4-nofpu’ is not supported by this configuration
cc1: error: command line option ‘-m4-nofpu’ is not supported by this configuration
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
After getting a tip from experts-exchange, I figured out that my host compiler was still x86. So, I changed my compiler to where the cross compiler I created was stored.. /usr/local/bin/sh4-linux-gcc. I created a symbolic link in /usr/bin for my executable and then changed my Makefile to point to my sh4-linux-gcc link.

That gave me this output..

Code:
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory
scripts/basic/fixdep.c:108:22: error: sys/stat.h: No such file or directory
scripts/basic/fixdep.c:109:22: error: sys/mman.h: No such file or directory
scripts/basic/fixdep.c:110:20: error: unistd.h: No such file or directory
scripts/basic/fixdep.c:111:19: error: fcntl.h: No such file or directory
scripts/basic/fixdep.c:112:20: error: string.h: No such file or directory
scripts/basic/fixdep.c:113:20: error: stdlib.h: No such file or directory
scripts/basic/fixdep.c:114:19: error: stdio.h: No such file or directory
scripts/basic/fixdep.c:116:19: error: ctype.h: No such file or directory
scripts/basic/fixdep.c:117:23: error: arpa/inet.h: No such file or directory
scripts/basic/fixdep.c: In function ‘usage’:
scripts/basic/fixdep.c:131: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:131: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:131: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:131: error: for each function it appears in.)
scripts/basic/fixdep.c:132: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘print_cmdline’:
scripts/basic/fixdep.c:140: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:143: error: ‘NULL’ undeclared here (not in a function)
scripts/basic/fixdep.c: In function ‘grow_config’:
scripts/basic/fixdep.c:156: warning: incompatible implicit declaration of built-in function ‘realloc’
scripts/basic/fixdep.c:158: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘define_config’:
scripts/basic/fixdep.c:187: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c: In function ‘use_config’:
scripts/basic/fixdep.c:206: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/basic/fixdep.c:214: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c:222: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:225: error: expected declaration specifiers or ‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_config_file’:
scripts/basic/fixdep.c:227: error: ‘len’ undeclared (first use in this function)
scripts/basic/fixdep.c: In function ‘strrcmp’:
scripts/basic/fixdep.c:261: warning: incompatible implicit declaration of built-in function ‘strlen’
scripts/basic/fixdep.c: In function ‘do_config_file’:
scripts/basic/fixdep.c:272: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:276: error: ‘O_RDONLY’ undeclared (first use in this function)
scripts/basic/fixdep.c:278: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:278: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:280: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:287: error: ‘PROT_READ’ undeclared (first use in this function)
scripts/basic/fixdep.c:287: error: ‘MAP_PRIVATE’ undeclared (first use in this function)
scripts/basic/fixdep.c:287: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:294: error: too many arguments to function ‘parse_config_file’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:301: error: expected declaration specifiers or ‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_dep_file’:
scripts/basic/fixdep.c:304: error: ‘len’ undeclared (first use in this function)
scripts/basic/fixdep.c:306: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/basic/fixdep.c:308: warning: incompatible implicit declaration of built-in function ‘strchr’
scripts/basic/fixdep.c:310: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:310: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:311: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:313: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c:314: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c: In function ‘print_deps’:
scripts/basic/fixdep.c:343: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:347: error: ‘O_RDONLY’ undeclared (first use in this function)
scripts/basic/fixdep.c:349: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:349: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:351: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:355: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:359: error: ‘PROT_READ’ undeclared (first use in this function)
scripts/basic/fixdep.c:359: error: ‘MAP_PRIVATE’ undeclared (first use in this function)
scripts/basic/fixdep.c:359: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:366: error: too many arguments to function ‘parse_dep_file’
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:379: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:379: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:381: warning: incompatible implicit declaration of built-in function ‘exit’
make[2]: *** [scripts/basic/fixdep] Error 1
make[1]: *** [scripts_basic] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.

Which maybe better than the previous, because at least I'm not getting the --with-nofpu error.

Would any of you have an idea of what I need to do to get this to compile correctly?

Thanks,

Last edited by XavierP; 12-23-2009 at 06:18 AM.
 
Old 12-03-2009, 07:24 PM   #2
jvilla1983
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I should probably also add that I did..

make ARCH=sh CROSS_COMPILE=sh4-linux- menuconfig

and

make ARCH=sh CROSS_COMPILE=sh4-linux- config

It was recognizing that I wanted an SH4 based kernel as my options for CPU's were all SH based (The one I need is SH7091, which was listed)
 
Old 12-03-2009, 08:23 PM   #3
jvilla1983
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
OK, I read a little more into the file, I need to do a few more things first before I'm able to do an actual make..

I followed the directions on here a bit more, I needed to cross compile glibc, I created my build directories.. here's what I'm getting..

I ran this command:

CC=sh4-linux-gcc ../glibc-2.9/configure --host=$TARGET --prefix=$PREFIX --disable-debug --disable-profile --disable-sanity-checks --with-headers=${PREFIX}/${TARGET}/include

Code:
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... sh4-unknown-linux-gnu
configure: running configure fragment for add-on nptl
checking sysdep dirs... sysdeps/sh/elf nptl/sysdeps/unix/sysv/linux/sh/sh4 sysdeps/unix/sysv/linux/sh/sh4 nptl/sysdeps/unix/sysv/linux/sh sysdeps/unix/sysv/linux/sh nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/sh nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/sh/sh4/fpu sysdeps/sh/sh4 nptl/sysdeps/sh sysdeps/sh sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for sh4-linux-gcc... sh4-linux-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether sh4-linux-gcc accepts -g... yes
checking for sh4-linux-gcc option to accept ISO C89... unsupported
checking for gcc... gcc
checking how to run the C preprocessor... sh4-linux-gcc -E
checking for sh4-linux-g++... no
checking for sh4-linux-c++... no
checking for sh4-linux-gpp... no
checking for sh4-linux-aCC... no
checking for sh4-linux-CC... no
checking for sh4-linux-cxx... no
checking for sh4-linux-cc++... no
checking for sh4-linux-cl.exe... no
checking for sh4-linux-FCC... no
checking for sh4-linux-KCC... no
checking for sh4-linux-RCC... no
checking for sh4-linux-xlC_r... no
checking for sh4-linux-xlC... no
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking whether /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/as is GNU as... yes
checking whether /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/ld is GNU ld... yes
checking for /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/as... /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/as
checking version of /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/as... 2.20, bad
checking for /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/ld... /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/ld
checking version of /usr/local/lib/gcc/sh4-linux/4.4.2/../../../../sh4-linux/bin/ld... 2.20, bad
checking for pwd... /bin/pwd
checking for sh4-linux-gcc... (cached) sh4-linux-gcc
checking version of sh4-linux-gcc... 4.4.2, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... no
checking for makeinfo... no
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for autoconf... no
configure: error:
*** These critical programs are missing or too old: as ld
*** Check the INSTALL file for required versions.

Last edited by XavierP; 12-23-2009 at 06:19 AM.
 
Old 12-23-2009, 06:19 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sega emulators Jayla Linux - Games 1 05-23-2008 06:54 AM
Sega Genesis 6-button Joystick with DirectPad Pro interface. ErV Linux - Hardware 13 01-04-2008 05:10 PM
Sega Genesis Emulator doralsoral Linux - Games 1 06-06-2007 01:54 PM
Need Help Cross-compiling for Dreamcast Chryzmo Linux - General 0 05-27-2007 08:29 PM
SEGA Saturn Linux - possible? steven01 Linux - General 1 10-01-2006 09:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:48 PM.

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