Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724676 - media-libs/x264 fails to compile
Summary: media-libs/x264 fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-23 12:46 UTC by Agostino Sarubbo
Modified: 2020-09-05 18:54 UTC (History)
0 users

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


Attachments
build.log (build.log,8.06 KB, text/plain)
2020-05-23 12:46 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-05-23 12:46:50 UTC
This is an auto-filed bug because media-libs/x264 fails to compile.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you need further logs, feel free to ask.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-23 12:46:55 UTC
Created attachment 641042 [details]
build.log

build log and emerge --info
Comment 2 Arfrever Frehtes Taifersar Arahesis 2020-09-05 16:04:02 UTC
> >>> Configuring source in /var/tmp/portage/media-libs/x264-0.0.20190903/work/x264-snapshot-20190903-2245 ...
>  * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
> Found GNU assembler (Gentoo 2.34 p4) 2.34.0
> Minimum version is nasm-2.13
> If you really want to compile without asm, configure with --disable-asm.
>  * ERROR: media-libs/x264-0.0.20190903::gentoo failed (configure phase):
>  *   (no error message)
Comment 3 Arfrever Frehtes Taifersar Arahesis 2020-09-05 16:16:26 UTC
Globally set AS variable can point to GNU assembler (e.g. AS="${CHOST}-as") and this is not any misconfiguration.


x264 build system has non-standard and architecture-dependent expectations about value of AS variable:

In x264-0.0.20190903 in configure:

...
case $host_cpu in
    i*86)
        ...
        AS="${AS-nasm}"
        ...
        ;;
    x86_64)
        ...
        AS="${AS-nasm}"
        ...
    powerpc*)
        ...
        if [ $asm = auto ] ; then
            ...
            AS="${AS-${CC}}"
        ...
        ;;
    ...
    mips*)
        ...
        AS="${AS-${CC}}"
        ...
        ;;
    arm*)
        ...
        if [ "$SYS" = MACOSX ] ; then
            AS="${AS-${CC}}"
            ...
        elif [ "$SYS" = WINDOWS ] && [ "$compiler" = CL ] ; then
            AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch arm -as-type armasm -force-thumb -- armasm -nologo -ignore 4509}"
        elif [ "$SYS" = WINDOWS ] ; then
            AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch arm -as-type clang -force-thumb -- ${CC} -mimplicit-it=always}"
        else
            AS="${AS-${CC}}"
        fi
        ;;
    aarch64)
        ...
        if [ "$SYS" = MACOSX ] ; then
            AS="${AS-${CC}}"
            ...
        elif [ "$SYS" = WINDOWS ] && [ "$compiler" = CL ] ; then
            AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo}"
        else
            AS="${AS-${CC}}"
        fi
        ;;
...


Therefore the easiest solution is to set AS="nasm" on x86_{32,64} and AS="${CC}" on other architectures.
Comment 4 Larry the Git Cow gentoo-dev 2020-09-05 18:54:26 UTC
The bug has been closed via the following commit(s):

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

commit 295166a86e96aef23f9cc311e71eb29556aaeaa4
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2020-09-05 16:00:00 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-09-05 18:54:13 +0000

    media-libs/x264: Set special value of AS to fix build failure.
    
    Closes: https://bugs.gentoo.org/721026
    Closes: https://bugs.gentoo.org/724676
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 media-libs/x264/x264-0.0.20190214.ebuild    | 7 +++++++
 media-libs/x264/x264-0.0.20190903-r1.ebuild | 7 +++++++
 media-libs/x264/x264-0.0.20190903.ebuild    | 7 +++++++
 media-libs/x264/x264-9999.ebuild            | 7 +++++++
 4 files changed, 28 insertions(+)