Skip to contentSkip to conversation

Static versus shared builds of alsa-utils

DISCUSSION Adrian McMenamin 3 participants 7 messages Aug 31, 2003 – Sep 2, 2003

lore
Share & tools
lore
#0 lore raw

I am trying to build alsa-utils using a cross compiler.

AFAICS I have successfully built alsalib (as static as I have no glibc on the target system - it runs a static busybox), and I thought I had successfully configured and built alsa-tools:

CC=sh-linux-gcc ./configure --host=sh-linux --prefix=/home/Adrian/dc-down/initrd/usr --with-alsa-prefix=/home/Adrian/dc-down/initrd/usr/lib --with-alsa-inc-prefix=/home/Adrian/dc-down/initrd/usr/include --disable-alsamixer --disable-shared

This certainly generates large (static?) binaries:

/usr/bin # ls a* -l

-rwxr-xr-x    1 0        0         2436157 Aug 31 19:26 aconnect
-rwxr-xr-x    1 0        0         2362584 Aug 31 11:58 alsalisp
-rwxr-xr-x    1 0        0         2458748 Aug 31 19:26 amixer
-rwxr-xr-x    1 0        0         2294664 Aug 31 19:26 aplay
lrwxrwxrwx    1 500      500            17 Apr  8 21:06 ar -> 
../../bin/busybox
lrwxrwxrwx    1 0        0               5 Aug 31 19:26 arecord -> aplay
-rwxr-xr-x    1 0        0         2470212 Aug 31 19:26 aseqnet
-rwxr-xr-x    1 0        0         2282674 Aug 31 11:58 aserver

But when I attempt to run any of them I get this problem:

/usr/bin # ./aplay test.txt
./aplay: No such file or directory

What have I done wrong?

Adrian

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 8 lines · Adrian McMenamin

[...]
This certainly generates large (static?) binaries:
-rwxr-xr-x 1 0 0 2294664 Aug 31 19:26 aplay

But when I attempt to run any of them I get this problem:

/usr/bin # ./aplay test.txt
./aplay: No such file or directory

This error message usually indicates that the executable uses a dynamic linker which isn't available.

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

HTH
Clemens

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#2 lore raw
Quoted 7 lines · Clemens Ladisch
Quoted 6 lines · Adrian McMenamin

[...]
This certainly generates large (static?) binaries:
-rwxr-xr-x 1 0 0 2294664 Aug 31 19:26 aplay

But when I attempt to run any of them I get this problem:

Quoted 10 lines
Quoted 2 lines

/usr/bin # ./aplay test.txt
./aplay: No such file or directory

This error message usually indicates that the executable uses a dynamic linker which isn't available.

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

Exactly, but how?

Adrian

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#3 lore raw
Quoted 4 lines · Adrian McMenamin
Quoted 2 lines

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

Exactly, but how?

CC=sh-linux-gcc CFLAGS=--static ./configure --xxx=...

HTH
Clemens

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#4 lore raw
Quoted 11 lines · Clemens Ladisch
Quoted 4 lines · Adrian McMenamin
Quoted 2 lines

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

Exactly, but how?

CC=sh-linux-gcc CFLAGS=--static ./configure --xxx=...

HTH
Clemens

Cheers,

It works :)

Many thanks - have to get on with building the driver now.

Adrian

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#5 lore raw
In reply to Clemens Ladisch
Quoted 9 lines · Clemens Ladisch
Quoted 4 lines · Adrian McMenamin
Quoted 2 lines

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

Exactly, but how?

CC=sh-linux-gcc CFLAGS=--static ./configure --xxx=...

OK, this works great for the alsa-utils, but I have now discovered that many of the tools installed by alsa-lib are not properly built static even when I follow the instructions in the INSTALL file -----

For instance:

/usr/bin # ./alsalisp
./alsalisp: No such file or directory

I have configured the sources for building thus:

CC=sh-linux-gcc ./configure --enable-shared=no --enable-static=yes --host=sh-linux --prefix=/home/Adrian/dc-down/initrd/usr

Adding in CFLAGS=--static causes the build to fail.

So any clues on this one?

Adrian

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#6 lore raw

At Mon, 1 Sep 2003 20:30:43 +0100,

Quoted 16 lines · Adrian McMenamin
Quoted 9 lines · Clemens Ladisch
Quoted 4 lines · Adrian McMenamin
Quoted 2 lines

Do the compiler flags include --static? Maybe you can add this flag by setting CFLAGS explicitly when ./configure-ing.

Exactly, but how?

CC=sh-linux-gcc CFLAGS=--static ./configure --xxx=...

OK, this works great for the alsa-utils, but I have now discovered that many of the tools installed by alsa-lib are not properly built static even when I follow the instructions in the INSTALL file -----

Quoted 4 lines

For instance:

/usr/bin # ./alsalisp
./alsalisp: No such file or directory

this is not used at all, so far.
it's an experimental implementation of lisp-style configurations, so don't yet expect it works perfectly :)

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf