Menu

Error building _mysql on sparc Solaris 8

Help
Anonymous
2001-11-13
2012-09-19
  • Anonymous

    Anonymous - 2001-11-13

    Hello,

    I cannot get the "setup.py build" to run properly.

    I have used the "setup.py" Andy Dustman has passed to Tom Scrivner (thread: "Installation problems Solaris 2.7"), I still have problems:

    ld: fatal: library -lmysqlclient: not found
    ld: fatal: File processing errors. No output written to build/lib.s
    n4u-2.1/_mysql.so
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    This means it doesn't find the library.
    Is this the file "libmysqlclient.a" under "/usr/local/mysql/lib"?

    If yes, should I change the path in the gcc command?

    Thank you for help!

      Serge

     
    • Anonymous

      Anonymous - 2001-11-13

      Some precisions:

      I have found the error for the library path (setup.py had "library_dirs = ['/usr/local/mysql/lib/mysql']" instead of "library_dirs = ['/usr/local/mysql/lib']"

      OK, but it still doesn't work, I get a bunch of <unknown> lines and it ends with the following message:

      <unknown>                           0x9d8       /usr/local/mysql/lib/libmysqlcli
      ent.a(default.o)
      ld: fatal: relocations remain against allocatable but non-writable sections
      collect2: ld returned 1 exit status
      error: command 'gcc' failed with exit status 1

      What does that mean?

      Any help would be welcomed!

         Serge

       
      • Anonymous

        Anonymous - 2001-11-20

        There is a problem with gcc and the solaris linker
        to solve your problem you have to do the following:

        python setup.py install > compile.log 2>&1

        At the end of the file look for the gcc command used for example:

        gcc -shared build/temp.solaris-2.8-sun4u-2.1/_mysql.o -L/usr/local/mysql/lib -R/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient -lz -o build/lib.solaris-2.8-sun4u-2.1/_mysql.so

        To see what happend exactly you have to send the above command whith a -v like this

        gcc -v -shared build/temp.solaris-2.8-sun4u-2.1/_mysql.o -L/usr/local/mysql/lib -R/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient -lz -o build/lib.solaris-2.8-sun4u-2.1/_mysql.so > compile2 2>&1

        In the file compile2 you will have a result like this one

        Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/specs
        gcc version 2.95.2 19991024 (release)
        /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/collect2 -V -G -dy -z text -R/usr/local/zlib-1.1.3:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -Y P,/usr/ccs/lib:/usr/lib -Qy -o build/lib.solaris-2.8-sun4u-2.1/_mysql.so /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crtbegin.o -L/usr/local/mysql/lib -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib build/temp.solaris-2.8-sun4u-2.1/_mysql.o -lmysqlclient -lgcc -lgcc /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crtn.o

        On the third line you have to remove the "-z text" option and save your file.

        After that you can do:

        sh compile2

        This will execute the command above and execute the link correctly

        After that you can reexecute:

        python setup.py install

        After that everything should be OK

        G. Casellini

         
        • Tim A Kyle

          Tim A Kyle - 2001-11-23

          Thanks, this worked fine! Can this be included in the FAQ / Patches?

          Tim

           
        • Anonymous

          Anonymous - 2002-03-06

          I had a similar problem on Solaris 7 and gcc 2.95.2.  I found that the linker portion of the "specs" file didn't have any options tied to collect2.

          My output to the compile2.log file looked like this:

          Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
          gcc version 2.95.2 19991024 (release)

          So I manually ran collect2 with your compile2 output like this:

          /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/collect2 -V -G -dy -R:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -Y P,/usr/ccs/lib:/usr/lib -Qy -o build/lib.solaris-2.7-sun4u-2.2/_mysql.so /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crtbegin.o -L/usr/local/mysql/lib -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib build/temp.solaris-2.7-sun4u-2.2/_mysql.o -lmysqlclient -lgcc -lgcc /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crtn.o

          then su'd to run 'python setup.py install'

          Worked like a champ.  Thanks for posting your info.

          E. Bambock

           
    • Tim A Kyle

      Tim A Kyle - 2001-11-13

      This seems to be a pb on Solaris 7 & 8. It would be good to find a solution to this. I have not yet found one.

      Tim

       
    • Roderick Padilla

      Hi there! ..

      I am getting the same error but in the build phase.

      gcc -shared build/temp.solaris-2.8-sun4u-2.1/_mysql.o -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql/lib -R/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient_r -lz -o build/lib.solaris-2.8-sun4u-2.1/_mysql.so

      ld: fatal: relocations remain against allocatable but non-writable sections
      collect2: ls returned 1 exit status
      error: command 'gcc' failed with exit status 1

      How do I fix the "gcc link" issue in the build phase?

      Python 2.1.1/GCC 2.95.1/Mysql 3.23.49

      Thanks in advance!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.