Compiling Blackbox


Alvin

Member
Joined
Mar 26, 2006
Messages
171
Alright, since I've taken a great interest in Orkie's X11 server, I'm trying to compile blackbox. Everything compiles fine after a few very minor tweaks (a few missing includes), however when make tries to link, I get the following errors:

Code:
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXext.so when searching for -lXext
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXext.a when searching for -lXext
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXext.so when searching for -lXext
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXext.a when searching for -lXext
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXft.so when searching for -lXft
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXft.a when searching for -lXft
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXft.so when searching for -lXft
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXft.a when searching for -lXft
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXrender.so when searching for -lXrender
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libXrender.a when searching for -lXrender
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXrender.so when searching for -lXrender
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libXrender.a when searching for -lXrender
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libz.so when searching for -lz
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libz.a when searching for -lz
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libz.so when searching for -lz
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libz.a when searching for -lz
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libfontconfig.so when searching for -lfontconfig
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libfontconfig.a when searching for -lfontconfig
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libfontconfig.so when searching for -lfontconfig
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libfontconfig.a when searching for -lfontconfig
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libexpat.so when searching for -lexpat
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev//lib/libexpat.a when searching for -lexpat
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libexpat.so when searching for -lexpat
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/local/gp2xdev/lib/libexpat.a when searching for -lexpat
/usr/local/gp2xdev/lib/libfreetype.so: could not read symbols: File in wrong format

Evidently, I'm on Linux using ooPo's toolchain and Parkydr's X11 libraries. I'd love to get this compiled and running on the GP2X. Any idea what'll fix this problem?
 
Well judging from the path to the ld executable you're using a linker for x86 binaries. You'll need to use the linker provided by the cross compilation tool chain.

I think setting the environment variable LD to the correct ld executable should fix it, e.g. something like:

Code:
export LD=gp2x-ld

There might be a more appropriate way to do this like an argument to the configure script.
Just try setting the correct ld everywhere you can, rerun everything and see what it gets you :).
 
Woo, it's getting there. I fixed a few more build problems, but this one has me stuck:

Code:
/usr/local/gp2xdev/lib/gcc/gp2x/4.0.2/../../../../gp2x/bin/ld: warning: libXext.so.6, needed by /usr/local/gp2xdev/lib/libXft.so, not found (try using -rpath or -rpath-link)
/usr/local/gp2xdev/lib/libXrender.so: undefined reference to `XextAddDisplay'
/usr/local/gp2xdev/lib/libXrender.so: undefined reference to `XextFindDisplay'
/usr/local/gp2xdev/lib/libXrender.so: undefined reference to `XextRemoveDisplay'
/usr/local/gp2xdev/lib/libXrender.so: undefined reference to `XMissingExtension'

The weird thing is, libXext.so.6 is in /usr/local/gp2xdev/lib .

edit: Oh yeah, I get this before the above errors:

Code:
gp2x-g++: unrecognized option '-rpath,/usr/local/gp2xdev/lib'
I've never used -rpath before, so I'm unsure what's going wrong.
 
The "rpath" is a linker options so try "-Xlinker -rpath /usr/local/gp2xdev/lib" The g++ is stripping it because it does not understand the switch option but it needs to be used by the linker. The -Xlinker passes it though to the linker without processing by g++. I am unsure if the parameter to -Xlinker needs to be quoted since it is two fields.
 
I've never used -rpath before but quick look in the man pages suggested that it should be passed like this

Code:
-Xlinker -rpath -Xlinker  /usr/local/gp2xdev/lib

You can only pass one argument per -Xlinker option or it will be passed as a single argument as if it had been quoted, which seems to have happened judging by g++'s output.

Man pages are great ;)
Info pages also deserves a mention ;)

Also is there any special reason you use -rpath over -L or LD_PATH?
 
Back
Top