Issue 1856 in webm: Build failure for Android Armv7 not possible (invalid compiler parameters)

186 views
Skip to first unread message

rol… via monorail

unread,
Jun 11, 2024, 1:27:32 PMJun 11
to webm-d...@webmproject.org
Status: Untriaged
Owner: ----
Labels: Type-Bug Pri-2
Components: libvpx

New issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856

> What is the expected behavior? What do you see instead?
Compiling libvpx succeeds using Android NDK for armv7 architecture. Instead build fails at "as" stage with "Unknown command line argument" error.

> What version are you using? On what operating system?
- libvpx 1.12 and 1.14.1 (so a version spawning problem)
- Android NDK 26d
- GenToo, Ubuntu and Github Actions all show the same problem

> Can you reproduce using the vpxdec or vpxenc tools?
> What command line are you using?
I think not relevant. Bug happens while compiling vpx_dsp/arm/vpx_convolve8_horiz_filter_type2_neon.asm.S.o

> Please provide any additional information below.
https://pastebin.com/VUdj7AcT => Compile log with the compile command at the top (set environment variables, ./configure and make call)

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

rol… via monorail

unread,
Jun 11, 2024, 1:29:15 PMJun 11
to webm-d...@webmproject.org

Comment #1 on issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c1

Additional information. A previous compilation with Android NDK 21 worked. Chances are something changed in the LLVM compiler to make libvpx incompatible with Android NDK after an unknown specific version.

Also note an aarch64 build does succeed with the same Android NDK. It's only the armv7 that is not working anymore.

jz… via monorail

unread,
Jun 11, 2024, 4:24:33 PMJun 11
to webm-d...@webmproject.org

Comment #2 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c2

Thanks for the report. Older versions of the NDK had arm-linux-androideabi-as which could be used. There's no llvm-as support currently. As your log shows different flags need to be used:

```
llvm-as: Unknown command line argument '-march=armv7-a'. Try: '/opt/progs/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-asllvm-as: Unknown command line argument '-march=armv7-a'. Try: '/opt/progs/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as --help'
llvm-as: Did you mean '--d=armv7-a'?
...
```

If you want to use the latest NDK, a workaround would be to add `--disable-neon-asm` to your configure. This works for me with r26d.

jz… via monorail

unread,
Jun 11, 2024, 4:32:12 PMJun 11
to webm-d...@webmproject.org

Comment #3 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c3

Actually llvm-as isn't the right tool. clang's internal assembler can handle the files. Try AS="/opt/progs/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi29-clang" ASFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=neon -c'.

The defaults for ASFLAGS work, but since we're using the compiler we now need to add `-c`.

jz… via monorail

unread,
Jun 11, 2024, 4:33:42 PMJun 11
to webm-d...@webmproject.org

Comment #4 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c4

ASFLAGS=-c will be enough. libvpx will append the other flags.

Git Watcher via monorail

unread,
Jun 11, 2024, 6:56:10 PMJun 11
to webm-d...@webmproject.org

Comment #5 on issue 1856 by Git Watcher: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c5

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libvpx/+/fb01e53c989aa90e6555da325b75029b8afb2cf0

commit fb01e53c989aa90e6555da325b75029b8afb2cf0
Author: James Zern <jz...@google.com>
Date: Tue Jun 11 20:55:36 2024

configure: add -c to ASFLAGS for android + AS=clang

The GNU Assembler was removed in r24. clang's internal assembler works,
but `-c` is necessary to avoid linking.

Bug: webm:1856
Change-Id: I61f80cf78657d3b71d5e73c5b2510575533ca5ea

[modify] https://crrev.com/fb01e53c989aa90e6555da325b75029b8afb2cf0/build/make/configure.sh

rol… via monorail

unread,
Jun 11, 2024, 7:33:33 PMJun 11
to webm-d...@webmproject.org

Comment #6 on issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c6

Interestingly I can compile the entire game engine with various external libraries with the same export statements and it works. Only libvpx breaks. Curious to know what could be the reason. I don't think the other libraries have explicit support for Android NDK 26b.

jz… via monorail

unread,
Jun 11, 2024, 8:22:11 PMJun 11
to webm-d...@webmproject.org

Comment #7 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c7


> Interestingly I can compile the entire game engine with various external libraries with the same export statements and it works. Only libvpx breaks. Curious to know what could be the reason.

Do any of them have hand-written assembly? The neon assembly in libvpx uses Arm Developer Suite (ADS) syntax. The build converts this to GNU Assembler Syntax (GAS), so it needs a GNU assembler to build.

rol… via monorail

unread,
Jun 12, 2024, 1:37:52 PMJun 12
to webm-d...@webmproject.org

Comment #9 on issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c9

That seems to fix the problem.

jz… via monorail

unread,
Jun 12, 2024, 10:25:27 PMJun 12
to webm-d...@webmproject.org
Updates:
Status: Fixed

Comment #10 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c10

Thanks for testing it out. If you run into other issues please feel free to open a new bug.

If any of the other projects that you're building work without modification and they have handwritten assembly, please add them here. We can take a look at how they're handling the build.

rol… via monorail

unread,
Jun 13, 2024, 4:46:24 AMJun 13
to webm-d...@webmproject.org

Comment #11 on issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c11

I think they tend more to use NASM or something similar. You can take a look at the list of external libraries build by the game engine for projects you know that are using assembler: https://github.com/LordOfDragons/dragengine/tree/master/extern . Certainly libjpeg uses NASM as far as I know. Otherwise I don't really know who uses assembler as long as it compiles properly.

jz… via monorail

unread,
Jun 13, 2024, 1:34:13 PMJun 13
to webm-d...@webmproject.org

Comment #12 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c12

Thanks for the pointer. Note NASM and YASM are for x86, so we'd need to look at what is being done for arm if there is handwritten assembly.

jz… via monorail

unread,
Jun 13, 2024, 2:30:53 PMJun 13
to webm-d...@webmproject.org

Comment #13 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c13

When I try to compile libjpeg-turbo with `-D<r26d-ndk>/build/cmake/android.toolchain.cmake` I see:

```
-- GAS appears to be broken. Trying gas-preprocessor.pl ...
CMake Warning at simd/CMakeLists.txt:5 (message):
SIMD extensions disabled: GAS is not working properly. Performance will
suffer.
Call Stack (most recent call first):
simd/CMakeLists.txt:244 (simd_fail)
```

` -DCMAKE_ASM_COMPILER=armv7a-linux-androideabi<version>-clang` is necessary.

rol… via monorail

unread,
Jun 13, 2024, 4:50:15 PMJun 13
to webm-d...@webmproject.org

Comment #14 on issue 1856 by rol...@rptd.ch: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c14

This is strange. When I compile libjpeg-turbo using the game engine then this is all working fine: https://pastebin.com/jmWcUkjT .

jz… via monorail

unread,
Jun 13, 2024, 5:04:49 PMJun 13
to webm-d...@webmproject.org

Comment #15 on issue 1856 by jz...@google.com: Build failure for Android Armv7 not possible (invalid compiler parameters)
https://bugs.chromium.org/p/webm/issues/detail?id=1856#c15

That is strange.

You have:

```
-- Found assembler: /opt/progs/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- CMAKE_ASM_FLAGS = -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -Wformat -Werror=format-security -Wall -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -Wformat -Werror=format-security --target=armv7a-linux-androideabi29 -O3 -DNDEBUG
```

mine is:

```
-- Found assembler: .../android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- CMAKE_ASM_FLAGS = -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O3 -DNDEBUG
-- GAS appears to be broken. Trying gas-preprocessor.pl ...
CMake Warning at simd/CMakeLists.txt:5 (message):
SIMD extensions disabled: GAS is not working properly. Performance will
suffer.
Call Stack (most recent call first):
simd/CMakeLists.txt:244 (simd_fail)

```

I'm using cmake-3.28.3. In any case, it's not really an issue that we need to solve here.. The key difference is libjpeg-turbo is using cmake to detect the difference where libvpx is expecting the user to set CC/AS, etc. appropriately.
Reply all
Reply to author
Forward
0 new messages