Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 498136 - =media-libs/libvpx-1.3.0 with /bin/sh -> dash: configure: 408: local: -m32: bad variable name
Summary: =media-libs/libvpx-1.3.0 with /bin/sh -> dash: configure: 408: local: -m32: b...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL: https://code.google.com/p/webm/issues...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-15 08:10 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2014-03-11 21:23 UTC (History)
5 users (show)

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


Attachments
config.log (config.log,30.15 KB, text/plain)
2014-01-15 08:10 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
libvpx-1.3.0-dash.patch (libvpx-1.3.0-dash.patch,782 bytes, patch)
2014-02-14 20:37 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-15 08:10:36 UTC
Created attachment 367880 [details]
config.log

>>> Emerging (1 of 1) media-libs/libvpx-1.3.0
 * libvpx-v1.3.0.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...            [ ok ]
>>> Unpacking source...
>>> Unpacking libvpx-v1.3.0.tar.bz2 to /var/tmp/portage/media-libs/libvpx-1.3.0/work
>>> Source unpacked in /var/tmp/portage/media-libs/libvpx-1.3.0/work
>>> Preparing source in /var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0 ...
 * x86: running multilib-minimal_abi_src_configure
Configuring selected codecs
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'x86-linux-gcc'
  enabling x86
  enabling pic
  enabling runtime_cpu_detect
  enabling mmx
  enabling sse
  enabling sse2
  using yasm
  checking here for x86inc "x86" "yes" 
  enabling use_x86inc
Creating makefiles for x86-linux-gcc libs
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/configure: 408: local: -m32: bad variable name
 * ERROR: media-libs/libvpx-1.3.0::gentoo failed (configure phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2359:  Called multilib-minimal_src_configure
 *   environment, line 1765:  Called multilib_foreach_abi 'multilib-minimal_abi_src_configure'
 *   environment, line 1950:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 1606:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 1604:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure'
 *   environment, line  314:  Called multilib-minimal_abi_src_configure
 *   environment, line 1759:  Called multilib_src_configure
 *   environment, line 2105:  Called die
 * The specific snippet of code:
 *       "${S}/configure" --prefix="${EPREFIX}"/usr --libdir="${EPREFIX}"/usr/$(get_libdir) --enable-pic --enable-vp8 --enable-shared --extra-cflags="${CFLAGS}" $(use_enable altivec) $(use_enable avx) $(use_enable avx2) $(use_enable mmx) $(use_enable postproc) $(use_enable sse) $(use_enable sse2) $(use_enable sse3) $(use_enable sse4_1) $(use_enable ssse3) $(use_enable static-libs static) $(use_enable test unit-tests) $(use_enable threads multithread) ${myconf} || die
 * 
 * If you need support, post the output of `emerge --info '=media-libs/libvpx-1.3.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/libvpx-1.3.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/libvpx-1.3.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/libvpx-1.3.0/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0-x86'
 * S: '/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0'

>>> Failed to emerge media-libs/libvpx-1.3.0, Log file:

>>>  '/var/tmp/portage/media-libs/libvpx-1.3.0/temp/build.log'

 * Messages for package media-libs/libvpx-1.3.0:

 * ERROR: media-libs/libvpx-1.3.0::gentoo failed (configure phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2359:  Called multilib-minimal_src_configure
 *   environment, line 1765:  Called multilib_foreach_abi 'multilib-minimal_abi_src_configure'
 *   environment, line 1950:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 1606:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 1604:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure'
 *   environment, line  314:  Called multilib-minimal_abi_src_configure
 *   environment, line 1759:  Called multilib_src_configure
 *   environment, line 2105:  Called die
 * The specific snippet of code:
 *       "${S}/configure" --prefix="${EPREFIX}"/usr --libdir="${EPREFIX}"/usr/$(get_libdir) --enable-pic --enable-vp8 --enable-shared --extra-cflags="${CFLAGS}" $(use_enable altivec) $(use_enable avx) $(use_enable avx2) $(use_enable mmx) $(use_enable postproc) $(use_enable sse) $(use_enable sse2) $(use_enable sse3) $(use_enable sse4_1) $(use_enable ssse3) $(use_enable static-libs static) $(use_enable test unit-tests) $(use_enable threads multithread) ${myconf} || die
 * 
 * If you need support, post the output of `emerge --info '=media-libs/libvpx-1.3.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/libvpx-1.3.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/libvpx-1.3.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/libvpx-1.3.0/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0-x86'
 * S: '/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0'



# emerge --info libvpx
Portage 2.2.8 (default/linux/amd64/13.0/desktop/kde, gcc-4.8.2-asneeded, glibc-2.17, 3.10.26 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.26-x86_64-Quad-Core_AMD_Opteron-tm-_Processor_2389-with-gentoo-2.2
KiB Mem:     8243120 total,   1639552 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Wed, 15 Jan 2014 07:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/cmake:           2.8.12.1-r3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.14.1
sys-devel/binutils:       2.24-r1::poly-c
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo kde-sunset poly-c
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=barcelona -mtune=barcelona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/xinit /etc/adobe /etc/bonobo-activation /etc/ca-certificates /etc/ca-certificates.conf /etc/dbus-1 /etc/env.d /etc/fonts /etc/fonts/fonts.conf /etc/foomatic /etc/games /etc/gconf /etc/gentoo-release /etc/gimp /etc/gnome-vfs-2.0 /etc/gre.d /etc/gtk-2.0 /etc/hp /etc/hsqldb /etc/htdig /etc/init.d /etc/iproute2 /etc/java-config-2 /etc/lftp /etc/logrotate.d /etc/ntop /etc/opt /etc/pango /etc/profile.d /etc/qt4 /etc/revdep-rebuild /etc/sandbox.d /etc/sasl2 /etc/sensors.d /etc/sgml /etc/sound /etc/ssl /etc/ssmtp /etc/t1lib /etc/terminfo /etc/vbox /etc/xdg /etc/xinetd.d /etc/xml"
CXXFLAGS="-march=barcelona -mtune=barcelona -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=y --misspell-suggestions=n --autounmask=n --quiet-build=n --verbose-slot-rebuilds=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
INSTALL_MASK="/lib/systemd /lib32/systemd /lib64/systemd /usr/lib/systemd /usr/lib32/systemd /usr/lib64/systemd"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/opt/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/lib/layman/kde-sunset /usr/local/portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 berkdb branding bzip2 c++0x cairo caps cdda cdr cli cracklib crypt css cups cxx dbus declarative dri dts dvd dvdr emboss encode exif faac fam ffmpeg firefox flac gdbm gif gmp gnutls gtk iconv icu idn imagemagick inotify jpeg jpeg2k kde kipi lame lcms libnotify lzma mac mad matroska midi mmap mmx mmxext mng modules mp3 mp4 mpeg mpfr mudflap multilib ncurses nls nptl nsplugin ogg opengl openmp opus pam pango pcre pdf phonon plasma png ppds qt3support qt4 quicktime readline rtmp schroedinger sdl session slang speex spell sse sse2 ssl startup-notification svg theora threads tiff truetype twolame udev unicode upower usb vaapi vcd vorbis vpx wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid xvmc zlib zsh-completion" ABI_X86="64" ALSA_CARDS="emu10k1 hda-intel usb-audio" APACHE2_MODULES="access_compat alias authn_anon auth_basic authn_core authn_default authn_file authz_core authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dir env file_cache filter headers include info log_config mime mime_magic rewrite status unique_id unixd userdir vhost_alias" ELIBC="glibc" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev joystick" KERNEL="linux" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

media-libs/libvpx-1.2.0_pre20130625 was built with the following:
USE="(-altivec) -doc mmx (multilib) -postproc sse sse2 -sse3 -sse4_1 -ssse3 -static-libs -test threads" ABI_X86="32 64 -x32"
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-15 11:06:10 UTC
To reproduce this problem you need to have /bin/sh pointing to dash.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2014-02-14 20:34:18 UTC
Got the same here:

> Creating makefiles for x86-linux-gcc libs
> + write_common_target_config_mk libs-x86-linux-gcc.mk vpx_config.h
> + local CC=x86_64-pc-linux-gnu-gcc -m32
> /tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/configure: 408: local: -m32: bad variable name

Some debugging revealed divverence in variable expansion:
The fix looks trivial:

diff --git a/build/make/configure.sh b/build/make/configure.sh
index 8dcb9bb..a38f712 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -405,8 +405,8 @@ true
 }
 
 write_common_target_config_mk() {
-    local CC=${CC}
-    local CXX=${CXX}
+    local CC="${CC}"
+    local CXX="${CXX}"
     enabled ccache && CC="ccache ${CC}"
     enabled ccache && CXX="ccache ${CXX}"
     print_webm_license $1 "##" ""
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2014-02-14 20:37:29 UTC
Created attachment 370428 [details, diff]
libvpx-1.3.0-dash.patch

Adds quoting around 'CC' / 'CXX' to pass on dash, but really looks likre dash deficiency.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-02-14 20:43:41 UTC
(In reply to Sergei Trofimovich from comment #3)
> Created attachment 370428 [details, diff] [details, diff]
> libvpx-1.3.0-dash.patch
> 
> Adds quoting around 'CC' / 'CXX' to pass on dash, but really looks likre
> dash deficiency.

does the declaration to 'local' change the nature of the variable assignment really this way that quoting is required?

$ FOO="foo bar"
$ BAR=${FOO}
$ echo ${BAR}
foo bar

so if we were inside a function() and i'd just want to declare FOO and BAR as 'local', I'd have to also start using quoting?
Comment 5 Mike Gilbert gentoo-dev 2014-02-14 21:01:48 UTC
(In reply to Samuli Suominen from comment #4)
> does the declaration to 'local' change the nature of the variable assignment
> really this way that quoting is required?
> 

In dash, yes, this appears to be the case.

In bash, no, local FOO=${BAR} is still treated as a variable assignment and no quoting is necessary.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2014-02-14 21:10:24 UTC
All cases are easy to test:

> [sf] ~:dash -c 'a="gcc -m32"; foo() { local z=${a}; echo $z; }; foo'
> dash: 1: local: -m32: bad variable name
> [sf] ~:bash -c 'a="gcc -m32"; foo() { local z=${a}; echo $z; }; foo'
> gcc -m32
> [sf] ~:dash -c 'a="gcc -m32"; foo() { local z="${a}"; echo $z; }; foo'
> gcc -m32

But this thing shows horrible inconsistency:

> [sf] ~:dash -c 'a="gcc -m32"; z=${a}; echo $z;'
> gcc -m32
Comment 7 Mike Gilbert gentoo-dev 2014-02-21 02:30:00 UTC
+  21 Feb 2014; Mike Gilbert <floppym@gentoo.org> +files/libvpx-1.3.0-dash.patch,
+  libvpx-1.3.0.ebuild:
+  Fix compatibility with dash, bug 498136.
Comment 8 Mike Gilbert gentoo-dev 2014-02-21 02:38:43 UTC
Patch sent upstream via the bug tracker.
Comment 9 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2014-02-21 05:24:19 UTC
(In reply to Mike Gilbert from comment #8)
> Patch sent upstream via the bug tracker.

If possible please follow <http://www.webmproject.org/code/contribute/submitting-patches/> . The reality is that otherwise the chance of that patch making it upstream is close to zero.
Comment 10 Mike Gilbert gentoo-dev 2014-02-21 06:24:39 UTC
(In reply to Paweł Hajdan, Jr. from comment #9)

That process is way too cumbersome for a trivial build system fix, especially when I have no intention of making any future contributions to the project.
Comment 11 Mike Gilbert gentoo-dev 2014-02-21 15:27:02 UTC
Sorry, was having a moment of frustration. I'll try to upstream this properly.
Comment 12 Mike Gilbert gentoo-dev 2014-03-11 21:23:36 UTC
It's been fixed upstream.