Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I am developing an embedded device using arm platform and there I want to install a mad player in the target. for that I want to copile it in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11

    configure with static libs


    Hi,

    I am developing an embedded device using arm platform and there I want to install a mad player in the target. for that I want to copile it in my host with static libraries. I already tried using
    --enable-static --disable-shared
    options in the configuration command. Although the command generates static libs, the executable program still requires shared libs when I try command "arm-linux-readelf -d /location/madplay "

    what should I do in order to build the program completely static ?

    thank you.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,452
    Building the package's components to generate static libraries is one thing. Linking is another. Find the line in the Makefile(s) that create/link the executables and make sure you have added the -static and -static-libgcc options. You might be able to specify these linker options to the configure script (safer), but if not, then edit the appropriate Makefiles as indicated above.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11
    Hi,

    thanks for your answer. But still I have the same problem. After running config script, as you said I manually changed every Makefile as follow
    CC = /usr/local/arm_linux_4.2/bin/arm-linux-gcc -static -static-libgcc
    CPP = /usr/local/arm_linux_4.2/bin/arm-linux-gcc -static -static-libgcc -E

    and then ran make and make install commands. But still the executable program needs shared libs. what should I do?

    thank you.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,452
    Is there any Makefile variable LD defined something like this?

    LD = /usr/local/arm_linux_4.2/bin/arm-linux-ld

    If so, then add the -static -static-libgcc options to that.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11
    Hi Rubberman,

    I checked Makefiles but none of them contains a variable named LD or related to ld command. So I manually added
    LD = /usr/local/arm_linux_4.2/bin/arm-linux-ld -static -static-libgcc
    But the output had not changed.

    thank you.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,452
    The thing with the LD variable was just if they were using that instead of CC to build the executables. You can us the compiler to build executables, in which case the compiler will call the linker with the appropriate options, or you can use the linker directly. Some applications do it one way, and some do it the other way.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11
    Hi,

    thanks for your reply.But I am still struggling with the same problem. what are the next possible options?

    thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •