Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721026 - 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-05 06:07 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,49.32 KB, text/plain)
2020-05-05 06:07 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-05 06:07:35 UTC
This is an auto-filled bug because media-libs/x264 fails to compile.
The issue was originally discovered on arm64, 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.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-05 06:07:47 UTC
Created attachment 636102 [details]
build.log

build log and emerge --info
Comment 2 Arfrever Frehtes Taifersar Arahesis 2020-09-05 16:03:53 UTC
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/bitstream-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/bitstream-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/cabac-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/cabac-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/dct-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/dct-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/deblock-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/deblock-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/mc-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/mc-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/pixel-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/pixel-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/predict-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/predict-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/quant-a-8.o ../x264-snapshot-20190903-2245/common/aarch64/quant-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
> aarch64-unknown-linux-gnu-as -I. -I../x264-snapshot-20190903-2245 -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/bitstream-a-10.o ../x264-snapshot-20190903-2245/common/aarch64/bitstream-a.S -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
> aarch64-unknown-linux-gnu-as: invalid option -- 'S'
Comment 3 Arfrever Frehtes Taifersar Arahesis 2020-09-05 16:16:23 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:27 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(+)