Subject Compling from source.
Author

Hi all,

maybe it's because I'm a bit of a masochist, I like compiling systems from source whenever possible.

I had an initial blip due to the tommath library being missing - no probs. - installed that.

Now, I'm getting a problem that I can't figure out.

When the compile hits the step below, I'm in above my pay grade <gulp...>.

If you are able and kind enough to answer, please bear in mind that I'm not an expert in this area, so baby steps are de rigeur! :-)


I ran:

./configure --prefix=/home/pol/Downloads/sw/db/fb/inst

make
..
..
lots of stuff...
..
..

Then I hit this command:

g++  -std=gnu++03 -Wl,--version-script,firebird.vers  -pthread -shared   -Wl,-soname,libfbclient.so.2 -Wl,-rpath,/lib -o /home/pol/Downloads/sw/db/fb/gen/Release/firebird/lib/libfbclient.so.3.0.4 /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/MasterImplementation.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/alt.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/why.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/preparse.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/user_dsql.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/gds.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/PluginManager.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/keywords.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/perf.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/utl.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/DistributedTransaction.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/blob.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/array.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/config/os/posix/config_root.o /home/pol/Downloads/sw/db/fb/temp/Release/yvalve/config/os/posix/binreloc.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/remote.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/protocol.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/merge.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/inet.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/parser.o /home/pol/Downloads/sw/db/fb/temp/Release/auth/SecureRemotePassword/srp.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/client/interface.o /home/pol/Downloads/sw/db/fb/temp/Release/remote/client/BlrFromMessage.o /home/pol/Downloads/sw/db/fb/temp/Release/auth/SecureRemotePassword/client/SrpClient.o /home/pol/Downloads/sw/db/fb/temp/Release/auth/SecurityDatabase/LegacyClient.o /home/pol/Downloads/sw/db/fb/temp/Release/plugins/crypt/arc4/Arc4.o /home/pol/Downloads/sw/db/fb/temp/Release/common.a -L/home/pol/Downloads/sw/db/fb/gen/Release/firebird/lib  -lm -ldl   -lcurses -ltommath

(phew...), but that's where the fun begins - I hit an error!

/usr/bin/ld: //usr/local/lib/libtommath.a(bn_mp_read_radix.o): relocation R_X86_64_32S against symbol `mp_s_rmap_reverse' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libtommath.a(bn_s_mp_exptmod.o): relocation R_X86_64_32 against symbol `mp_reduce' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libtommath.a(bn_s_mp_exptmod_fast.o): relocation R_X86_64_32 against symbol `mp_reduce_2k' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:305: /home/pol/Downloads/sw/db/fb/gen/Release/firebird/lib/libfbclient.so.3.0.4] Error 1
make[3]: Leaving directory '/home/pol/Downloads/sw/db/fb/gen'
make[2]: *** [Makefile:180: master_process] Error 2
make[2]: Leaving directory '/home/pol/Downloads/sw/db/fb/gen'
make[1]: *** [Makefile:66: firebird] Error 2
make[1]: Leaving directory '/home/pol/Downloads/sw/db/fb/gen'
make: *** [Makefile:6: firebird] Error 2
[pol@UNKNOWN fb]$

OK - it *_seems_* to be telling me to recompile with -fPIC?

Now, I did notice many of the previous steps looked something like this:

g++ -I/home/pol/Downloads/sw/db/fb/src/include/gen -I/home/pol/Downloads/sw/db/fb/src/include  -ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0 -fno-delete-null-pointer-checks -O3 -fno-omit-frame-pointer -pthread -fno-rtti -std=gnu++03  -c /home/pol/Downloads/sw/db/fb/src/plugins/crypt/arc4/Arc4.cpp -o /home/pol/Downloads/sw/db/fb/temp/Release/plugins/crypt/arc4/Arc4.o

The -fPIC flag is all present and accounted for in those previous commands.

So, my question basically boils down to two parts

a) is it the missing -fPIC that is causing the problem?

b) if so, how do I add it into the mix? Please give me the actual command I need to run (think monkey-see, monkey-do!) rather than just

As an aside, how come others haven't run into this problem?

I would be grateful for any and all help that can be provided. I would also be interested in any explanations as to why this is happening to me in particular (libraries... whatnot...) and any references URLs &c. on compiling large projects - but the key thing I'd like to do is get my server up and running.

TIA and rgs,

Pól...