compiling quake 3 linking errors


5 posts
by grubbymits » Sat May 26, 2012 9:50 am
Hi,

I'm trying to cross compile quake 3 on my ubuntu x86-64 laptop. I'm using the build.sh script in the quake3 directory, obtained from github, which I've modified to point the cross compiler prefix to this, (replacing path-to-tools with my path):

path-to-tools..../bcm2708hardfp-

All the files get compiled but then crashes out with several linking errors such as:

/opt/bcm-rootfs/opt/vc/lib/libvmcs_rpc_client.a(message_dispatch.c.o) uses VFP register arguments, build/release-linux-arm/ioquake3.arm does not

So what am I doing wrong for the compiler not to be using hard float?

Cheers
Posts: 2
Joined: Sat May 26, 2012 9:41 am
by dom » Sat May 26, 2012 11:26 am
Why are you using the hardfp compiler? Do you want to use it in a hardfp distribution?
If so, you need to link with the libs from that distribution.
Note: building with hardfp tools won't run on standard Debian image.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by grubbymits » Sun May 27, 2012 9:50 am
ok, thanks. using the other compiler worked fine
Posts: 2
Joined: Sat May 26, 2012 9:41 am
by kalehrl » Thu Aug 09, 2012 8:31 am
Hi
I'm trying to cross-compile Quake3 for hardfp but I get the following error:
Code: Select all
/home/kalehrl/Templates/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../lib/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/../../../../arm-bcm2708hardfp-linux-gnueabi/bin/ld: /home/kalehrl/Templates/raspi/firmware/hardfp/opt/vc/lib/libvchostif.a(vc_vchi_gencmd.c.o): undefined reference to symbol 'sem_post@@GLIBC_2.4'
/home/kalehrl/Templates/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../lib/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/../../../../arm-bcm2708hardfp-linux-gnueabi/bin/ld: note: 'sem_post@@GLIBC_2.4' is defined in DSO /home/kalehrl/Templates/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../arm-bcm2708hardfp-linux-gnueabi/sysroot/lib/libpthread.so.0 so try adding it to the linker command line
/home/kalehrl/Templates/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../arm-bcm2708hardfp-linux-gnueabi/sysroot/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [build/release-linux-arm/ioq3ded.arm] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/kalehrl/Templates/raspi/quake3'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/home/kalehrl/Templates/raspi/quake3'
make: *** [release] Error 2

By searching, I found the information to put -lpthread in LDFLAGS= but it doesn't make any difference.
Posts: 348
Joined: Tue Jul 24, 2012 10:49 am
by kalehrl » Thu Aug 09, 2012 10:09 am
I did 'make clean' followed by 'make distclean', added -lpthread to LDFLAGS= in build.sh and it compiled successfully. I didn't install this huge package libsdl1.2-dev because it was very big. The compiler would complain if it was required so I guess everything is fine. Too bad I'm still waiting for my R-Pi so I can't test it. :(
Posts: 348
Joined: Tue Jul 24, 2012 10:49 am