Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 712978 - media-sound/musepack-tools-465-r1 : /.../mpcenc.h: fatal error: fpu_control.h: No such file or directory
Summary: media-sound/musepack-tools-465-r1 : /.../mpcenc.h: fatal error: fpu_control.h...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 530442
Blocks:
  Show dependency tree
 
Reported: 2020-03-17 14:02 UTC by Toralf Förster
Modified: 2024-03-13 05:11 UTC (History)
3 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,14.57 KB, text/plain)
2020-03-17 14:03 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,10.50 KB, text/plain)
2020-03-17 14:03 UTC, Toralf Förster
Details
environment (environment,127.95 KB, text/plain)
2020-03-17 14:03 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,11.19 KB, application/x-bzip)
2020-03-17 14:03 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,4.59 KB, application/x-bzip)
2020-03-17 14:03 UTC, Toralf Förster
Details
media-sound:musepack-tools-465-r1:20200316-233647.log (media-sound:musepack-tools-465-r1:20200316-233647.log,48.61 KB, text/plain)
2020-03-17 14:03 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,32.46 KB, application/x-bzip)
2020-03-17 14:03 UTC, Toralf Förster
Details
Patch fixing compilation errors with musl (musepack-tools-465-musl.patch,1.46 KB, patch)
2020-11-20 22:20 UTC, Stefan Michelsson
Details | Diff
Ebuild utilizing the proposed musl patch (musepack-tools-465-r1.ebuild,950 bytes, text/plain)
2020-11-20 22:23 UTC, Stefan Michelsson
Details
A cleaner patch (IMHO) to fix musl compatibility (musepack-tools-465-musl.patch,638 bytes, patch)
2022-08-10 21:08 UTC, CFuga
Details | Diff
my musl fix patch + ebuild update (0001-media-sound-musepack-tools-fix-for-musl.patch,2.17 KB, patch)
2022-08-10 21:09 UTC, CFuga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2020-03-17 14:02:58 UTC
cd /var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465-abi_x86_64.amd64/mpcenc && /usr/bin/x86_64-gentoo-linux-musl-gcc -DCVD_FASTLOG -DFAST_MATH -I/var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/include -I/var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/libmpcpsy -I/var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/libmpcenc   -DNDEBUG -O2 -pipe -march=native   -o CMakeFiles/mpcenc.dir/keyboard.o -c /var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/mpcenc/keyboard.c
In file included from /var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/mpcenc/keyboard.c:19:
/var/tmp/portage/media-sound/musepack-tools-465-r1/work/musepack-tools-465/mpcenc/mpcenc.h:54:12: fatal error: fpu_control.h: No such file or directory
   54 | #  include <fpu_control.h>
      |            ^~~~~~~~~~~~~~~
compilation terminated.

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_musl-20200316-165821

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-gentoo-linux-musl-9.3.0 *
Available Python interpreters, in order of preference:
  [1]   python3.8
  [2]   python3.7
  [3]   python3.6
  [4]   python2.7 (fallback)

repository:
==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Mon, 16 Mar 2020 22:38:28 +0000
emerge -qpvO media-sound/musepack-tools
[ebuild  N    ] media-sound/musepack-tools-465-r1
Comment 1 Toralf Förster gentoo-dev 2020-03-17 14:03:01 UTC
Created attachment 620816 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-03-17 14:03:04 UTC
Created attachment 620818 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-03-17 14:03:06 UTC
Created attachment 620820 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-03-17 14:03:09 UTC
Created attachment 620822 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-03-17 14:03:12 UTC
Created attachment 620824 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-03-17 14:03:14 UTC
Created attachment 620826 [details]
media-sound:musepack-tools-465-r1:20200316-233647.log
Comment 7 Toralf Förster gentoo-dev 2020-03-17 14:03:17 UTC
Created attachment 620828 [details]
temp.tbz2
Comment 8 Stefan Michelsson 2020-11-20 22:20:52 UTC
Created attachment 673975 [details, diff]
Patch fixing compilation errors with musl

Here's a quick and dirty patch to make the package compile with musl, or at least with x86_64-gentoo-linux-musl.

There were two compilation errors:

1) mpcenc/mpcenc.c and mpcenc/mpcenc.h: Missing header fpu_control.h - fixed by replacing the missing defines with code copied from the glibc header file, and removing the fpu_control include statement (the patch should therefore only be applied on systems where the header actually is missing)

2) mpcenc/keyboard.c: struct timeval error "variable 'tv' has initializer but incomplete type" - fixed by adding an include for sys/time.h.
Comment 9 Stefan Michelsson 2020-11-20 22:23:43 UTC
Created attachment 673978 [details]
Ebuild utilizing the proposed musl patch

... and here's an accompanying ebuild for the patch.
Comment 10 CFuga 2022-08-10 21:08:33 UTC
Created attachment 799177 [details, diff]
A cleaner patch (IMHO) to fix musl compatibility

This patch makes the following changes.
* __linux__ isn't the same as __GLIBC__

Thus, avoids <fpu_control.h> macros. As commented in musepack-tools source code, at function Init_FPU(), where those macros are used:

// FIXME : not sure if it's a good idea

* Includes <sys/select.h> for select(3). That header includes <sys/time.h> and also fixes the struct timeval error.
Comment 11 CFuga 2022-08-10 21:09:24 UTC
Created attachment 799179 [details, diff]
my musl fix patch + ebuild update
Comment 12 Larry the Git Cow gentoo-dev 2023-03-20 05:36:08 UTC
The bug has been referenced in the following commit(s):

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

commit c0c3f271f5d35a31cfb5225885aaa5258d471590
Author:     Cristian Othón Martínez Vera <cfuga@cfuga.mx>
AuthorDate: 2023-03-12 23:24:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-20 05:32:45 +0000

    media-sound/musepack-tools: fix build on musl
    
    Signed-off-by: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
    Bug: https://bugs.gentoo.org/712978
    
    This patch makes the following changes.
    * __linux__ isn't the same as __GLIBC__
    
    Thus, it avoids calling <fpu_control.h> macros in musl, doesn't require
    conditional patching and still works nicely with glibc-based systems.
    
    * Includes <sys/select.h> for select(3). That header includes <sys/time.h>
    and also fixes the struct timeval error.
    
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/musepack-tools-465-musl.patch            | 24 ++++++++++++++++++++++
 .../musepack-tools/musepack-tools-465-r2.ebuild    |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)
Comment 13 Eli Schwartz 2024-03-13 05:11:30 UTC
Real fix is to update to the version from 2016 instead of the version from even earlier. :P