DCEmulation

dreamcast development • homebrew software • hardware hacking • indie games • emulators • and more!
Back to main site
It is currently Tue Sep 02, 2014 9:42 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 44 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 7:41 am 
Offline
DCEmu Freak
DCEmu Freak

Joined: Sun Apr 10, 2011 10:05 am
Posts: 65
Okay it ended with this:

Code:
make[5]: Entering directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/thumb/libgcc'
/bin/bash ../../../../gcc-4.5.2/libgcc/../mkinstalldirs /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb
mkdir -p -- /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb
/usr/bin/install -c -m 644 libgcc.a /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/
chmod 644 /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/libgcc.a
/opt/toolchains/dc/arm-elf/arm-elf/bin/ranlib /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/libgcc.a
/usr/bin/install -c -m 644 libgcov.a /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/
chmod 644 /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/libgcov.a
/opt/toolchains/dc/arm-elf/arm-elf/bin/ranlib /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/libgcov.a
parts="crtbegin.o crtend.o crti.o crtn.o";            \
   for file in $parts; do               \
     rm -f /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/$file;   \
     /usr/bin/install -c -m 644 $file /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/thumb/;   \
   done
make[5]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/thumb/libgcc'
make[5]: Entering directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/fpu/libgcc'
/bin/bash ../../../../gcc-4.5.2/libgcc/../mkinstalldirs /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu
mkdir -p -- /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu
/usr/bin/install -c -m 644 libgcc.a /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/
chmod 644 /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/libgcc.a
/opt/toolchains/dc/arm-elf/arm-elf/bin/ranlib /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/libgcc.a
/usr/bin/install -c -m 644 libgcov.a /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/
chmod 644 /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/libgcov.a
/opt/toolchains/dc/arm-elf/arm-elf/bin/ranlib /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/libgcov.a
parts="crtbegin.o crtend.o crti.o crtn.o";            \
   for file in $parts; do               \
     rm -f /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/$file;   \
     /usr/bin/install -c -m 644 $file /opt/toolchains/dc/arm-elf/lib/gcc/arm-elf/4.5.2/fpu/;   \
   done
make[5]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/fpu/libgcc'
make[4]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/libgcc'
make[3]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2/arm-elf/libgcc'
make[2]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2'
make[1]: Leaving directory `/home/nico/cadcdev/kos/utils/dc-chain/build-gcc-arm-elf-4.5.2'


After like 3 hours of compiling :lol:

Looks like success, right? :grin:

EDIT:
Also, this environ script, isn't that just something to allow both x86/Sh4 architectures to be supported or am I talking jibberish? :?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 8:05 am 
Offline
Psychotic DCEmu
Psychotic DCEmu

Joined: Mon Aug 11, 2008 7:34 am
Posts: 577
Location: Nowhere U.S.A.
I personally compiled this on a x86_64 system. I'm pretty sure all sourcing the environ.sh file does is set certain environmental variables by calling the export command.

_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 8:47 am 
Offline
DCEmu Freak
DCEmu Freak

Joined: Sun Apr 10, 2011 10:05 am
Posts: 65
Stryfe wrote:
I personally compiled this on a x86_64 system. I'm pretty sure all sourcing the environ.sh file does is set certain environmental variables by calling the export command.

So all I need to do is run the script? :?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 9:22 am 
Offline
Psychotic DCEmu
Psychotic DCEmu

Joined: Mon Aug 11, 2008 7:34 am
Posts: 577
Location: Nowhere U.S.A.
I just followed the instructions from the 'cadcdev/kos/doc/README' file under the 'BUILDING' section. Edit the sample file to reflect the desired platform. It was DC for me, but maybe N64 for you?

At that point open a terminal, or console window, and run 'source environ.sh', where the environ.sh file is located in the cadcdev/kos directory.

Whilst still in the same terminal/console, navigate to the make directories of kos, kos-ports, and the toolchain to run make. That's how I did it anyways.

_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 9:25 am 
Offline
DCEmu Freak
DCEmu Freak

Joined: Sun Apr 10, 2011 10:05 am
Posts: 65
Stryfe wrote:
I just followed the instructions from the 'cadcdev/kos/doc/README' file under the 'BUILDING' section. Edit the sample file to reflect the desired platform. It was DC for me, but maybe N64 for you?

At that point open a terminal, or console window, and run 'source environ.sh', where the environ.sh file is located in the cadcdev/kos directory.

Whilst still in the same terminal/console, navigate to the make directories of kos, kos-ports, and the toolchain to run make. That's how I did it anyways.

DC of course :wink:
Thanks for the advice, I'll see what I can break :lol:

EDIT:
I have to admit, I'm a little confused here. All these paths such as KOS_BASE, should they be changed?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 6:43 pm 
Offline
Psychotic DCEmu
Psychotic DCEmu

Joined: Mon Aug 11, 2008 7:34 am
Posts: 577
Location: Nowhere U.S.A.
Yes. I changed the uncommented parameters to reflect where the kos directory, and toolchain directories could be found.

For instance, I changed the following.

Code:
export KOS_BASE="/usr/local/home/bard/prj/svn/kos"

TO
Code:
export KOS_BASE="$HOME/Dreamcast/cadcdev/kos"

AND
Code:
export KOS_CC_BASE="/usr/local/dc/sh-elf"

TO
Code:
export KOS_CC_BASE="$HOME/Dreamcast/toolchains/dc/sh-elf"


etc...

I changed the default install directories for the toolchains in their makefile obviously, but it appears from about 5 posts back, you kept it at the defaults.

/home/nico/cadcdev/kos/utils/dc-chain/MAKEFILE
<snip>
Code:
sh_prefix  := /opt/toolchains/dc/$(sh_target)
arm_prefix := /opt/toolchains/dc/$(arm_target)


If I did it wrong, I'm sure someone will correct me.

EDIT;
Yeah, I think I built the toolchains before anything else without the environ.sh. You then specify their paths in the environ.sh file.

_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 7:56 pm 
Offline
DC Developer
DC Developer

Joined: Thu Aug 20, 2009 9:00 am
Posts: 316
Chilly Willy wrote:
BlueCrab wrote:
That page is extremely old and doesn't reflect the current state of things at all, unfortunately. Now that you pointed out that its still there like that, I'll go and get rid of it before anyone else gets confused. :wink:

Basically, what you need to do is to get KOS from the SVN:
Code:
svn co https://cadcdev.svn.sourceforge.net/svnroot/cadcdev cadcdev



Um - when do you plan to add SD support to the "official" repo? Most of us can't use it until you do. I'm using the repo from emuforge as that has SD card support. I'm sure many others are as well. That also has Chui's Allegro port as well.


Bump


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 10:22 pm 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 4145
Hijacking other people's topics to ask unrelated questions isn't likely to get me to answer them.


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Sun Jan 01, 2012 11:25 pm 
Offline
DC Developer
DC Developer

Joined: Thu Aug 20, 2009 9:00 am
Posts: 316
It is entirely on topic - the topic was on building kos, and part of that is WHERE to get kos from. Depending on which repo you use, you will have different capabilities, which I am pointing out. If you use the cadcdev repo, you can't use SD cards. So naturally that leads to the question of when SD card support will come to the cadcdev repo.

Sometimes you get a bit crabby, but we still love our crabby overlord anyway! :grin:


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 4:47 am 
Offline
DCEmu Freak
DCEmu Freak

Joined: Sun Apr 10, 2011 10:05 am
Posts: 65
Well it seems I'm very nearly there with this :grin:

I managed to source the environ script just fine, and I nearly got and example to compile.. (Nearly).

Code:
nico@ubuntu:~/cadcdev/kos/examples/dreamcast/pvr/texture_render$ make
rm -f texture_render.elf
rm -f texture_render.bin
kos-cc  -c ta.c -o ta.o
ta.c: In function ‘draw_textured’:
ta.c:151:12: warning: unused variable ‘tmp’
/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc -O2 -fomit-frame-pointer -ml -m4-single-only -fno-crossjumping -I/home/nico/cadcdev/kos//../kos-ports/include -I/home/nico/cadcdev/kos//include -I/home/nico/cadcdev/kos//kernel/arch/dreamcast/include -I/home/nico/cadcdev/kos//addons/include -D_arch_dreamcast -D_arch_sub_pristine -Wall -g -fno-builtin -fno-strict-aliasing  -ml -m4-single-only -Wl,-Ttext=0x8c010000 -T/home/nico/cadcdev/kos//utils/ldscripts/shlelf.xc -nodefaultlibs -L/home/nico/cadcdev/kos//lib/dreamcast -L/home/nico/cadcdev/kos//addons/lib/dreamcast -o texture_render.elf  \
      ta.o  -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/4.5.2/../../../../sh-elf/bin/ld: cannot find -lkallisti
collect2: ld returned 1 exit status
make: *** [texture_render.bin] Error 1


I would put forth a idea or two but I truly have none lol.
I'm guessing I've missed something obvious again though?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 6:50 am 
Offline
Psychotic DCEmu
Psychotic DCEmu

Joined: Mon Aug 11, 2008 7:34 am
Posts: 577
Location: Nowhere U.S.A.
Have you double checked your paths? Without knowing what sample you've compiled, my first 'guess' might the double solidus I've bolded.
Quote:
/home/nico/cadcdev/kos//utils/ldscripts/shlelf.xc


I don't mean to sound like an expert either, but once you've run 'source environ.sh', you can check any set variables with the echo command.

Examples:

Code:
# echo $KOS_LOADER
dc-tool -x

Code:
# echo $KOS_MAKE
make

Code:
# echo $KOS_BASE
/root/Dreamcast/cadcdev/kos


Etc...

_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 10:37 am 
Offline
DCEmu Freak
DCEmu Freak

Joined: Sun Apr 10, 2011 10:05 am
Posts: 65
Yeah, I changed all the paths and they appear to be correct.

Here's the environ.sh file:
Code:
# KallistiOS environment variable settings
#
# This is a sample script. Configure to suit your setup. Some possible
# alternatives for the values below are included as an example.
#
# This script should be executed in your current shell environment (probably
# by bashrc or something similar).
#

# Build architecture. Set the major architecture you'll be building for.
export KOS_ARCH="dreamcast"
#export KOS_ARCH="gba"
#export KOS_ARCH="ps2"
#export KOS_ARCH="ia32"

# Build sub-architecture. If you need a particular sub-architecture, then set
# that here; otherwise use "pristine".
export KOS_SUBARCH="pristine"
# export KOS_SUBARCH="navi"   # DC
# export KOS_SUBARCH="rte"   # PS2

# KOS main base path
export KOS_BASE="/home/nico/cadcdev/kos/"

# Make utility
export KOS_MAKE="make"
#export KOS_MAKE="gmake"

# Load utility
export KOS_LOADER="dc-tool -x"            # dcload, preconfigured
# export KOS_LOADER="dc-tool-ser -t /dev/ttyS0 -x"   # dcload-serial
# export KOS_LOADER="vgba -sound 44100 -nocrc"      # GBA/vgba

# Genromfs utility
export KOS_GENROMFS="${KOS_BASE}/utils/genromfs/genromfs"
#export KOS_GENROMFS="genromfs"

# Compiler prefixes
#export KOS_CC_BASE="/usr/local/dc/dc-elf"
#export KOS_CC_PREFIX="dc"
export KOS_CC_BASE="/opt/toolchains/dc/sh-elf"      # DC
export KOS_CC_PREFIX="sh-elf"
#export KOS_CC_BASE="${EE}"            # PS2
#export KOS_CC_PREFIX="ee"
#export KOS_CC_BASE="/usr/local/gba/arm-elf"      # GBA
#export KOS_CC_PREFIX="arm-elf"

# If you are compiling for DC and have an ARM compiler, use these too.
export DC_ARM_BASE="/opt/toolchains/dc/arm-elf"
export DC_ARM_PREFIX="arm-elf"

# Expand PATH (comment out if you don't want this done here)
export PATH="${PATH}:${KOS_CC_BASE}/bin:/usr/local/dc/bin"

# Manually add our second addons tree
export KOS_INC_PATHS="-I${KOS_BASE}/../kos-ports/include"

# reset some options because there's no reason for them to persist across
# multiple sourcing of this
export KOS_CFLAGS=""
export KOS_CPPFLAGS=""
export KOS_LDFLAGS=""
export KOS_AFLAGS=""

# Setup some default CFLAGS for compilation. The things that will go here
# are user specifyable, like optimization level and whether you want stack
# traces enabled. Some platforms may have optimization restrictions,
# please check README.
export KOS_CFLAGS="-O2 -fomit-frame-pointer"
# export KOS_CFLAGS="-O2 -DFRAME_POINTERS"

# Everything else is pretty much shared. If you want to configure compiler
# options or other such things, look at this file.
. ${KOS_BASE}/environ_base.sh


Looks okay, right?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 10:54 am 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 4145
You don't need the slash at the end of the KOS_BASE.

But anyway, what's probably wrong with your setup, since its saying you're missing -lkallisti is that you didn't build KOS itself. source the environ script, then cd to $KOS_BASE and run make.


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 1:53 pm 
Offline
DCEmu Newbie
DCEmu Newbie

Joined: Mon Jan 02, 2012 1:17 pm
Posts: 4
I'm having similar problems trying to get the toolchain to build. I'm running Ubuntu 11.10 x64. I grabbed the latest revision with SVN and ran the download.sh script, followed by the unpack.sh script. Before running make, I changed the prefixes to this:
Code:
sh_prefix  := $(HOME)/Dreamcast/dc/toolchain/$(sh_target)
arm_prefix := $(HOME)/Dreamcast/dc/toolchain/$(arm_target)

I ensured that I had build-essential, binutils, make, gcc, GMP, MPFR, MPC, etc. installed before running make. After a few minutes, it came back with an error.

Here's the log for the the newlib portion: http://pastebin.com/hxVnUgYz. This is the error that killed the whole thing at the end:
Code:
checking for suffix of object files... configure: error: in `/home/wes/kos/kos/utils/dc-chain/build-newlib-sh-elf-1.19.0/sh-elf/newlib/libc/machine/sh':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
configure: error: ../../../../../../newlib-1.19.0/newlib/libc/machine/sh/configure failed for sh
configure: error: ../../../../../newlib-1.19.0/newlib/libc/machine/configure failed for machine
configure: error: ../../../../newlib-1.19.0/newlib/libc/configure failed for libc


I would really appreciate it if someone could give me a hand with this ;) Here's the other logs if those need to be looked at: http://pastebin.com/XRcHaNuK & http://pastebin.com/4nTkcR9z


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 2:04 pm 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 4145
GCC failed to build in your case as well. Unfortunately, from the logs you posted, its not entirely clear as to why it did. Note the error at the end of the GCC build log, and try to find the config.log that corresponds to where it died.


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 2:13 pm 
Offline
DCEmu Newbie
DCEmu Newbie

Joined: Mon Jan 02, 2012 1:17 pm
Posts: 4
Thanks for the quick response! Here's the GCC build log I've got: http://pastebin.com/cVzFuGGA. I see a lot of "No such file or directory" errors in the log. Could my path variable be messed up?


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 3:35 pm 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 4145
I don't believe that its that config.log that is the problem. The one that would have more information should be the one for the target libgcc. See if you have a /home/wes/kos/kos/utils/dc-chain/build-gcc-sh-elf-4.5.2/sh-elf/libgcc directory and grab the config.log from there.


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 3:51 pm 
Offline
DCEmu Newbie
DCEmu Newbie

Joined: Mon Jan 02, 2012 1:17 pm
Posts: 4
This is the config.log from /home/wes/kos/kos/utils/dc-chain/build-gcc-sh-elf-4.5.2/sh-elf/libgcc http://pastebin.com/Ns732Kcb

Thanks again for your help


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 4:39 pm 
Offline
Psychotic DCEmu
Psychotic DCEmu

Joined: Mon Aug 11, 2008 7:34 am
Posts: 577
Location: Nowhere U.S.A.
root670 wrote:
I'm having similar problems trying to get the toolchain to build. I'm running Ubuntu 11.10 x64. I grabbed the latest revision with SVN and ran the download.sh script, followed by the unpack.sh script. Before running make, I changed the prefixes to this:
Code:
sh_prefix  := $(HOME)/Dreamcast/dc/toolchain/$(sh_target)
arm_prefix := $(HOME)/Dreamcast/dc/toolchain/$(arm_target)

Have you tried the full path instead of the '$(HOME)' variable, or even just '$HOME' without brackets?

_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: KOS In Unix systems
PostPosted: Mon Jan 02, 2012 4:45 pm 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 4145
Did you have an earlier attempt at building it fail, perhaps in the Newlib build phase? Because it looks like what's wrong is that the build script failed to install Newlib, and you ended up with the same issue that was happening to someone else in the thread with the "include" directory not being a directory.

Specifically, this is the part of the config.log that shows that:
Code:
configure:3211: checking for suffix of object files
configure:3233: /home/wes/kos/kos/utils/dc-chain/build-gcc-sh-elf-4.5.2/./gcc/xgcc -B/home/wes/kos/kos/utils/dc-chain/build-gcc-sh-elf-4.5.2/./gcc/ -B/home/wes/Dreamcast/dc/toolchain/sh-elf/sh-elf/bin/ -B/home/wes/Dreamcast/dc/toolchain/sh-elf/sh-elf/lib/ -isystem /home/wes/Dreamcast/dc/toolchain/sh-elf/sh-elf/include -isystem /home/wes/Dreamcast/dc/toolchain/sh-elf/sh-elf/sys-include    -c -g -O2  conftest.c >&5
cc1: error: /home/wes/Dreamcast/dc/toolchain/sh-elf/sh-elf/include: not a directory

I'd recommend deleting the whole destination directory, as well as all of the intermediate build results, and trying again from scratch...

All of the troubles that randomly can creep up in things like this remind me why I usually build my toolchains without any sort of script. :?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group