Thanks for the feedback!
hmn said:
I see three problems here:
1) The old openwiz toolchain produces binaries that are not compatible with the Wiz!
I'm confused; why would a Wiz toolchain not produce Wiz binaries? Or are you referring to a dynamic linked library incompatibility rather than a binary-level incompatibility?
The openwiz011909.tar.gz toolchain from openhandhelds.org produces binaries in FPA format, while all the Wiz runtime libs as well as Ikari's SDL libs are in VFP format.
Is torpor's package based on the openwiz011909.tar.gz toolchain? For some reason I can get working binaries (including GPFCE) using the former, but I was not successful with the latter.
2) You are mixing up native and host systems in your cross-compiling environment:
HunterZ said:
Compiling with the official SDK looks to be a bit more complicated than openwiz because they decided to put some stuff in the /opt/toolchain-wiz tree (like the Linux ARM gcc) and some in a separate /opt/toolchain-wiz/arm-linux tree (most of the libs).
That is exactly how it is supposed to be. Notice how the stuff that runs on the PC (compiler) is separated from the stuff that is supposed to run on the Wiz (libraries).
Unfortunately it doesn't appear to be that logical: Torpor's openwiz toolchain has some "standard" GCC libs in one place, and stuff like SDL, libpng and zlib in the other, while the official GPH Wiz toolchain puts them all in one place. See below for gory details.
HunterZ said:
[...] ./configure --prefix=/opt/arm-openwiz-linux-gnu [...]
With this you are installing SDL into the root of the toolchain, which is wrong, as that is where the natives stuff lives. You should install libraries into another directory, not the toolchain directory. This way you cannot mess up your toolchain. Also, you never need to set include/linker paths into the toolchain directory, because the compiler has them built in already. This way you only need to need to point to your libraries, which also means you can use different toolchains without too much trouble (as long as they are compatible).
My understanding is that the binaries are all native (but in support of cross-compiling) and that the libraries are all meant to run on the Wiz, so there should be nothing to separate. Torpor's openwiz toolchain does seem to separate some includes/libs, while the official GPH Wiz toolchain lumps everything together:
In torpor's openwiz toolchain package, arm-openwiz-linux-gnu- prefixed cross-compiler binaries and sdl-config are in /opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/, and exact non-prefixed copies are in /opt/openwiz/toolchain/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/bin/
In terms of includes and libraries, the standard GCC stuff seems to be under /opt/openwiz/toolchain/arm-openwiz-linux-gnu/arm-openwiz-linux-gnu/:
Code:
ld-2.6.1.so libc-2.6.1.so libgcc_s.so.1 libiberty.a libmudflap.so.0 libnsl-2.6.1.so libnss_files.so.2 libpcprofile.so libSegFault.so libssp.so.0.0.0 libsupc++.a
ld-linux.so.2 libcrypt-2.6.1.so libgomp.a libm-2.6.1.so libmudflap.so.0.0.0 libnsl.so.1 libnss_hesiod-2.6.1.so libpthread-2.6.1.so libssp.a libstdc++.a libsupc++.la
ldscripts libcrypt.so.1 libgomp.la libmemusage.so libmudflapth.a libnss_compat-2.6.1.so libnss_hesiod.so.2 libpthread.so.0 libssp.la libstdc++.la libthread_db-1.0.so
libanl-2.6.1.so libc.so.6 libgomp.so libm.so.6 libmudflapth.la libnss_compat.so.2 libnss_nis-2.6.1.so libresolv-2.6.1.so libssp_nonshared.a libstdc++_pic.a libthread_db.so.1
libanl.so.1 libdl-2.6.1.so libgomp.so.1 libmudflap.a libmudflapth.so libnss_dns-2.6.1.so libnss_nisplus-2.6.1.so libresolv.so.2 libssp_nonshared.la libstdc++.so libutil-2.6.1.so
libBrokenLocale-2.6.1.so libdl.so.2 libgomp.so.1.0.0 libmudflap.la libmudflapth.so.0 libnss_dns.so.2 libnss_nisplus.so.2 librt-2.6.1.so libssp.so libstdc++.so.6 libutil.so.1
libBrokenLocale.so.1 libgcc_s.so libgomp.spec libmudflap.so libmudflapth.so.0.0.0 libnss_files-2.6.1.so libnss_nis.so.2 librt.so.1 libssp.so.0 libstdc++.so.6.0.9
...and the nonstandard stuff (SDL etc.) is under /opt/openwiz/toolchain/arm-openwiz-linux-gnu/:
Code:
ben@shodan:~/Downloads/wiz/powder114_src/port/gp2x/Powder2X$ ls /opt/openwiz/toolchain/arm-openwiz-linux-gnu/lib
gcc libFLAC++.a libhistory.so.5.2 libmad.a libmpeg2.so libreadline.so libSDL_mixer.a libungif.a libvorbis.la
imlib2 libFLAC.la libiberty.a libmad.la libmpeg2.so.0 libreadline.so.5 libSDL_mixer.la libungif.la libvorbis.so
libarm-openwiz-linux-gnu-sim.a libFLAC++.la libiconv.a libmad.so libmpeg2.so.0.1.0 libreadline.so.5.2 libSDL_mixer.so libungif.so libvorbis.so.0
libbz2.a libFLAC.so libiconv.la libmad.so.0 libncurses.a libSDL-1.2.so.0 libSDL.so libungif.so.4 libvorbis.so.0.4.0
libcastor.a libFLAC++.so libiconv.so libmad.so.0.2.1 libncurses++.a libSDL-1.2.so.0.11.2 libSDL_svg-1.1.so.8 libungif.so.4.1.6 libxml2.a
libcastor_extra.a libFLAC++.so.6 libiconv.so.2 libmenu.a libncurses_g.a libSDL.a libSDL_svg-1.1.so.8.0.1 libunicodefont.a libxml2.la
libcastor_extra.so.0.1 libFLAC++.so.6.2.0 libiconv.so.2.4.0 libmenu_g.a libogg.a libSDL_gfx.a libSDL_svg.a libunicodefont.so libxml2.so
libcastor.so.0.1 libFLAC.so.8 libid3tag.a libmikmod.a libogg.la libSDL_gfx.la libSDL_svg.la libunicodefont.so.1.0.1 libxml2.so.2
libcharset.a libFLAC.so.8.2.0 libid3tag.la libmikmod.la libogg.so libSDL_gfx.so libSDL_svg.so libvorbis.a libxml2.so.2.7.2
libcharset.la libform.a libid3tag.so libmikmod.so libogg.so.0 libSDL_gfx.so.0 libSDL_ttf-2.0.so.0 libvorbisenc.a libz.a
libcharset.so libform_g.a libid3tag.so.0 libmikmod.so.2 libogg.so.0.5.3 libSDL_gfx.so.0.0.17 libSDL_ttf-2.0.so.0.6.3 libvorbisenc.la libz.so
libcharset.so.1 libfreetype.a libid3tag.so.0.3.0 libmikmod.so.2.0.4 libpanel.a libSDL_image-1.2.so.0 libSDL_ttf.a libvorbisenc.so libz.so.1
libcharset.so.1.0.0 libfreetype.la libImlib2.a libmpcdec.a libpanel_g.a libSDL_image-1.2.so.0.1.6 libSDL_ttf.la libvorbisenc.so.2 libz.so.1.2.3
libexpat.a libfreetype.so libImlib2.la libmpcdec.la libpng12.a libSDL_image.a libSDL_ttf.so libvorbisenc.so.2.0.3 pkgconfig
libexpat.la libfreetype.so.6 libImlib2.so libmpcdec.so libpng12.la libSDL_image.la libtiff.a libvorbisfile.a preloadable_libiconv.so
libexpat.so libfreetype.so.6.3.18 libImlib2.so.1 libmpcdec.so.5 libpng12.so libSDL_image.so libtiff.la libvorbisfile.la xml2Conf.sh
libexpat.so.1 libgif.a libImlib2.so.1.4.2 libmpcdec.so.5.0.2 libpng12.so.0 libSDL_inifile.a libtiff.so libvorbisfile.so
libexpat.so.1.5.2 libgif.la libjpeg.a libmpeg2.a libpng12.so.0.33.0 libSDL_inifile.so libtiff.so.3 libvorbisfile.so.3
libfaad.a libgif.so libjpeg.la libmpeg2convert.a libpng.a libSDL_inifile.so.1 libtiff.so.3.8.2 libvorbisfile.so.3.2.0
libfaad.la libgif.so.4 libjpeg.so libmpeg2convert.la libpng.la libSDL_inifile.so.1.0.0 libtiffxx.a libvorbisidec.a
libfaad.so libgif.so.4.1.6 libjpeg.so.62 libmpeg2convert.so libpng.so libSDL.la libtiffxx.la libvorbisidec.la
libfaad.so.0 libhistory.a libjpeg.so.62.0.0 libmpeg2convert.so.0 libpng.so.3 libSDLmain.a libtiffxx.so libvorbisidec.so
libfaad.so.0.0.0 libhistory.so libjpeg.so.7 libmpeg2convert.so.0.0.0 libpng.so.3.33.0 libSDL_mixer-1.2.so.0 libtiffxx.so.3 libvorbisidec.so.1
libFLAC.a libhistory.so.5 libjpeg.so.7.0.0 libmpeg2.la libreadline.a libSDL_mixer-1.2.so.0.2.6 libtiffxx.so.3.8.2 libvorbisidec.so.1.0.2
My guess is that this was done because torpor added the nonstandard libs to the base toolchain and wanted to keep them separate to make it easier to incorporate external updates to either the base toolchain and/or the nonstandard libs without munging things.
I should also mention that the official GPH Wiz toolchain is similar, with arm-linux- prefixed cross-compiler binaries under /opt/toolchain-wiz/bin/ and exact non-prefixed copies are under /opt/toolchain-wiz/arm-linux/bin/. The big difference here is that GPH put sdl-config, the standard GCC libs *and* the nonstandard libs all under /opt/toolchain-wiz/arm-linux/:
Code:
crt1.o libc.so libgcc_s.so.1 libm.so.6 libnss_nisplus.so librt-2.3.6.so libthread_db-1.0.so libXaw.so.7.0.0 libXfixes.so.0.2.0 libXmuu.so.0.1.0
crti.o libc.so.6 libiberty.a libmudflap.a libnss_nisplus.so.2 librt.a libthread_db.so libXcalibrate.a libXfont.a libXpm.a
crtn.o libc.so_orig libICE.a libmudflap.dir libnss_nis.so librt.so libthread_db.so.1 libXcalibrate.la libXfont.la libXpm.la
gconv libdl-2.3.6.so libICE.la libmudflap.la libnss_nis.so.2 librt.so.1 libts-0.0.so.0 libXcalibrate.so libXfont.so libXpm.so
gcrt1.o libdl.a libICE.so libmudflap.so libogg.a libSDL-1.2.so.0 libts-0.0.so.0.1.1 libXcalibrate.so.0 libXfont.so.1 libXpm.so.4
ld-2.3.6.so libdl.so libICE.so.6 libmudflap.so.0 libogg.la libSDL-1.2.so.0.11.1 libts.la libXcalibrate.so.0.0.0 libXfont.so.1.4.1 libXpm.so.4.5.0
ld-linux.so.2 libdl.so.2 libICE.so.6.3.1 libmudflap.so.0.0.0 libogg.so libSDL_gfx.a libts.so libXcomposite.a libXft.a libXrandr.a
ldscripts libexpat.a libid3tag.a libmudflapth.a libogg.so.0 libSDL_gfx.la libutil-2.3.6.so libXcomposite.la libXft.la libXrandr.la
libanl-2.3.6.so libexpat.la libid3tag.la libmudflapth.la libogg.so.0.5.3 libSDL_image-1.2.so.0 libutil.a libXcomposite.so libXft.so libXrandr.so
libanl.a libexpat.so libid3tag.so libmudflapth.so libpcprofile.so libSDL_image-1.2.so.0.1.5 libutil.so libXcomposite.so.1 libXft.so.2 libXrandr.so.2
libanl.so libexpat.so.0 libid3tag.so.0 libmudflapth.so.0 libpng12.a libSDL_image.a libutil.so.1 libXcomposite.so.1.1.0 libXft.so.2.1.2 libXrandr.so.2.0.1
libanl.so.1 libexpat.so.0.5.0 libid3tag.so.0.3.0 libmudflapth.so.0.0.0 libpng12.la libSDL_image.la libvorbisidec.a libXdamage.a libXinerama.a libXrender.a
libBrokenLocale-2.3.6.so libfontcache.a libieee.a libnsl-2.3.6.so libpng12.so libSDL_image.so libvorbisidec.la libXdamage.la libXinerama.la libXrender.la
libBrokenLocale.a libfontcache.la libjpeg.a libnsl.a libpng12.so.0 libSDL.la libvorbisidec.so libXdamage.so libXinerama.so libXrender.so
libBrokenLocale.so libfontcache.so libjpeg.la libnsl.so libpng12.so.0.0.0 libSDLmain.a libvorbisidec.so.1 libXdamage.so.0 libXinerama.so.1 libXrender.so.1
libBrokenLocale.so.1 libfontcache.so.0 libjpeg.so libnsl.so.1 libpng.a libSDL.so libvorbisidec.so.1.0.2 libXdamage.so.0.1.0 libXinerama.so.1.0.1 libXrender.so.1.3.0
libbsd-compat.a libfontcache.so.0.0.0 libjpeg.so.62 libnss_compat-2.3.6.so libpng.la libSegFault.so libX11.a libXdmcp.a libxkbfile.a libXt.a
libc-2.3.6.so libfontconfig.a libjpeg.so.62.0.0 libnss_compat.so libpng.so libSM.a libX11.la libXdmcp.la libxkbfile.la libXt.la
libc.a libfontconfig.la liblzo2.a libnss_compat.so.2 libpng.so.3 libSM.la libX11.so libXdmcp.so libxkbfile.so libXt.so
libcastor.a libfontconfig.so liblzo2.la libnss_dns-2.3.6.so libpng.so.3.0.0 libSM.so libX11.so.6 libXdmcp.so.6 libxkbfile.so.1 libXt.so.6
libcastor_extra.a libfontconfig.so.1 libm-2.3.6.so libnss_dns.so libpthread-0.10.so libSM.so.6 libX11.so.6.2.1 libXdmcp.so.6.0.0 libxkbfile.so.1.0.1 libXt.so.6.0.1
libcastor_extra.so libfontconfig.so.1.0.4 libm.a libnss_dns.so.2 libpthread.a libSM.so.6.0.1 libXau.a libXext.a libXmu.a libz.so
libcastor_extra.so.0.1 libfreetype.a libmad.a libnss_files-2.3.6.so libpthread_nonshared.a libstdc++.a libXau.la libXext.la libXmu.la libz.so.1
libcastor.so libfreetype.la libmad.la libnss_files.so libpthread.so libstdc++.dir libXau.so libXext.so libXmu.so libz.so.1.2.2
libcastor.so.0.1 libfreetype.so libmad.so libnss_files.so.2 libpthread.so.0 libstdc++.la libXau.so.6 libXext.so.6 libXmu.so.6 Mcrt1.o
libc_nonshared.a libfreetype.so.6 libmad.so.0 libnss_hesiod-2.3.6.so libpthread.so_orig libstdc++.so libXau.so.6.0.0 libXext.so.6.4.1 libXmu.so.6.2.1 pkgconfig
libcrypt-2.3.6.so libfreetype.so.6.3.8 libmad.so.0.2.1 libnss_hesiod.so libresolv-2.3.6.so libstdc++.so.6 libXaw.a libXfixes.a libXmuu.a Scrt1.o
libcrypt.a libg.a libmcheck.a libnss_hesiod.so.2 libresolv.a libstdc++.so.6.0.6 libXaw.la libXfixes.la libXmuu.la ts
libcrypt.so libgcc_s.dir libmemusage.so libnss_nis-2.3.6.so libresolv.so libsupc++.a libXaw.so libXfixes.so libXmuu.so X11
libcrypt.so.1 libgcc_s.so libm.so libnss_nisplus-2.3.6.so libresolv.so.2 libsupc++.la libXaw.so.7 libXfixes.so.0 libXmuu.so.0 Xli
3) You are mixing different toolchains:
HunterZ said:
Update 2: gpfce gives an odd error when I try to compile with the official Wiz toolchain:
Code:
/opt/toolchain-wiz/bin/../lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld: ERROR: drivers/gp2x/asmutils.o uses FPA instructions, whereas fceu does not/opt/toolchain-wiz/bin/../lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld: failed to merge target specific data of file drivers/gp2x/asmutils.o
You probably did not clean up the build after switching toolchains. This looks like
drivers/gp2x/asmutils.o was compiled with the old openwiz toolchain while your are linking using the GPH toolchain.
I wondered if that was the case when I first saw it as well, so I explicitly checked that that .o was deleted before one of my compile attempts. It was definitely built with the official GPH Wiz toolchain, yet it still gave me that error. Either the official Wiz toolchain's assembler is broken, or the assembly source itself is incompatible with the toolchain, or I'm screwing it up some other way. If you can get GPFCE to compile and run using the
stock GPH Wiz toolchain (plus libcastor), I'd be curious to see a tarball of your source and the commands you used.
The upside of using the official toolchain is that you can dynamically link and have it use the libs on the NAND. The downside is that the compiler and libs are much, much older than the openwiz ones, and they don't seem to be able to build some stuff like GPFCE. On the whole, it seems better to me to use the openwiz toolchain and statically link when possible, as the result is likely to be better optimized and less error-prone.