[alsa-devel] alsa-lib-1.0.18 doesn't build with option '--with-softfloat'

Hi all,
I'm trying to build the latest release alsa-lib-1.0.18 on Blackfin with option '--with-softfloat', but it failed with message:
libtool: install: warning: remember to run `libtool --finish /usr/lib/alsa-lib/smixer' ../src/.libs/libasound.so: undefined reference to `_sqrtf' ../src/.libs/libasound.so: undefined reference to `_exp' ../src/.libs/libasound.so: undefined reference to `_log' ../src/.libs/libasound.so: undefined reference to `_sqrt' ../src/.libs/libasound.so: undefined reference to `_fmod' ../src/.libs/libasound.so: undefined reference to `_floor'
Since I've selected --with-softfloat, '-lm' should be excluded from ALSA_DEPLIBS. but some source files still depend on libm, such as .../pcm/pcm_ladspa.c;.../mixer/ simple_none.c .../alisp/alisp.c.These there files cause undefined reference as above.
Best Regards
Cliff

At Wed, 7 Jan 2009 17:02:40 +0800, Cliff Cai wrote:
Hi all,
I'm trying to build the latest release alsa-lib-1.0.18 on Blackfin with option '--with-softfloat', but it failed with message:
libtool: install: warning: remember to run `libtool --finish /usr/lib/alsa-lib/smixer' ../src/.libs/libasound.so: undefined reference to `_sqrtf' ../src/.libs/libasound.so: undefined reference to `_exp' ../src/.libs/libasound.so: undefined reference to `_log' ../src/.libs/libasound.so: undefined reference to `_sqrt' ../src/.libs/libasound.so: undefined reference to `_fmod' ../src/.libs/libasound.so: undefined reference to `_floor'
Since I've selected --with-softfloat, '-lm' should be excluded from ALSA_DEPLIBS. but some source files still depend on libm, such as .../pcm/pcm_ladspa.c;.../mixer/ simple_none.c .../alisp/alisp.c.These there files cause undefined reference as above.
Bah, at least, simple_none.c should be without math stuff.
pcm_ladspa.c can't be build without libm, I guess. This should be excluded with the softfload option. Ditto for alisp.
How about the patch below?
thanks,
Takashi
--- diff --git a/configure.in b/configure.in index 5bc0c01..cc1109f 100644 --- a/configure.in +++ b/configure.in @@ -367,6 +367,7 @@ AC_ARG_ENABLE(seq, AC_ARG_ENABLE(alisp, AS_HELP_STRING([--disable-alisp], [disable the alisp component]), [build_alisp="$enableval"], [build_alisp="yes"]) +test "$softfloat" = "yes" && build_alisp="no" AC_ARG_ENABLE(old-symbols, AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]), [keep_old_symbols="$enableval"], [keep_old_symbols="yes"]) @@ -474,6 +475,7 @@ fi
if test "$softfloat" = "yes"; then build_pcm_lfloat="no" + build_pcm_ladspa="no" fi
AM_CONDITIONAL(BUILD_PCM_PLUGIN, test x$build_pcm_plugin = xyes) diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c index 0f4dd3a..a65619d 100644 --- a/src/mixer/simple_none.c +++ b/src/mixer/simple_none.c @@ -1450,7 +1450,14 @@ static int simple_add1(snd_mixer_class_t *class, const char *name, } if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN) return 0; +#ifdef HAVE_SOFT_FLOAT + /* up to 256 channels */ + for (n = 1; n < 256; n++) + if (n * n == values) + break; +#else n = sqrt((double)values); +#endif if (n * n != values) return 0; values = n;

On Wed, Jan 07, 2009 at 10:18:42AM +0100, Takashi Iwai wrote:
pcm_ladspa.c can't be build without libm, I guess. This should be excluded with the softfload option. Ditto for alisp.
How about the patch below?
OpenEmbedded has been carrying the following patch for a while, cooindcidentally I was actually looking at their ALSA packaging last night and thinking about pushing this to you - it forces liking with libm which is more important when using softfloat.
It was written by Henning Heinold heinold@inf.fu-berlin.de
Index: alsa-lib-1.0.15/configure.in =================================================================== --- alsa-lib-1.0.15.orig/configure.in 2007-10-15 10:45:26.000000000 +0200 +++ alsa-lib-1.0.15/configure.in 2008-07-19 15:51:34.177119589 +0200 @@ -191,9 +191,9 @@ AC_MSG_RESULT(no) fi
-ALSA_DEPLIBS="" -if test "$softfloat" != "yes"; then - ALSA_DEPLIBS="-lm" +ALSA_DEPLIBS="-lm" +if test "$softfloat" = "yes"; then + AC_CHECK_LIB([m], [floor], , [ALSA_DEPLIBS=""]) fi
dnl Check for libdl

At Wed, 7 Jan 2009 11:01:25 +0000, Mark Brown wrote:
On Wed, Jan 07, 2009 at 10:18:42AM +0100, Takashi Iwai wrote:
pcm_ladspa.c can't be build without libm, I guess. This should be excluded with the softfload option. Ditto for alisp.
How about the patch below?
OpenEmbedded has been carrying the following patch for a while, cooindcidentally I was actually looking at their ALSA packaging last night and thinking about pushing this to you - it forces liking with libm which is more important when using softfloat.
Well, when softfloat option is chosen, basically alsa-lib should be built without floating operations, thus libm shouldn't be needed. (So in that sense, the option is named wrongly...)
Takashi
It was written by Henning Heinold heinold@inf.fu-berlin.de
Index: alsa-lib-1.0.15/configure.in
--- alsa-lib-1.0.15.orig/configure.in 2007-10-15 10:45:26.000000000 +0200 +++ alsa-lib-1.0.15/configure.in 2008-07-19 15:51:34.177119589 +0200 @@ -191,9 +191,9 @@ AC_MSG_RESULT(no) fi
-ALSA_DEPLIBS="" -if test "$softfloat" != "yes"; then
- ALSA_DEPLIBS="-lm"
+ALSA_DEPLIBS="-lm" +if test "$softfloat" = "yes"; then
- AC_CHECK_LIB([m], [floor], , [ALSA_DEPLIBS=""])
fi
dnl Check for libdl _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

On Wed, Jan 07, 2009 at 12:13:22PM +0100, Takashi Iwai wrote:
Mark Brown wrote:
On Wed, Jan 07, 2009 at 10:18:42AM +0100, Takashi Iwai wrote:
OpenEmbedded has been carrying the following patch for a while, cooindcidentally I was actually looking at their ALSA packaging last night and thinking about pushing this to you - it forces liking with libm which is more important when using softfloat.
Well, when softfloat option is chosen, basically alsa-lib should be built without floating operations, thus libm shouldn't be needed. (So in that sense, the option is named wrongly...)
Yeah, looking at the code I had kind of suspected that or I'd have pushed it last night. It's probably worth renaming the option to "float" or something to reduce confusion?

At Wed, 7 Jan 2009 11:34:27 +0000, Mark Brown wrote:
On Wed, Jan 07, 2009 at 12:13:22PM +0100, Takashi Iwai wrote:
Mark Brown wrote:
On Wed, Jan 07, 2009 at 10:18:42AM +0100, Takashi Iwai wrote:
OpenEmbedded has been carrying the following patch for a while, cooindcidentally I was actually looking at their ALSA packaging last night and thinking about pushing this to you - it forces liking with libm which is more important when using softfloat.
Well, when softfloat option is chosen, basically alsa-lib should be built without floating operations, thus libm shouldn't be needed. (So in that sense, the option is named wrongly...)
Yeah, looking at the code I had kind of suspected that or I'd have pushed it last night. It's probably worth renaming the option to "float" or something to reduce confusion?
Yep, e.g. --disable-float would be more intuitive.
Takashi
participants (3)
-
Cliff Cai
-
Mark Brown
-
Takashi Iwai