Skip to contentSkip to conversation

alsa-lib-1.0.18 doesn't build with option '--with-softfloat'

DISCUSSION Cliff Cai 3 participants 6 messages Jan 7, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Cliff Cai

author
#1 lore raw

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

#2 lore raw

At Wed, 7 Jan 2009 17:02:40 +0800,

Quoted 16 lines · Cliff Cai

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'

Quoted 5 lines

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

---

configure.in +2 -0
index 5bc0c01..cc1109f 100644
@@ -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)
src/mixer/simple_none.c +7 -0
index 0f4dd3a..a65619d 100644
@@ -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;
#3 lore raw
Quoted 4 lines · Takashi Iwai

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 <[email protected]>

configure.in +3 -3
Index: alsa-lib-1.0.15/configure.in
===================================================================
@@ -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
#4 lore raw

At Wed, 7 Jan 2009 11:01:25 +0000,

Quoted 11 lines · Mark Brown
Quoted 4 lines · Takashi Iwai

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

Quoted 24 lines

It was written by Henning Heinold <[email protected]>

Index: alsa-lib-1.0.15/configure.in
===================================================================

configure.in +3 -3
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#5 lore raw
Quoted 11 lines · Takashi Iwai
Quoted 6 lines · Mark Brown

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?

#6 lore raw

At Wed, 7 Jan 2009 11:34:27 +0000,

Quoted 10 lines · Mark Brown
Quoted 7 lines · Takashi Iwai
Quoted 6 lines · Mark Brown

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.

Quoted 7 lines
Quoted 3 lines

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