Project

General

Profile

Wrong 'as' invocation for libvpx

Added by John Levine about 3 years ago

I am trying to build tvheadend on a Raspberry PI 4 (Debian Buster).

The problem is that libvpx assembly files are attempted compilation with 'as' instead of Yasm, no matter what I try.

Things I have tried:
  • building v4.3
  • building master
  • using Autobuild.sh
  • using different configure options
  • manually specifying --as=yasm in the libvpx Makefile

No matter what I try I keep getting the below error. The 'as' that comes with binutils cannot understand -DENABLE_xxx and the command would be anyways wrong for Yasm.

Any help would be welcome!

make -f Makefile.ffmpeg libcacheget
make[1]: Entering directory '/home/pi/workspaces/tvheadend'
make[1]: Leaving directory '/home/pi/workspaces/tvheadend'
make -f Makefile.ffmpeg build
make[1]: Entering directory '/home/pi/workspaces/tvheadend'
cd /home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0 && \
    ASFLAGS="-DENABLE_PIC=1 -DPIC=1" FFMPEG_PREFIX=/home/pi/workspaces/tvheadend/build.linux/ffmpeg/build/ffmpeg PKG_CONFIG=/home/pi/workspaces/tvheadend/support/pkg-config.ffmpeg ./configure --prefix=/ffmpeg --enable-static --disable-shared \
    --extra-cflags="-fPIE" \
    --disable-examples \
    --disable-docs \
    --disable-unit-tests \

  disabling shared
  disabling examples
  disabling docs
  disabling unit_tests
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'armv7-linux-gcc'
  enabling armv7
  enabling neon
  enabling neon_asm
  enabling webm_io
  enabling libyuv
Creating makefiles for armv7-linux-gcc libs
Creating makefiles for armv7-linux-gcc tools
DIST_DIR=/home/pi/workspaces/tvheadend/build.linux/ffmpeg/build/ffmpeg \
    make -C /home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0 install
make[2]: Entering directory '/home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0'
    [DEP] vpx_config.c.d
    [CC] vpx_config.c.o
    [AS] vpx_dsp/arm/intrapred_neon_asm.asm.S.o
as: invalid option -- 'E'
make[3]: *** [Makefile:200: vpx_dsp/arm/intrapred_neon_asm.asm.S.o] Error 1
make[2]: *** [Makefile:17: .DEFAULT] Error 2
make[2]: Leaving directory '/home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0'
make[1]: *** [Makefile.ffmpeg:332: /home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0/.tvh_build] Error 2
make[1]: Leaving directory '/home/pi/workspaces/tvheadend'
make: *** [Makefile:853: /home/pi/workspaces/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2


Replies (16)

RE: Wrong 'as' invocation for libvpx - Added by saen acro about 3 years ago

Only solution for last 4 years is to disable libVPX support

  --disable-libvpx               Disable libvpx
  --disable-libvpx_static        Disable libvpx_static

RE: Wrong 'as' invocation for libvpx - Added by Dave Pickles about 3 years ago

Do you actually need to build your own version of ffmpeg? If you build Tvheadend with the --disable-ffmpeg-static configure option, it will use your distribution's ffmpeg version (if installed).

Below is my cut-down set of configure options which work on Pi 2/3/4.

--disable-libav \
--disable-libvpx \
--disable-libvpx_static \
--enable-libx265 \
--disable-libx264_static \
--disable-libx265_static \
--disable-libvorbis \
--disable-libvorbis_static \
--disable-libtheora_static \
--disable-libtheora \
--disable-libopus \
--disable-libopus_static \
--disable-ffmpeg_static \
--disable-ffmpeg \
--disable-libfdkaac-static \
--disable-hdhomerun_static \
--disable-hdhomerun_client \
--disable-satip_server \
--disable-satip_client \
--disable-imagecache \
--disable-cwc \
--disable-cccam \
--disable-capmt \
--disable-constcw \
--enable-ddci \
--enable-iptv \
--disable-avahi

RE: Wrong 'as' invocation for libvpx - Added by John Levine about 3 years ago

saen acro wrote:

Only solution for last 4 years is to disable libVPX support
[...]

The TVH GitHub repository seems quite active, any chance we can change the defaults so that it does not try to build by default something that has been broken for 4 years?

I ended up using the configure from https://github.com/linuxserver/docker-tvheadend/blob/master/Dockerfile#L154, thanks for the pointers

RE: Wrong 'as' invocation for libvpx - Added by John Levine about 3 years ago

I removed the version I built because it shows a black screen with audio for all channels; I saw that there are a couple open issues about this.

RE: Wrong 'as' invocation for libvpx - Added by saen acro about 3 years ago

John Levine wrote:

I removed the version I built because it shows a black screen with audio for all channels; I saw that there are a couple open issues about this.

You use build-in web interface to watch?

Enable OMX and make OMX-H264 + AAC profile

RE: Wrong 'as' invocation for libvpx - Added by John Levine about 3 years ago

saen acro wrote:

John Levine wrote:

I removed the version I built because it shows a black screen with audio for all channels; I saw that there are a couple open issues about this.

You use build-in web interface to watch?

Enable OMX and make OMX-H264 + AAC profile

I use the web interface to test it but was planning to use it via HTSP; I will try with --enable-omx. The build automation could detect it's a Raspberry and do that as well?

RE: Wrong 'as' invocation for libvpx - Added by Luis Mendes almost 3 years ago

The assembler fails with:

make[2]: Entering directory '/home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0'
    [DEP] vpx_config.c.d
    [CC] vpx_config.c.o
    [AS] vpx_dsp/arm/intrapred_neon_asm.asm.S.o
as: invalid option -- 'E'
make[3]: *** [Makefile:200: vpx_dsp/arm/intrapred_neon_asm.asm.S.o] Error 1
make[2]: *** [Makefile:17: .DEFAULT] Error 2
make[2]: Leaving directory '/home/pi/workspaces/tvheadend/build.linux/ffmpeg/libvpx-1.9.0'

but it is either because the GNU Assembler (gas) is being used, instead of nasm (conjecture), or
neither gas, nor nasm support:

ASFLAGS="-DENABLE_PIC=1 -DPIC=1" 

, instead one should use:
ASFLAGS="--defsym ENABLE_PIC=1 --defsym PIC=1" 

These changes can be placed in Makefile.ffmpeg and will result in a successful compilation.ls

Example Makefile.ffmpeg in attachment.

Makefile.ffmpeg (18.4 KB) Makefile.ffmpeg Example usage of ASFLAGS with --defsym

RE: Wrong 'as' invocation for libvpx - Added by Flole Systems almost 3 years ago

Thank you very much for investigating this. Just to confirm: When it's changed to

ASFLAGS="--defsym ENABLE_PIC=1 --defsym PIC=1" 

it will work on all assemblers that you're aware of or would we break support for one that is currently working?

RE: Wrong 'as' invocation for libvpx - Added by Luis Mendes almost 3 years ago

I cannot guarantee... I can only test on PC platforms either Linux aarch64, Linux armhf, or Linux x64. So not sure for Windows, Linux, Mac OS...

RE: Wrong 'as' invocation for libvpx - Added by Luis Mendes almost 3 years ago

Anyway there is always the option to make it conditional on the platform...

RE: Wrong 'as' invocation for libvpx - Added by Flole Systems almost 3 years ago

I've changed it now as I think the majority of assemblers should support it. If it breaks anything we need to make it conditional.

RE: Wrong 'as' invocation for libvpx - Added by adam jon almost 3 years ago

Is the issue solved now?

RE: Wrong 'as' invocation for libvpx - Added by Luis Mendes almost 3 years ago

I've just tested against git master and it is fixed for me.

RE: Wrong 'as' invocation for libvpx - Added by Christof Emde almost 3 years ago

Unfortunately this change does not work for me. I am on Debian GNU/Linux 11 (bullseye), 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux. A simple compile always worked with just

./Autobuild.sh
whereas I am normally using
AUTOBUILD_CONFIGURE_EXTRA="--disable-hdhomerun_client --disable-hdhomerun_static --disable-imagecache --disable-satip_server --disable-avahi" ./Autobuild.sh
which also always worked for years now. When I now try to compile with either of the above lines it fails at this spoint:
Configuring for target 'x86_64-linux-gcc'
  enabling x86_64
  enabling runtime_cpu_detect
  enabling mmx
  enabling sse
  enabling sse2
  enabling sse3
  enabling ssse3
  enabling sse4_1
  enabling avx
  enabling avx2
  enabling avx512
  using nasm
nasm --defsym ENABLE_PIC=1 --defsym PIC=1 -f elf64 does not support section alignment (nasm <=2.08?)

Configuration failed. This could reflect a misconfiguration of your
toolchains, improper options selected, or another problem. If you
don't see any useful error messages above, the next step is to look
at the configure error log file (config.log) to determine what
configure was trying to do when it died.
make[3]: *** [Makefile.ffmpeg:335: /usr/src/tvheadend/build.linux/ffmpeg/libvpx-1.9.0/.tvh_build] Fehler 1
make[3]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
make[2]: *** [Makefile:853: /usr/src/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Fehler 2
make[2]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
make[1]: *** [debian/rules:15: override_dh_auto_build] Fehler 2
make[1]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
make: *** [debian/rules:6: build] Fehler 2
dpkg-buildpackage: Fehler: Unterprozess debian/rules build lieferte Exitstatus 2
using
AUTOBUILD_CONFIGURE_EXTRA="--disable-hdhomerun_client --disable-hdhomerun_static --disable-imagecache --disable-satip_server --disable-avahi --disable-libvpx" ./Autobuild.sh
to compile solves the problem. So that I am now in the same situation where the whole discussion started 6 month ago, as I am forced to use --disable-libvpx.
Changing
ASFLAGS="--defsym ENABLE_PIC=1 --defsym PIC=1" $(CONFIGURE) \
back to
ASFLAGS="-DENABLE_PIC=1 -DPIC=1" $(CONFIGURE) \
in Makefile.ffmpeg solves the problem in that it compiles nicely as before but results for what reason ever in a dirty version.
dpkg-deb: Paket »tvheadend-dbg« wird in »../tvheadend-dbg_4.3-1994~gc7b713edb-dirty_amd64.deb« gebaut.
dpkg-deb: Paket »tvheadend« wird in »../tvheadend_4.3-1994~gc7b713edb-dirty_amd64.deb« gebaut.
make[1]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../tvheadend_4.3-1994~gc7b713edb-dirty_amd64.changes
dpkg-genchanges: Information: Binärpaket(e) hochzuladen (kein Quellcode enthalten)
 dpkg-source --after-build .
dpkg-buildpackage: Information: Binärpaket(e) hochzuladen (keine Quelle enthalten)
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend_4.3-1994~gc7b713edb-dirty_amd64.deb:deb:application/x-deb:tvheadend_4.3-1994~gc7b713edb-dirty_amd64.deb
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend-dbg_4.3-1994~gc7b713edb-dirty_amd64.deb:deb:application/x-deb:tvheadend-dbg_4.3-1994~gc7b713edb-dirty_amd64.deb
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend_4.3-1994~gc7b713edb-dirty_amd64.changes:changes:text/plain:tvheadend_4.3-1994~gc7b713edb-dirty_amd64.changes

RE: Wrong 'as' invocation for libvpx - Added by Christof Emde almost 3 years ago

Does not seem to be the issue. When I compile with

AUTOBUILD_CONFIGURE_EXTRA="--disable-hdhomerun_client --disable-hdhomerun_static --disable-satip_server" ./Autobuild.sh
Compilation fails with
  ...
  using nasm
nasm --defsym ENABLE_PIC=1 --defsym PIC=1 -f elf64 does not support section alignment (nasm <=2.08?)

Configuration failed. This could reflect a misconfiguration of your
toolchains, improper options selected, or another problem. If you
don't see any useful error messages above, the next step is to look
at the configure error log file (config.log) to determine what
configure was trying to do when it died.
make[3]: *** [Makefile.ffmpeg:335: /usr/src/tvheadend/build.linux/ffmpeg/libvpx-1.9.0/.tvh_build] Fehler 1
make[3]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
...
as it uses the downloaded version libvpx-1.9.0. When I add --disable-libvpx_static and compile with
 AUTOBUILD_CONFIGURE_EXTRA="--disable-hdhomerun_client --disable-hdhomerun_static --disable-satip_server --disable-libvpx_static" ./Autobuild.sh
compilation succeeds
...
dpkg-deb: Paket »tvheadend-dbg« wird in »../tvheadend-dbg_4.3-1994~gc7b713edb_amd64.deb« gebaut.
dpkg-deb: Paket »tvheadend« wird in »../tvheadend_4.3-1994~gc7b713edb_amd64.deb« gebaut.
make[1]: Verzeichnis „/usr/src/tvheadend“ wird verlassen
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../tvheadend_4.3-1994~gc7b713edb_amd64.changes
dpkg-genchanges: Information: Binärpaket(e) hochzuladen (kein Quellcode enthalten)
 dpkg-source --after-build .
dpkg-buildpackage: Information: Binärpaket(e) hochzuladen (keine Quelle enthalten)
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend_4.3-1994~gc7b713edb_amd64.deb:deb:application/x-deb:tvheadend_4.3-1994~gc7b713edb_amd64.deb
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend-dbg_4.3-1994~gc7b713edb_amd64.deb:deb:application/x-deb:tvheadend-dbg_4.3-1994~gc7b713edb_amd64.deb
doozer-versioned-artifact:/usr/src/tvheadend/../tvheadend_4.3-1994~gc7b713edb_amd64.changes:changes:text/plain:tvheadend_4.3-1994~gc7b713edb_amd64.changes
although the locally installed version of libvpx-dev is also only at 1.9.0-1
# apt list libvpx-dev --installed
Auflistung… Fertig
libvpx-dev/stable,now 1.9.0-1 amd64  [installiert]

Therefore, as it always compiled nicely before that config change and also compiles nicely with the locally installed version, it is in my view not a version issue. In any case I can handle it.

    (1-16/16)