Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 714094

Summary: media-libs/libsdl2 with app-shells/dash that supports LINENO: Makefile:413: *** multiple target patterns. Stop.
Product: Gentoo Linux Reporter: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Component: Current packagesAssignee: Gentoo Games <games>
Status: RESOLVED OBSOLETE    
Severity: normal CC: alexander, awkravchuk, coppens.matthias.abc, gentoo+bugs, gentoo, kfm, lssndrbarbieri, marien.zwart
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugzilla.libsdl.org/show_bug.cgi?id=4261
See Also: https://bugs.gentoo.org/show_bug.cgi?id=727562
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 714092    
Attachments: build.log
dash-bug-workaround.patch
configure-posix-conformance.patch

Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-03-23 18:44:46 UTC
Created attachment 624746 [details]
build.log

checking whether to install sdl2-config... yes
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
/var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: 1: /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12/configure: objects: not found
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sdl2-config
config.status: creating sdl2-config.cmake
config.status: creating sdl2-config-version.cmake
config.status: creating SDL2.spec
config.status: creating sdl2.pc
config.status: creating include/SDL_config.h
config.status: executing libtool commands
config.status: executing sdl2_config commands
config.status: executing summary commands
-en SDL2 Configure Summary:
Building Shared Libraries
Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math   : mmx sse sse2 sse3
Audio drivers   : disk dummy alsa pulse
Video drivers   : dummy x11 kmsdrm opengl vulkan
X11 libraries   : xcursor xdbe xinerama xinput2 xinput2_multitouch xrandr xshape xvidmode
Input drivers   : linuxev linuxkd
Using libsamplerate : NO
Using libudev       : YES
Using dbus          : YES
Using ime           : YES
Using ibus          : NO
Using fcitx         : NO

>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-libs/libsdl2-2.0.12/work/SDL2-2.0.12 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_compile
make -j1 V=1
Makefile:413: *** multiple target patterns.  Stop.
 * ERROR: media-libs/libsdl2-2.0.12::gentoo failed (compile phase):
Comment 1 Alex Xu (Hello71) 2020-04-08 01:09:15 UTC
caused by this eye-gouging shell scripting: https://hg.libsdl.org/SDL/file/tip/configure.ac#l4184

could be patched out, but probably easier to switch to cmake.
Comment 2 Michael Orlitzky gentoo-dev 2020-04-08 16:52:49 UTC
This was reported upstream in $URL but the maintainer wasn't able to reproduce it because Debian cripples their /bin/dash just like we used to. Waiting on bugzilla credentials to explain.
Comment 3 Matt Whitlock 2020-04-08 22:50:47 UTC
Workaround:

# mkdir -p /etc/portage/env/media-libs
# echo 'CONFIG_SHELL=/bin/bash' >/etc/portage/env/media-libs/libsdl2-2.0.12-r1
Comment 4 depsterr 2020-05-21 16:05:57 UTC
I solved this issue by changing /bin/sh from dash to bash. The installation should be patched to use bash and not sh.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-05-21 16:10:33 UTC
(In reply to depsterr from comment #4)
> I solved this issue by changing /bin/sh from dash to bash. The installation
> should be patched to use bash and not sh.

No, this needs to be fixed by upstream. Ideally someone should attach a patch to the upstream bug report. Perhaps that way we can speed up the process a bit.
Comment 6 Matt Whitlock 2020-05-21 21:15:20 UTC
Created attachment 640832 [details, diff]
dash-bug-workaround.patch

While libsdl2's configure.ac does have POSIX conformance issues (use of 'echo -n'; passing arguments containing embedded backslashes to 'echo'), the specific failures observed here ("objects: not found") are actually caused by a Dash bug, which I have reported here:

https://www.mail-archive.com/dash@vger.kernel.org/msg01935.html

Attached here is a patch (based on the tree after applying ${FILESDIR}/libsdl2-2.0.12-static-libs.patch) that works around the bug in Dash and, along with the forthcoming POSIX conformance patch, allows media-libs/libsdl2-2.0.12-r1 to configure and build successfully with /bin/sh->dash.
Comment 7 Matt Whitlock 2020-05-21 21:20:16 UTC
Created attachment 640834 [details, diff]
configure-posix-conformance.patch

This patch resolves some of the POSIX conformance issues in libsdl2's configure.ac:

 * use of 'echo -n'
 * passing arguments containing embedded backslashes to 'echo'

POSIX leaves both of the above cases implementation-defined and specifies that XSI-conformant systems shall have behavior that differs from Bash's behavior.

The portable way of outputting literal strings containing embedded backslashes and/or without appending a newline character is by means of 'printf'. This patch makes the necessary changes.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 21:46:30 UTC
(In reply to Matt Whitlock from comment #7)
> Created attachment 640834 [details, diff] [details, diff]
> configure-posix-conformance.patch
> 
> This patch resolves some of the POSIX conformance issues in libsdl2's
> configure.ac:
> 
>  * use of 'echo -n'
>  * passing arguments containing embedded backslashes to 'echo'
> 
> POSIX leaves both of the above cases implementation-defined and specifies
> that XSI-conformant systems shall have behavior that differs from Bash's
> behavior.
> 
> The portable way of outputting literal strings containing embedded
> backslashes and/or without appending a newline character is by means of
> 'printf'. This patch makes the necessary changes.

Can you post these upstream too? Thank you!
Comment 9 Matt Whitlock 2020-06-01 20:43:22 UTC
(In reply to Sam James (sec padawan) from comment #8)
> Can you post these upstream too? Thank you!

Done. See URL.
Comment 10 Matt Whitlock 2020-06-03 19:01:02 UTC
The Dash bug is fixed[1] in app-shells/dash-0.5.11, and dash-bug-workaround.patch is no longer needed when configuring libsdl2 using the newer version of Dash. It does not hurt to retain the workaround for now, but it will no longer be needed once Dash 0.5.11 has been stabilized.

____________

[1] https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=e8e29001ad1cdeb68a5c617db149830e676c32c8
Comment 11 Pietro 2020-08-20 10:34:21 UTC
I have got the same issue and I am not using dash 
admin@gentoo ~ $ echo $SHELL
/bin/bash
admin@gentoo ~ $ 

In my case the package is a dependency of qemu

admin@gentoo ~ $ equery d libsdl2
 * These packages depend on libsdl2:
app-emulation/qemu-5.0.0-r1 (sdl ? media-libs/libsdl2[video])
                            (sdl ? media-libs/libsdl2)
                            (sdl ? media-libs/libsdl2[static-libs(+)])
media-video/ffmpeg-4.2.4 (sdl ? media-libs/libsdl2[sound,video,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?])
x11-libs/wxGTK-3.0.4-r2 (sdl ? media-libs/libsdl2[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?])
x11-libs/wxGTK-3.0.4-r302 (sdl ? media-libs/libsdl2[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?])
admin@gentoo ~ $
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-09-04 17:43:55 UTC
*** Bug 738010 has been marked as a duplicate of this bug. ***