Solved Using the right libraries with gcc4.8

Hello everybody,

I've been having a hard time understanding how the compilers work. Here is my problem:

I got a software that I have to build from source and that was designed for Linux.

Problem is: it will only compile with gcc and not clang.

After configuring the environmental variables with ./configure , I edited /etc/libmap.conf to map libgcc_s.so.1 from clang with the one from gcc48. As the Makefile was written for Linux, it is configured to use CC and the libraries from /lib/*

Then, I ran: gmake CC=gcc48

However, I don't think that messing with /etc/libmap.conf is a good idea as it only concerns one program. What is the other option?

Ps: I tried adding LIBS += -L/usr/local/lib/gcc48 somewhere in the Makefile. But it didn't work.

Thank you very much

Ps: I'm running FreeBSD 10.2 stable (built 4 days ago) + custom kernel.
 
Thanks for the reply. Unfortunately, I'm just trying to get confortable with FreeBSD before going deep into porting software. What I'm compiling is really too complicated (too many Makefiles, compiler options, links etc...) for me at the moment.

Also, I should've read the manual more carefully (libmap.conf(5)): There is a constraint that can be specified in /etc/libmap.conf so that this mapping would only be considered when using this particular software.

I just added to /etc/libmap.conf:
Code:
#/etc/libmap.conf
[/<absolute path to main directory of the sotware>/]
libgcc_s.so.1     gcc48/libgcc_s.so.1
 
You probably need to set these variables:
Code:
CFLAGS+= -Wl,-rpath=/usr/local/lib/gcc48 
CXXFLAGS+= -Wl,-rpath=/usr/local/lib/gcc48  
LDFLAGS+= -Wl,-rpath=/usr/local/lib/gcc48  -L/usr/local/lib/gcc48
 
Back
Top