Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 809293 - media-libs/libglvnd - compilation error in ARM64 (new install)
Summary: media-libs/libglvnd - compilation error in ARM64 (new install)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-20 18:49 UTC by Vasile M.
Modified: 2021-08-28 23:14 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge--info.txt,5.05 KB, text/plain)
2021-08-20 18:56 UTC, Vasile M.
Details
libglvnd build log (build.log.zst,138.33 KB, application/zstd)
2021-08-20 19:16 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-20 18:49:32 UTC
Hello everyone,

Unable to install gentoo on arm64 architecture.
the step: ˋemerge --ask --update --deep --newuse @worldˋ fails.
Some packages cannot be compiled:

media-libs/libglvnd
media-libs/dav1d

Note: I'm installing it in chrooted environment on Android device. But this is not a problem, ArchLinux works well on the same device.

Reproducible: Always

Steps to Reproduce:
1. Download and extract stage3 tarball in arm64 device.
2. Select the desktop profile
3. Try to sync and update the @world or install any package after sync, like Firefox that depens on some media libraries.
Actual Results:  
libdav1d:

FAILED: src/libdav1d.so.5.0.1.p/arm_32_looprestoration_common.S.o                                                               aarch64-unknown-linux-gnu-gcc -Isrc/libdav1d.so.5.0.1.p -Isrc -I../dav1d-0.8.2/src -I. -I../dav1d-0.8.2 -Iinclude/dav1d -I../dav1d-0.8.2/include/dav1d -Iinclude -I../dav1d-0.8.2/include -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c99 -D_GNU_SOURCE -fvisibility=hidden -Wundef -Werror=vla -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-prototypes -mcpu=native -O2 -pipe -fPIC -pthread -MD -MQ src/libdav1d.so.5.0.1.p/arm_32_looprestoration_common.S.o -MF src/libdav1d.so.5.0.1.p/arm_32_looprestoration_common.S.o.d -o src/libdav1d.so.5.0.1.p/arm_32_looprestoration_common.S.o -c ../dav1d-0.8.2/src/arm/32/looprestoration_common.S                                            ../dav1d-0.8.2/src/arm/asm.S: Assembler messages:                                                                               ../dav1d-0.8.2/src/arm/asm.S:34: Error: unknown pseudo-op: `.syntax'                                                            ../dav1d-0.8.2/src/arm/asm.S:36: Error: unknown architecture `armv7-a'                                                                                                                                                                                          ../dav1d-0.8.2/src/arm/asm.S:37: Error: unknown pseudo-op: `.fpu'                                                               ../dav1d-0.8.2/src/arm/asm.S:38: Error: unknown pseudo-op: `.eabi_attribute'
...


libglvnd:

FAILED: src/GLdispatch/vnd-glapi/libglapi_opengl.a.p/entry_armv7_tsd.c.o                                                        aarch64-unknown-linux-gnu-gcc -Isrc/GLdispatch/vnd-glapi/libglapi_opengl.a.p -Isrc/GLdispatch/vnd-glapi -I../libglvnd-v1.3.3/src/GLdispatch/vnd-glapi -Iinclude -I../libglvnd-v1.3.3/include -Isrc/util -I../libglvnd-v1.3.3/src/util -Isrc/generate -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DUSE_ARMV7_ASM -DUSE_DISPATCH_ASM -DUSE_X11 -DHAVE_TYPEOF -DGLDISPATCH_USE_TLS -DUSE_ATTRIBUTE_CONSTRUCTOR -DHAVE_PTHREAD_RWLOCK -DHAVE_SYNC_INTRINSICS -DHAVE_MINCORE -DHAVE_RTLD_NOLOAD -DHAVE_DIRENT_DTYPE -DGLDISPATCH_ENABLE_PATCHING -DEGL_NO_X11 -mcpu=native -O2 -pipe -fPIC -DSTATIC_DISPATCH_ONLY '-DMAPI_ABI_HEADER="/var/tmp/portage/media-libs/libglvnd-1.3.3/work/libglvnd-v1.3.3-.arm64/src/generate/g_glapi_mapi_opengl_tmp.h"' -MD -MQ src/GLdispatch/vnd-glapi/libglapi_opengl.a.p/entry_armv7_tsd.c.o -MF src/GLdispatch/vnd-glapi/libglapi_opengl.a.p/entry_armv7_tsd.c.o.d -o src/GLdispatch/vnd-glapi/libglapi_opengl.a.p/entry_armv7_tsd.c.o -c ../libglvnd-v1.3.3/src/GLdispatch/vnd-glapi/entry_armv7_tsd.c                                                                                                 {standard input}: Assembler messages:                                                                                           {standard input}:5: Error: unknown pseudo-op: `.syntax'                                                                         {standard input}:9: Error: unknown pseudo-op: `.syntax'                                                                         {standard input}:15: Error: unknown pseudo-op: `.thumb_func'                                                                    {standard input}:20: Error: unknown mnemonic `push' -- `push {r0-r3}'                                                           {standard input}:21: Error: operand 1 must be an integer register -- `ldr r2,1f'                                                {standard input}:23: Error: operand 1 must be an integer or stack pointer register -- `add r2,pc'                               {standard input}:24: Error: operand 1 must be an integer register -- `ldr r3,1f+4'                                              {standard input}:25: Error: operand 1 must be an integer register -- `ldr r0,[r2,r3]'                                           {standard input}:26: Error: operand 1 must be an integer register -- `ldr r0,[r0]'                                              /var/tmp/portage/media-libs/libglvnd-1.3.3/temp/build.log lines 83-95/283525 0%
...
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-20 18:50:18 UTC
Could you please file a bug for each issue with the full build.log and emerge —-info?
Comment 2 Vasile M. 2021-08-20 18:56:01 UTC
Created attachment 734632 [details]
emerge --info
Comment 3 Vasile M. 2021-08-20 18:57:24 UTC
(In reply to Sam James from comment #1)
> Could you please file a bug for each issue with the full build.log and
> emerge —-info?

Of course. How can I edit or remove this bug?
Comment 4 Vasile M. 2021-08-20 19:16:37 UTC
Created attachment 734635 [details]
libglvnd build log
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-20 19:40:50 UTC
Hm, we need it to not pass '-DUSE_ARMV7_ASM' I assume.
Comment 6 Vasile M. 2021-08-20 19:43:51 UTC
Why appears armv7 if arm64 (aarch64) in Gentoo is no multilib?
How to force it to compile only lp64, armv8-a instructions?
Comment 7 Vasile M. 2021-08-26 22:46:29 UTC
I am the only one who uses Gentoo in ARM64?
How to install Gentoo from stage 3 tarball if the dependencies libglvnd and dav1d cannot be compiled?
Comment 8 Jory A. Pratt gentoo-dev 2021-08-26 23:04:23 UTC
(In reply to Vasile M. from comment #7)
> I am the only one who uses Gentoo in ARM64?
> How to install Gentoo from stage 3 tarball if the dependencies libglvnd and
> dav1d cannot be compiled?

I use arm64 musl on the x-c1 servers without an issue. Is there a reason your building 32bit instead of true 64bit arm64 support?
Comment 9 Vasile M. 2021-08-27 00:30:47 UTC
(In reply to Jory A. Pratt from comment #8)
> Is there a reason your building 32bit instead of true 64bit arm64 support?

I'm building 64bit. The stage 3 tarball is arm64.
I don't understand why that library is building with 32bit.

My CPU (Snapdragon 855, Android device)
Architecture:   armv8l
CPU op-mode(s): 32-bit, 64-bit

Is there a flag to force it to build in 64bit instruction set?
Comment 10 Jory A. Pratt gentoo-dev 2021-08-27 01:39:17 UTC
(In reply to Vasile M. from comment #9)
> (In reply to Jory A. Pratt from comment #8)
> > Is there a reason your building 32bit instead of true 64bit arm64 support?
> 
> I'm building 64bit. The stage 3 tarball is arm64.
> I don't understand why that library is building with 32bit.
> 
> My CPU (Snapdragon 855, Android device)
> Architecture:   armv8l
> CPU op-mode(s): 32-bit, 64-bit
> 
> Is there a flag to force it to build in 64bit instruction set?

use armv8-a if you want to execute in 64bit mode, armv8l tells it you want to execute 32bit mode
Comment 11 Vasile M. 2021-08-27 10:41:01 UTC
(In reply to Jory A. Pratt from comment #10)
> use armv8-a if you want to execute in 64bit mode, armv8l tells it you want
> to execute 32bit mode

I have tested this a long time ago, and I'm testing it again now.

"-march=armv8-a" produces the same error.
"-march=armv8-a -mabi=lp64", same error.
"-mcpu=native -mabi=lp64", same error.

Note: "-mcpu=armv8-a" produces a generic error (no error message) and no package can be compiled.
Comment 12 Vasile M. 2021-08-27 10:51:26 UTC
mcpu should be the cpu, not the architecture.

"-mcpu=cortex-a76", same error.
"-mcpu=kryo", same generic error.
"-mcpu=kryo485", same generic error.
Comment 13 Vasile M. 2021-08-27 11:51:24 UTC
With "-mcpu=kryo" and "kryo485" it builds 64bit, but the gnu assembler doesn't recognize the "kryo" and "kryo485" and it fails.
Changing it to "cortex-a76" it produces the same error by using 32bit asm.

Any ideas?
Comment 14 Vasile M. 2021-08-28 22:42:06 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.