Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-10-24
2
Medium Priority
?
1,992 Views
Last Modified: 2013-12-27
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
0
Comment
Question by:jpetter
[X]
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
2 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 2000 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:
   http://sunfreeware.com

   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:
   http://sunfreeware.com

   after you install all the tools, you need to set the ENV vars:
eg:
  PATH=/usr/local/bin:/usr/local/mysql/bin:$PATH
  export PATH
 
   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/gcc-lib
   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/glib
   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib
   export LD_LIBRARY_PATH

   before run configure.

   please read http:Q_21032633.html

   You can also follow the instructions in:
   http://ampubsvc.com/~meljr/a2m4p5s8.html

   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.

0
 

Author Comment

by:jpetter
ID: 17806756
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
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

719 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