More problems building KOS!

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

More problems building KOS!

Post by Corbin »

Getting KOS to install on a machine, even a clean "proper" install, is always different for me. For some reason, it just either keeps changing or differs wildly depending on what version of GCC I have. I've ripped a lot of my hair out of my head already ;)

I have followed Ph3nom's instructions in this post to a "T". So far, I can't get past this error, while attempting to build the DC-Chain:

<...>
-Wmissing-prototypes -Wshadow -Werror -g -O2 -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c -o opncls.lo ../../binutils-2.23.2/bfd/opncls.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.23.2/bfd -I. -I../../binutils-2.23.2/bfd -I../../binutils-2.23.2/bfd/../include -DHAVE_bfd_elf32_sh_vec -DHAVE_bfd_elf32_shl_vec -DHAVE_shcoff_vec -DHAVE_shlcoff_vec -DHAVE_shcoff_small_vec -DHAVE_shlcoff_small_vec -DHAVE_bfd_elf32_sh64_vec -DHAVE_bfd_elf32_sh64l_vec -DHAVE_bfd_elf64_sh64_vec -DHAVE_bfd_elf64_sh64l_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -DBINDIR=\"/opt/toolchains/dc/sh-elf/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c ../../binutils-2.23.2/bfd/opncls.c -o opncls.o
In file included from ../../binutils-2.23.2/bfd/opncls.c:26:0:
../../binutils-2.23.2/bfd/opncls.c: In function ‘bfd_fopen’:
./bfd.h:529:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
^
../../binutils-2.23.2/bfd/opncls.c:261:5: note: in expansion of macro ‘bfd_set_cacheable’
bfd_set_cacheable (nbfd, TRUE);
^
cc1: all warnings being treated as errors
Makefile:1575: recipe for target 'opncls.lo' failed

make[5]: *** [opncls.lo] Error 1
make[5]: Leaving directory '/usr/local/dc/kos/utils/dc-chain/build-binutils-sh-elf-2.23.2/bfd'
Makefile:1617: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/usr/local/dc/kos/utils/dc-chain/build-binutils-sh-elf-2.23.2/bfd'
Makefile:1108: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/usr/local/dc/kos/utils/dc-chain/build-binutils-sh-elf-2.23.2/bfd'
Makefile:2509: recipe for target 'all-bfd' failed
make[2]: *** [all-bfd] Error 2
make[2]: Leaving directory '/usr/local/dc/kos/utils/dc-chain/build-binutils-sh-elf-2.23.2'
Makefile:841: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/local/dc/kos/utils/dc-chain/build-binutils-sh-elf-2.23.2'
Makefile:137: recipe for target 'build-sh4-binutils' failed
make: *** [build-sh4-binutils] Error 1

Corbyn@Coraline /usr/local/dc/kos/utils/dc-chain
It wasn't mentioned in Ph3nom's post, but that's what I'm running into now. I definitely need help because every time I've tried to build this thing for years, I usually give up and have someone else build things for me because it just seems like a headache and a half. No ill will intended, of course, but god damn. . . ;)

I'll just keep posting in this thread until I get the entire toolchain built, and then use this to make a guide of my own to compliment Ph3nom's.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: More problems building KOS!

Post by bogglez »

What compiler version are you using, then? Ph3nom says he used 4.7.3. I've built KOS using 4.9.3 yesterday on Debian 64 bit.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5652
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: More problems building KOS!

Post by BlueCrab »

If you're using KOS 2.0.0, you need to change dc-chain to pass --disable-werror to configure. Otherwise, you will not be able to build the version of Binutils used with anything beyond GCC 4.7 or so.

The dc-chain script in the KOS Git repository already has this change made.

Find the configure line in the $(build_binutils) target of the dc-chain Makefile (in the current version it's at line 155... it should be in around the same spot in yours). Change it so that it says this instead of what's there:

Code: Select all

	cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --disable-werror $(to_log)
The only thing that should need to be changed is adding the "--disable-werror" part.

That all said, I would recommend using the version out of the Git repository. It will be released as 2.1.0 sometime in the fairly near future, after I finish up with one or two loose ends (in kos-ports, not kos itself).
User avatar
Corbin
DC Developer
DC Developer
Posts: 121
Joined: Fri Dec 14, 2007 1:56 am
Location: California
Has thanked: 0
Been thanked: 0

Re: More problems building KOS!

Post by Corbin »

You guys are always so patient and awesome when it comes to KOS! Thanks! Successfully built!

Now I'm having a problem with one of the KOS-ports (SDL). When I compile my program, I get this output:

Code: Select all

/resample.o obj_dc/timidity/tables.o obj_dc/timidity/timidity.o  -lm -Wl,--warn-common -lgl -lpng -ljpeg -lz -ltremor -lSDL -lm -lstdc++ -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
/usr/local/dc/kos/lib/dreamcast/libkallisti.a(thread.o): warning: common of `_jiffies' overridden by definition
/usr/local/dc/kos/lib/dreamcast/libkallisti.a(irq.o): warning: defined here
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o): In function `SDL_AudioInit':
/cygdrive/d/cygwin/usr/local/dc/kos-ports/sdl/build/SDL-1.2.15/src/audio/SDL_audio.c:382: undefined reference to `_DISKAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o):(.rodata.bootstrap+0x0): undefined reference to `_DISKAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_audio.o):(.rodata.bootstrap+0x4): undefined reference to `_DUMMYAUD_bootstrap'
/usr/local/dc/kos/../kos-ports/lib/libSDL.a(SDL_video.o):(.rodata.bootstrap+0x4): undefined reference to `_DUMMY_bootstrap'
collect2: error: ld returned 1 exit status
Not sure what's going on here now, looks like some sort of SDL version conflict or something?
User avatar
Bouz
DCEmu Junior
DCEmu Junior
Posts: 46
Joined: Mon May 10, 2010 3:42 pm
Location: St. Bauzille de Putois (France)
Has thanked: 0
Been thanked: 0

Re: More problems building KOS!

Post by Bouz »

Hi there, I have just tried to install KOS under Cygwin.
I have the latest KOS chain from the git repository, and it looks like this line in the Makefile has not been fixed (or I have missed something).
And I am currently stuck at step "checking whether the C compiler works..." for about 12 hours, so I think something is wrong with my setup (I have followed Phenom's guide step by step).
Is that something that happened to someone else?

Thanks in advance for your help!
User avatar
AtariOwl
DCEmu Freak
DCEmu Freak
Posts: 96
Joined: Fri May 23, 2008 5:57 am
Has thanked: 0
Been thanked: 2 times

Re: More problems building KOS!

Post by AtariOwl »

OK

Having failed with the wiki mingw32 method i tried ph3nom's method

I think i am failing at the same point as Corbin here

Code: Select all


In file included from ../../binutils-2.23.2/bfd/opncls.c:26:0:
../../binutils-2.23.2/bfd/opncls.c: In function ‘bfd_fopen’:
./bfd.h:529:65: error: right-hand operand of comma expression has no effect [-We                           rror=unused-value]
 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
                                                                 ^
../../binutils-2.23.2/bfd/opncls.c:261:5: note: in expansion of macro ‘bfd_set_c                           acheable’
     bfd_set_cacheable (nbfd, TRUE);
     ^
cc1: all warnings being treated as errors
make[5]: *** [Makefile:1575: opncls.lo] Error 1
make[5]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/b                           uild-binutils-sh-elf-2.23.2/bfd'
make[4]: *** [Makefile:1617: all-recursive] Error 1
make[4]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/b                           uild-binutils-sh-elf-2.23.2/bfd'
make[3]: *** [Makefile:1108: all] Error 2
make[3]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/b                           uild-binutils-sh-elf-2.23.2/bfd'
make[2]: *** [Makefile:2509: all-bfd] Error 2
make[2]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/b                           uild-binutils-sh-elf-2.23.2'
make[1]: *** [Makefile:842: all] Error 2
make[1]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/b                           uild-binutils-sh-elf-2.23.2'
make: *** [Makefile:141: build-sh4-binutils] Error 1

i made the change to the makefile outlined by Bluecrab

And i seem to have the same error

EDIT: I retract.. i replaced the wrong line, compiling now, will let you know

Now entering my 3rd day

and the error now looks the same as from the wiki version

Code: Select all

  echo "@set VERSION_PACKAGE (GCC) " >> gcc-vers.texiT; \
fi
echo "@set BUGURL @uref{http://gcc.gnu.org/bugs.html}" >> gcc-vers.texiT; \
mv -f gcc-vers.texiT gcc-vers.texi
if [ xinfo = xinfo ]; then \
        makeinfo --split-size=5000000 --split-size=5000000 --no-split -I . -I ../../gcc-4.7.3/gcc/doc \
                -I ../../gcc-4.7.3/gcc/doc/include -o doc/cpp.info ../../gcc-4.7.3/gcc/doc/cpp.texi; \
fi
if [ xinfo = xinfo ]; then \
        makeinfo --split-size=5000000 --split-size=5000000 --no-split -I . -I ../../gcc-4.7.3/gcc/doc \
                -I ../../gcc-4.7.3/gcc/doc/include -o doc/gcc.info ../../gcc-4.7.3/gcc/doc/gcc.texi; \
fi
../../gcc-4.7.3/gcc/doc/gcc.texi:89: warning: @tex should only appear at the beginning of a line
../../gcc-4.7.3/gcc/doc/gcc.texi:209: no matching `@end tex'
../../gcc-4.7.3/gcc/doc/gcc.texi:209: no matching `@end multitable'
../../gcc-4.7.3/gcc/doc/gcc.texi:209: no matching `@end titlepage'
make[3]: *** [Makefile:4342: doc/gcc.info] Error 1

make[3]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/build-gcc-sh-elf-4.7.3/gcc'
make[2]: *** [Makefile:3836: all-gcc] Error 2
make[2]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/build-gcc-sh-elf-4.7.3'
make[1]: *** [Makefile:854: all] Error 2
make[1]: Leaving directory '/cygdrive/d/cygwin/usr/local/dc/kos/utils/dc-chain/build-gcc-sh-elf-4.7.3'
make: *** [Makefile:153: build-sh4-gcc-pass1] Error 1

Its in the documentation compile?
Post Reply