making a sharedlib on amd64

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
chronologicaldot
Competition winner
Posts: 685
Joined: Mon Sep 10, 2012 8:51 am

making a sharedlib on amd64

Post by chronologicaldot »

I discovered today on amd64 architectures that make sharedlib for Irrlicht won't work without "-fPIC". See here for note: https://wiki.gentoo.org/wiki/Project:AM ... rors_Guide

To fix the problem: in the Makefile in "source/Irrlicht" I added "-fPIC" to line 100 (with the args for "sharedlib:"). However, the instructions for compiling change to:
$ make clean
$ make sharedlib
$ sudo make install

If you don't make clean, it'll give you an error.

For reference, the error is:
/usr/bin/ld: libpng/pngerror.o: relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: making a sharedlib on amd64

Post by CuteAlien »

Thanks. I've changed that (and a few more things) in svn trunk r6207.
Can't avoid the make clean whenever options are changed as we re-use the same .o files always. Should move them to different subfolders some day based on options.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply