Link to home
Start Free TrialLog in
Avatar of jpetter
jpetter

asked on

Problems Compiling Program: "ld:fatal:relocations remain against allocatable but non-writable sections"

Hi,

I have been, and still am, having some issues trying to compile a program. My end-game plan is to port a solution in Apache, PHP, and RRDtool, that is currently working in an Intel - Linux environment over to a SPARC Solaris v9 64 bit environment.

First my problem, then I'll provide some background. I received this error while running 'make' during the build process for RRDtool:
memcpy                              0x1ff8      /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../libz.a(inflate.o)
memcpy                              0x2010      /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../libz.a(inflate.o)
memcpy                              0x245c      /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../libz.a(inflate.o)
memcpy                              0x24d0      /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../libz.a(inflate.o)
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
make[2]: *** [librrd.la] Error 1
make[2]: Leaving directory `/usr/local/src/rrdtool-1.2.15/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/rrdtool-1.2.15'
make: *** [all] Error 2

...except on my screen, the lines above the fatal error were a few hundred in length. In each one, the path starting with /usr/local/lib, and ending with /libz.a(, was the same - only the file listed in parenthesis changed. I have seen this before a couple of times trying to compile code on this Solaris, but was able to get around it by installing the binary from http://www.sunfreeware.com. For this package however, this is not an option. My problems (well, my initial ones anyways) I don't know how to begin troubleshooting this error, oh, and this is my first experience compiling on a Solaris. I'm sure there are other issues, but until I get by this I won't be able to see the others.

Now for a little background. I knew I needed the freetype2 library, so I got the source and compiled it, and everything went fine, installing in the /usr/local/include and /usr/local/lib branches. When I ran configure, I received a warning stating that it couldn't find any freetype2 libraries in /usr/include, so it assumed I was installing without them. Since that wasn't what I wanted, I tried to modify LDFLAGS and CPPFLAGS to pass with configure. I must have had the syntax wrong as I received the same warning the next time. No matter how I modifed the way I was setting those variables in configure, I received the same warning. So, desperate, I coped the freetype2 files from /usr/local/include to /usr/include. This time, I did not receive the warning about freetype, but did reveive an error b/c it could not find libart. I then installed libart, letting it go to the default location of /usr/local. Now the same warning again, but this time it could not find libart in /usr/include, and /usr/lib. Knowing I could not solve this with setting flags in configure, I again copied the files from /usr/local to /usr. Now compile ran fine, but make produced the error mentioned above.

That is my current tale of woe. If anyone could provide me with any assistance, I would greatly appreciate it.

Thanks,
Jeff
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jpetter
jpetter

ASKER

yuzh,

Thanks for all the great information. I worked through the instructions found at the link you recommended, and they were great. My compile/build environment wasn't even close to having the requisite packages installed, but that document walked me through setting it up.

I haven't had a chance yet to try to build the package that initially prompted me to ask this question. However, the info here has allowed me to straighten my system out, and that to me is worth at least the points right there. I'll close this out, and if I still have problems tomorrow with building the latest rrdtool, I'll enter another question.

Many thanks again,
Jeff