Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 810793 - media-video/ffmpeg-4.4-r1 - Error: unknown mnemonic
Summary: media-video/ffmpeg-4.4-r1 - Error: unknown mnemonic
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-28 13:59 UTC by Vasile M.
Modified: 2021-08-28 23:14 UTC (History)
2 users (show)

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


Attachments
build.log (build.log.zst,15.54 KB, application/zstd)
2021-08-28 14:00 UTC, Vasile M.
Details
emerge --info (emerge--info,4.93 KB, text/plain)
2021-08-28 14:00 UTC, Vasile M.
Details
lscpu and /proc/cpuinfo (lscpu-cpuinfo.tar.gz,989 bytes, application/gzip)
2021-08-28 20:30 UTC, Vasile M.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vasile M. 2021-08-28 13:59:36 UTC
I was excited when I did more research on gentoo and decided to use it.
Now I am disappointed. Nothing works on arm64. The desktop profile is unusable because libglvnd and dav1d libraries cannot be compiled (bugs already reported).
The base profile works, but ffmpeg compilation fails.

I tried to build a portable workstation on the mobile device and lost two weeks of work.

Reproducible: Always

Steps to Reproduce:
1. Download stage 3 tarball aarch64.
2. Chroot on Android device (cortex-a76, snapdragon 855)
3. Configure, synchronize and update.
4. emerge -av ffmpeg
Actual Results:  
...
src/libavformat/musx.c                                                                                                                    {standard input}: Assembler messages:                                                                                                            {standard input}:1956: Error: unknown mnemonic `itt' -- `itt gt'                                                                                 {standard input}:1957: Error: unknown mnemonic `movgt' -- `movgt x2,x1'                                                                          {standard input}:1958: Error: unknown mnemonic `movgt' -- `movgt x1,x21'                                                                         {standard input}:1960: Error: unknown mnemonic `it' -- `it le'                                                                                   {standard input}:1961: Error: unknown mnemonic `movle' -- `movle x1,x20'                                                                         {standard input}:1963: Error: unknown mnemonic `it' -- `it gt'                                                                                   {standard input}:1964: Error: unknown mnemonic `movgt' -- `movgt x2,x1'
...
make: *** [/var/tmp/portage/media-video/ffmpeg-4.4-r1/work/ffmpeg-4.4/ffbuild/common.mak:67: libavformat/mpegts.o] Error 1
Comment 1 Vasile M. 2021-08-28 14:00:21 UTC
Created attachment 736447 [details]
build.log
Comment 2 Vasile M. 2021-08-28 14:00:44 UTC
Created attachment 736450 [details]
emerge --info
Comment 3 Mike Gilbert gentoo-dev 2021-08-28 17:34:07 UTC
(In reply to Vasile M. from comment #0)
> I was excited when I did more research on gentoo and decided to use it.
> Now I am disappointed. Nothing works on arm64. The desktop profile is
> unusable because libglvnd and dav1d libraries cannot be compiled (bugs
> already reported).
> The base profile works, but ffmpeg compilation fails.
> 
> I tried to build a portable workstation on the mobile device and lost two
> weeks of work.

Please keep this kind of complaining off our bug tracker.
Comment 4 Mike Gilbert gentoo-dev 2021-08-28 17:39:33 UTC
This sort of problem might be triggered by various CFLAGS combinations.

Could you try removing "-march=armv8.2-a -mcpu=cortex-a76" from your CFLAGS?
Comment 5 Tee KOBAYASHI 2021-08-28 18:09:50 UTC
The problem seems to be that the configure script detects ARCH as arm, which should be aarch64 instead.

A workaround would be:

# EXTRA_FFMPEG_CONF="--arch=aarch64" emerge -av ffmpeg
Comment 6 Vasile M. 2021-08-28 18:56:07 UTC
(In reply to Mike Gilbert from comment #3)
> Please keep this kind of complaining off our bug tracker.

Obviously this should not be included in a bug tracker, but I am already worried about so many problems. Sorry, I will not do it again.

(In reply to Mike Gilbert from comment #4)
> Could you try removing "-march=armv8.2-a -mcpu=cortex-a76" from your CFLAGS?

aarch64-unknown-linux-gnu-gcc is unable to create an executable file.

And the config.log:
...
/var/tmp/portage/media-video/ffmpeg-4.4-r1/temp/ffconf.CXklstOL/test.c:3:2: error: #error "unsatisfied condition: defined __ARM_ARCH_4T__ || defined __TARGET_ARCH_4T"                                                                                                                                3 | #error "unsatisfied condition: defined __ARM_ARCH_4T__ || defined __TARGET_ARCH_4T"
...
aarch64-unknown-linux-gnu-gcc: error: missing argument to '-mcpu='
...

Repeated for: TARGET_ARCH_7M, TARGET_ARCH_7EM, TARGET_ARCH_8_A, etc.


(In reply to Tee KOBAYASHI from comment #5)

>The problem seems to be that the configure script detects ARCH as arm, which should be aarch64 instead.

>A workaround would be:
># EXTRA_FFMPEG_CONF="--arch=aarch64" emerge -av ffmpeg

Yes, it's the same problem for libglvnd. With --arch=aarch64 flag, ffmpeg can be compiled now. Thank you very much.

I don't know if the Gentoo package maintainer is responsible for the configure script or belongs to the ffmpeg developers. Therefore I do not know whether to consider this bug as solved or wait for someone to adapt the script so that it automatically detects the architecture.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-28 19:00:50 UTC
(In reply to Vasile M. from comment #6)
> (In reply to Mike Gilbert from comment #3)
> > Please keep this kind of complaining off our bug tracker.
> 
> Obviously this should not be included in a bug tracker, but I am already
> worried about so many problems. Sorry, I will not do it again.
> 

And for what it's worth, yes, arm64 does work rather well, it's because you're using armv8l as explained in bug 809293. I don't know if this is just build system misdetection or something more.
Comment 8 Vasile M. 2021-08-28 20:27:18 UTC
(In reply to Sam James from comment #7)
> And for what it's worth, yes, arm64 does work rather well, it's because
> you're using armv8l as explained in bug 809293. I don't know if this is just
> build system misdetection or something more.

Hum, I just saw that /proc/cpuinfo inside the chroot does not match the /proc/cpuinfo of the device. The output of the lscpu is also different.

The lscpu command shows the aarch64 architecture in the device and armv8l architecture in chroot (ArchLinux and Gentoo).

This is not a forum to discuss, but in the forum no one has answered me.
I don't want to bother here and I don't know what to do.
Comment 9 Vasile M. 2021-08-28 20:30:19 UTC
Created attachment 736507 [details]
lscpu and /proc/cpuinfo

chroot script
...
mount --rbind /proc "$CHROOT/proc"
mount --rbind /sys "$CHROOT/sys"
...
Comment 10 Vasile M. 2021-08-28 22:41:48 UTC
Solved. The architecture in chroot (Android) is wrong.
To choose the appropriate architecture, you must execute the setarch command.

setarch --list
setarch aarch64

I will investigate how to make aarch64 as the default architecture when doing the chroot proces.