Page 1 of 1

buildscripts-20080624 bugs and fixes

Posted: Sat Nov 15, 2008 10:37 am
by paco
Hi,

I've being trying to build devkitPro on Debian lenny for a few days and this is what I found:

1. Patch of binutils in dkppc is not against official GNU binutils 2.18.50 but against technology preview binutils-2.18.50-20080109-2 available on mingw page in sourceforge. Apparently the patch may easily be adapted to GNU binutils but then the code generated for ARM becomes half-broken. For example, default.arm7 will not forward IPC data to ARM9 (no touchscreen, no sound, ...). As a short term fix buildscripts should download binutils from the sourceforge site and not from GNU site.

2. buildscripts/dkpsp/scripts/build-crtls.sh and buildscripts/dkpsp/scripts/build-gcc.sh have some Control-M embedded at the end of some lines which happen to confuse the shell.

3. After checking out pspsdk it should patch file pspsdk/src/libc/libcglue.c to fix the signature of gettimeofday. GCC 4.3.2 will refuse to compile a file with conflicting signatures by default. A simple fix which will also work when pspsdk gets fixed would be adding this after svn checkout:

Code: Select all

sed -i 's/gettimeofday(struct timeval \*tp, void \*tzp)/gettimeofday(struct timeval *tp, struct timezone *tzp)/g' pspsdk/src/libc/libcglue.c
4. devkitPSP uses newlib 1.15 and that version is distributed with an incorrect autoconf snippet that will abort compilation when makeinfo 4.10 or higher is found. A simple fix would be to provide a makeinfo wrapper like this:

Code: Select all

#!/bin/bash
if test "--version" = "$1" ; then
   # You may actually check whether you have makeinfo 4.4 or higher
   cat <<EOF
makeinfo (GNU texinfo) 4.7

Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
   exit 0
fi

exec /usr/bin/makeinfo "$@"
And set the path to find this wrapper first... or you may set the autoconf variables by hand:

Code: Select all

export ac_cv_prog_MAKEINFO=$YOURPATH/makeinfo
export MAKEINFO=$YOURPATH/makeinfo
5. I had to set some variables by hand because configure scripts of gcc try to guess how dynamic libraries work in your target even when cross-compiling:

Code: Select all

export ac_cv_func_dlopen=no
export ac_cv_func_shl_load=no
export ac_cv_lib_dl_dlopen=yes
export ac_cv_lib_dld_shl_load=no
export ac_cv_search_strerror=none required
I don't know if they are the minimum required set of variables. But I know they are sufficient to compile everything from scratch.

Please, note that most of the issues apply to the current CVS buildscripts.

Thanks a lot,
Paco

Re: buildscripts-20080624 bugs and fixes

Posted: Mon Nov 17, 2008 8:51 am
by WinterMute
paco wrote:Hi,

I've being trying to build devkitPro on Debian lenny for a few days and this is what I found:

1. Patch of binutils in dkppc is not against official GNU binutils 2.18.50 but against technology preview binutils-2.18.50-20080109-2 available on mingw page in sourceforge. Apparently the patch may easily be adapted to GNU binutils but then the code generated for ARM becomes half-broken. For example, default.arm7 will not forward IPC data to ARM9 (no touchscreen, no sound, ...). As a short term fix buildscripts should download binutils from the sourceforge site and not from GNU site.
incorrect, there is no official binutils 2.18.50, that archive is a snapshot release. Our binutils was *not* using the mingw technology preview but a snapshot downloaded around the same time. A new stable release is available ( 2.19 ) which will be used in the next set of releases.
2. buildscripts/dkpsp/scripts/build-crtls.sh and buildscripts/dkpsp/scripts/build-gcc.sh have some Control-M embedded at the end of some lines which happen to confuse the shell.
I'll take a look at that later, seems to be a hazard of working with CVS from windows machines unfortunately - I thought I'd got them all but some days it feels like playing whackamole ;)

3. After checking out pspsdk it should patch file pspsdk/src/libc/libcglue.c to fix the signature of gettimeofday. GCC 4.3.2 will refuse to compile a file with conflicting signatures by default. A simple fix which will also work when pspsdk gets fixed would be adding this after svn checkout:

Code: Select all

sed -i 's/gettimeofday(struct timeval \*tp, void \*tzp)/gettimeofday(struct timeval *tp, struct timezone *tzp)/g' pspsdk/src/libc/libcglue.c
We don't currently use 4.3.2 for devkitPSP however it's probably about time I looked at bringing it up to date.
4. devkitPSP uses newlib 1.15 and that version is distributed with an incorrect autoconf snippet that will abort compilation when makeinfo 4.10 or higher is found. A simple fix would be to provide a makeinfo wrapper like this:
A better fix would be to use newlib 1.16.0 really. Unfortunately devkitPSP has been left to rot a little due to very little feedback related to that toolchain.
5. I had to set some variables by hand because configure scripts of gcc try to guess how dynamic libraries work in your target even when cross-compiling:
What problems were you experiencing that were solved by this? It may be related to your binutils issues - some users were experiencing build failures due to one of the snapshots a while ago.
Please, note that most of the issues apply to the current CVS buildscripts.
If you're using CVS buildscripts then there's no guarantee that you can build the toolchains. We're currently heading towards several new releases & CVS is in a state of flux right now. Should hopefully be more to report on that by the end of the month.