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

Posted on 2006-10-24
Last Modified: 2013-12-27

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]: *** [] 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 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.

Question by:jpetter
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 38

Accepted Solution

yuzh earned 500 total points
ID: 17800649
For Solaris 9 you can download apache-2.X, php-5.X, mysql-5.x
openssl binary packages and other tools from:

   When you download the package, please read the download README file to make sure that you get all the dependencies as well.

If you still what to compile them from source, since you are using gcc, you need to
doneload automake, autoconfig, bison (and other package required by the PHP installation, check the php site for Solaris installation for more details). these GNU tools
are also available ffrom:

   after you install all the tools, you need to set the ENV vars:
  export PATH

   before run configure.

   please read http:Q_21032633.html

   You can also follow the instructions in:

   It is for Solaris 8, it can also apply to Solaris 9, please use the latest package instead
of the older version mentioned in the doc.


Author Comment

ID: 17806756

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,

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question