Solved

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

Posted on 2006-10-24
2
1,907 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
2 Comments
 
LVL 38

Accepted Solution

by:
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:
   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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now