Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63531 - sox-12.17.5 fiails to compile.
Summary: sox-12.17.5 fiails to compile.
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High blocker (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
: 59962 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-10 03:26 UTC by James
Modified: 2004-09-12 21:59 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James 2004-09-10 03:26:42 UTC
sox fails to compile because it includes the wrong include files, and uses the wrong api. It should use alsa-lib, and not try to use the kernel device interface directly.
It uses
/usr/include/sound/asound.h
when in fact it should use
/usr/include/alsa/asoundlib.h

This is not a quick fix, because sox is using completely the wrong alsa api.
I suggest adjusting the ebuild so that the ./configure forces it to not try to compile alsa support into sox, until the author fixes the problem.

Extract when trying to compile.
gcc -O3 -pipe -Wall -I. -I.   -c -o alsa.o alsa.c
In file included from alsa.c:32:
/usr/include/sound/asound.h:140: error: syntax error before '*' token
/usr/include/sound/asound.h:143: error: syntax error before '}' token
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to an incomplete type
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to an incomplete type
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to an incomplete type
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to an incomplete type
Comment 1 Andrew Ross (RETIRED) gentoo-dev 2004-09-10 03:56:16 UTC
sox-12.17.5 compiles without problem here. Please post the output of emerge info so we can compare with mine:

Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8)
=================================================================
System uname: 2.6.8 i686 Intel(R) Pentium(R) M processor 1.70GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://mirror.pacific.net.au/gentoo http://mirror.pacific.net.au/linux/Gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 avi bcmath berkdb bitmap-fonts bzlib caps cdr crypt cups divx4linux doc dvd encode fam gd gdbm gif gnome gpm gtk gtk2 guile imap imlib java jikes jpeg ldap libwww mad memlimit mmx motif mozilla mpeg mysql ncurses offensive oggvorbis opengl pam pdflib perl png python quicktime readline samba sdl slang spell sse ssl svg svga tcltk theora tiff truetype x86 xml2 xmms xprint xv zlib"
Comment 2 Arve Knudsen 2004-09-10 04:20:59 UTC
The ALSA guys themselves say not to use the ALSA API directly (it may change without notice), but ALSA-lib.
But it looks like adding '#include <linux/compiler.h>' to the top of alsa.c makes the thing compile (it probably defines the __user symbol). Including a kernel header directly is a bit messy though, I don't even know for which kernels this will work (why didn't the SoX guys add this themselves?).
Comment 3 Geoff Leach 2004-09-10 08:48:50 UTC
Adding '#include <linux/compiler.h>' to the top of alsa.c allows sox to compile for me. I used ebuild: unpack, make change to alsa.c, compile, install qmerge. There seems to have been some discussion about the bug on the sox mailist.
Comment 4 Kathy Wills 2004-09-10 13:31:52 UTC
I'm still getting the same errors even when trying Geoff's suggestion. This is a warning message that is in the configure section:

configure: WARNING: sound/asound.h: present but cannot be compiled
configure: WARNING: sound/asound.h: check for missing prerequisite headers?
configure: WARNING: sound/asound.h: proceeding with the preprocessor's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to bug-autoconf@gnu.org. ##
configure: WARNING:     ## ------------------------------------ ##

This is the error when doing make:

/usr/include/sound/asound.h:140: error: parse error before '*' token
/usr/include/sound/asound.h:143: error: parse error before '}' token
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to incompletetype `sndrv_hwdep_dsp_image'
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to incompletetype `sndrv_hwdep_dsp_image'
/usr/include/sound/asound.h:149: error: invalid application of `sizeof' to incompletetype `sndrv_hwdep_dsp_image'
/usr/include/sound/asound.h:451: error: variable or field `__user' declared void
/usr/include/sound/asound.h:451: error: parse error before '*' token
/usr/include/sound/asound.h:453: error: parse error before '}' token
/usr/include/sound/asound.h:457: error: variable or field `__user' declared void
/usr/include/sound/asound.h:457: error: parse error before '*' token
/usr/include/sound/asound.h:459: error: parse error before '}' token
/usr/include/sound/asound.h:484: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:484: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:484: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:484: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:485: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:485: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:485: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:485: error: invalid application of `sizeof' to incompletetype `sndrv_xferi'
/usr/include/sound/asound.h:486: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:486: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:486: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:486: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:487: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:487: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:487: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:487: error: invalid application of `sizeof' to incompletetype `sndrv_xfern'
/usr/include/sound/asound.h:781: error: parse error before '*' token
/usr/include/sound/asound.h:783: error: parse error before '}' token
/usr/include/sound/asound.h:845: error: invalid application of `sizeof' to incompletetype `sndrv_ctl_elem_list'
/usr/include/sound/asound.h:845: error: invalid application of `sizeof' to incompletetype `({anonymous})'
/usr/include/sound/asound.h:845: error: invalid application of `sizeof' to incompletetype `sndrv_ctl_elem_list'
/usr/include/sound/asound.h:845: error: invalid application of `sizeof' to incompletetype `sndrv_ctl_elem_list'
Comment 5 James 2004-09-10 14:19:59 UTC
Portage 2.0.50-r11 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r0, 2.6.8.1.no-libata)
=================================================================
System uname: 2.6.8.1.no-libata i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.5.3
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache nostrip sandbox"
GENTOO_MIRRORS="http://ftp.heanet.ie/pub/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo http://mirror.clarkson.edu/pub/distributions/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/u/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 apm arts avi berkdb bitmap-fonts cdr crypt cups dba debug dvd dvdr encode esd flac foomaticdb gd gdbm gif gnome gpm gtk gtk2 guile imlib ipv6 java joystick jpeg kde ldap libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls objc oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sasl scanner sdl slang spell ssl svga tcltk tcpd tetex threads truetype usb x86 xml xml2 xmms xprint xv zlib"
Comment 6 James 2004-09-10 14:22:16 UTC
For those that are interested, I am an ALSA developer. I pointed out the problem with sox, and just trying to make it compile is not the correct solution. sox should have it's alsa code completely re-written to use the correct programming api.
Comment 7 Kathy Wills 2004-09-10 15:22:35 UTC
Emerges and installs without a problem using USE="-alsa" emerge sox
Comment 8 Geoff Leach 2004-09-10 15:58:06 UTC
James does that mean you are suggesting it is better to

echo "media-sound/sox -alsa" >> /etc/portage/package.use

until the alsa support in sox is redone? 
Comment 9 James 2004-09-10 17:10:42 UTC
Yes.
ALSA 1.0.6 emulates OSS well enough for sox to work.
Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2004-09-11 10:01:04 UTC
*** Bug 59962 has been marked as a duplicate of this bug. ***
Comment 11 Doug Goldstein (RETIRED) gentoo-dev 2004-09-11 10:17:53 UTC
Filed the bug upstream... looks like they're struggling with it on the mailing list as well. It looks like the author wants to maintain his connection to the kernel interface because he feels that alsa-lib and sox do similar things and that  using alsa-lib on top of sox will provide too much overhead.

https://sourceforge.net/tracker/index.php?func=detail&aid=1026394&group_id=10706&atid=110706

I've also pushed out a new version of the ebuild that automatically disables ALSA support.
Comment 12 Jeremy Huddleston (RETIRED) gentoo-dev 2004-09-12 21:59:39 UTC
ok, well it's no longer a gentoo issue at this point, so closing... but I'll keep an eye on it... hopefully the author wises up a bit...  for now, we're forcing -alsa +oss