Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779445 - media-libs/libsdl: Fails with parallel make and slibtool
Summary: media-libs/libsdl: Fails with parallel make and slibtool
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL: https://github.com/libsdl-org/SDL-1.2...
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2021-03-31 02:28 UTC by orbea
Modified: 2021-04-02 02:48 UTC (History)
2 users (show)

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


Attachments
Build log. (build.log,26.90 KB, text/x-log)
2021-03-31 02:28 UTC, orbea
Details
Patch to fix the build. (libsdl-parallel-make.patch,2.23 KB, patch)
2021-03-31 02:29 UTC, orbea
Details | Diff
Patch to fix the build. (libsdl-parallel-make.patch,2.20 KB, patch)
2021-03-31 03:28 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description orbea 2021-03-31 02:28:42 UTC
Created attachment 696312 [details]
Build log.

When building libsdl with slibtool and parallel make the build can fail because the 'build' directory created in SDL's Makefile may not yet exist. Make is not capable of depending on a directory, but with a sentinel file the compiled .lo files can then depend on the directory being created in time.

This has already been fixed upstream in SDL2 and SDL2_mixer with a similar patch.

Additionally GNU make avoids this by being slower than mkdir(1) and rdlibtool also might avoid it in a similar way, but it consistently fails with rlibtool for me.

make LIBTOOL=rlibtool -j4 
/bin/sh /var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/build-scripts/mkinstalldirs build
rlibtool --mode=compile x86_64-pc-linux-gnu-gcc -O2 -pipe  -Iinclude -I/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/include -D_GNU_SOURCE=1 -fvisibility=hidden   -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c /var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/src/SDL.c  -o build/SDL.lo
rlibtool --mode=compile x86_64-pc-linux-gnu-gcc -O2 -pipe  -Iinclude -I/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/include -D_GNU_SOURCE=1 -fvisibility=hidden   -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c /var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/src/SDL_error.c  -o build/SDL_error.lo
rlibtool --mode=compile x86_64-pc-linux-gnu-gcc -O2 -pipe  -Iinclude -I/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/include -D_GNU_SOURCE=1 -fvisibility=hidden   -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c /var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15/src/SDL_fatal.c  -o build/SDL_fatal.lo
rlibtool: lconf: {.name="libtool"}.
rlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64"}.
rlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 65026, .st_ino = 3962078}.
rlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = 3.
rlibtool: lconf: found "/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64/libtool".
rlibtool: error logged in slbt_exec_compile(), line 158: path not found: build/.libs/.
make: *** [build-deps:29: build/SDL.lo] Error 2
rlibtool: lconf: {.name="libtool"}.
rlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64"}.
make: *** Waiting for unfinished jobs....
rlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 65026, .st_ino = 3962078}.
rlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = 3.
rlibtool: lconf: found "/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64/libtool".
rlibtool: error logged in slbt_exec_compile(), line 158: path not found: build/.libs/.
make: *** [build-deps:41: build/SDL_error.lo] Error 2
rlibtool: lconf: {.name="libtool"}.
rlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64"}.
rlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 65026, .st_ino = 3962078}.
mkdir -p -- build
rlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = 3.
rlibtool: lconf: found "/var/tmp/portage/media-libs/libsdl-1.2.15-r9/work/SDL-1.2.15-abi_x86_64.amd64/libtool".
rlibtool: error logged in slbt_exec_compile(), line 158: path not found: build/.libs/.
make: *** [build-deps:72: build/SDL_fatal.lo] Error 2
Comment 1 orbea 2021-03-31 02:29:28 UTC
Created attachment 696315 [details, diff]
Patch to fix the build.
Comment 2 orbea 2021-03-31 03:28:19 UTC
Created attachment 696318 [details, diff]
Patch to fix the build.

Slightly cleaner patch.
Comment 3 Larry the Git Cow gentoo-dev 2021-04-01 23:04:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b3bd8ff50ff76c0c29c9b922658ef7c74aeffe7

commit 5b3bd8ff50ff76c0c29c9b922658ef7c74aeffe7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-04-01 22:49:56 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-04-01 23:03:57 +0000

    media-libs/libsdl: fix (parallel) build with slibtool
    
    Patch is upstream for libsdl2 and will be for libsdl soon.
    
    Thanks-to: orbea <orbea@riseup.net>
    Closes: https://bugs.gentoo.org/779445
    Signed-off-by: Sam James <sam@gentoo.org>

 .../libsdl/files/libsdl-1.2.15-slibtool.patch      | 56 ++++++++++++++++++++++
 media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild   |  1 +
 2 files changed, 57 insertions(+)