Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    Geany source installation error: “libc.so: file format not recognized; treating as linker script”

    10th August 2007

    Today I was looking for some simple but convenient source-code editor. I came across this post, and decided to try Geany. I’m using Slackware 11 at the moment, and as there were no packages available, I downloaded Geany source to compile and install.

    However, the ‘configure’ script failed. When trying to compile ‘conftest.c’ with gcc, the following error was produced:

    libc.so: file format not recognized; treating as linker script

    (Note 1: in the error above, I removed all the paths which were prepended to the actual error message.)
    (Note 2: I suspect that this error is the result of incomplete/failed/erroneous update of glibc slackware package I attempted a while ago. Will have to fix that more properly than described below.)

    Here’s the solution which helped me to install Geany successfully:

    1. login as root user, or su root
    2. uncompress the source with a command like tar zxvf geany-0.11.tar.gz
    3. use your favourite (text) editor to edit the /usr/lib/libc.so file – the one which generates error. In my case, this file was:

      /* GNU ld script
      Use the shared library, but some functions are only in
      the static library, so try that secondarily. */
      OUTPUT_FORMAT(elf32-i386)
      GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) )

      Using pico /usr/lib/libc.so, I commented out the ‘GROUP’ line, and added modified ‘GROUP’ line:

      /* GNU ld script
      Use the shared library, but some functions are only in
      the static library, so try that secondarily. */
      OUTPUT_FORMAT(elf32-i386)
      GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
      /* GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) */

    4. ./configure in the folder to which you extracted Geany sources. This time, the ‘configure’ script completed successfully.
    5. Now do make and then make install, and this is it.
    6. DO NOT FORGET to change the /usr/lib/libc.so file back to it’s original state!

    Geany screenshot

    I did manage to launch Geany after this installation (as seen on the screenshot above), though in console there are several repetitions of another error:

    GLib: Cannot convert message: Conversion from character set ‘UTF-8′ to ‘ISO-8859-1′ is not supported

    (geany:25543): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set ‘UTF-8′ to ‘ISO-8859-1′ is not supported

    The second line of those (that is “(geany:25543): Gdk…”) is repeated while Geany is running. If this bothers you, try launching Geany with geany > /dev/null 2> /dev/null & command (or, as suggested by Lukas in comments, use geany 2>&1 > /dev/null &).

    Share

    4 Responses to “Geany source installation error: “libc.so: file format not recognized; treating as linker script””

    1. Lukas Says:

      Thank you! That helped me out real good.
      Figured out how to solve it permanently?

      BTW. About that last part: ‘geany > /dev/null 2> /dev/null &’ could be changed to: ‘geany 2>&1 > /dev/null &’.

    2. Bogdan Says:

      Lukas,

      I decided to continue my Linux experience with Debian, which I find easier to maintain. So now I have no problems with “file format not recognized”… at least until I install anything manually, and I didn’t have such a need for quite a time now.

      Moreover, I’m now using Kate much more often then Geany – as I’m primarily writing scripts for interpreters, and not for compilators.

      Thanks for the output streams redirection hint! As I understood, you are “joining” stdout (numbered 1) and stderr (numbered 2) into a single “stream”, which is then sent to null, right?

    3. wolfssss Says:

      Thank you! It’s really very helpful.

    4. Bogdan Says:

      Personally, I’ve switched to Kate since then. Even though I’m using Gnome, I can’t help using KDE programs – Okular, Kate, Kwrite, Konsole – those are nearly perfect!

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>