dsnote icon indicating copy to clipboard operation
dsnote copied to clipboard

AUR package build error in ffmpeg

Open moriartynz opened this issue 11 months ago • 2 comments

The issue

When it compiles the ffmpeg library, it throws a fatal error in relation to the assembler code in lpc_init.c, which code uses pd_1. in the movsd commands. The error is: undefined reference to 'pd_1'.

This issue happens with both the git and non-git AUR packages.

My research

I'm no coding expert. Googling these errors, it appears it may be related to the fact that a static .a file is being produced, as opposed to a shared library.

Compilation log

There are so many warnings that my scrollback window doesn't get anywhere near the start of the compilation. Here is the relevant end-bit, though:

[ 93%] Linking CXX executable dsnote
/usr/src/debug/dsnote-git/dsnote/src/espeak_engine.cpp:70:8: warning: type ‘struct callback_data’ violates the C++ One Definition Rule [-Wodr]
/usr/src/debug/dsnote-git/dsnote/src/rhvoice_engine.cpp:184:8: note: a different type is defined in another translation unit
/usr/src/debug/dsnote-git/dsnote/src/espeak_engine.cpp:71:20: note: the first difference of corresponding definitions is field ‘engine’
/usr/src/debug/dsnote-git/dsnote/src/rhvoice_engine.cpp:185:21: note: a field of same name but different type is defined in another translation unit
/usr/src/debug/dsnote-git/dsnote/src/espeak_engine.hpp:18:7: note: type name ‘espeak_engine’ should match type name ‘rhvoice_engine’
/usr/src/debug/dsnote-git/dsnote/src/rhvoice_engine.hpp:28:7: note: the incompatible type is defined here
In function ‘spx_strategy’,
    inlined from ‘decode_audio_block’ at external/ffmpeg/src/libavcodec/ac3dec.c:1150:24:
external/ffmpeg/src/libavcodec/ac3dec.c:862:37: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  862 |             s->channel_uses_spx[ch] = get_bits1(bc);
      |                                     ^
external/ffmpeg/src/libavcodec/ac3dec.h: In function ‘decode_audio_block’:
external/ffmpeg/src/libavcodec/ac3dec.h:144: note: at offset 7 into destination object ‘channel_uses_spx’ of size 7
  144 |     uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension        (chinspx)
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c: In function ‘read_sbr_grid’:
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [2147483649, 4294967295] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [2147483649, 4294967294] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [2147483649, 4294967293] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
In function ‘spx_strategy’,
    inlined from ‘decode_audio_block’ at external/ffmpeg/src/libavcodec/ac3dec.c:1150:24:
external/ffmpeg/src/libavcodec/ac3dec.c:862:37: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  862 |             s->channel_uses_spx[ch] = get_bits1(bc);
      |                                     ^
external/ffmpeg/src/libavcodec/ac3dec.h: In function ‘decode_audio_block’:
external/ffmpeg/src/libavcodec/ac3dec.h:144: note: at offset 7 into destination object ‘channel_uses_spx’ of size 7
  144 |     uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension        (chinspx)
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c: In function ‘read_sbr_grid’:
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [-2147483647, -1] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [-2147483647, -2] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
external/ffmpeg/src/libavcodec/aacsbr_template.c:736:57: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  736 |             ch_data->t_env[ch_data->bs_num_env - 1 - i] =
      |                                                         ^
external/ffmpeg/src/libavcodec/sbr.h:108: note: at offset [-2147483647, -3] into destination object ‘t_env’ of size 8
  108 |     uint8_t            t_env[8];
      | 
/usr/bin/ld: /tmp/cc9B9HGf.ltrans69.ltrans.o: warning: relocation against `pd_1' in read-only section `.text'
/usr/bin/ld: /tmp/cc9B9HGf.ltrans69.ltrans.o: in function `lpc_compute_autocorr_sse2.lto_priv.0':
/usr/src/debug/dsnote-git/dsnote/build/external/ffmpeg/src/libavcodec/x86/lpc_init.c:78:(.text+0x150): undefined reference to `pd_1'
/usr/bin/ld: /usr/src/debug/dsnote-git/dsnote/build/external/ffmpeg/src/libavcodec/x86/lpc_init.c:78:(.text+0x158): undefined reference to `pd_1'
/usr/bin/ld: /usr/src/debug/dsnote-git/dsnote/build/external/ffmpeg/src/libavcodec/x86/lpc_init.c:47:(.text+0x1b7): undefined reference to `pd_1'
/usr/bin/ld: /usr/src/debug/dsnote-git/dsnote/build/external/ffmpeg/src/libavcodec/x86/lpc_init.c:47:(.text+0x1bf): undefined reference to `pd_1'
/usr/bin/ld: /usr/src/debug/dsnote-git/dsnote/build/external/ffmpeg/src/libavcodec/x86/lpc_init.c:47:(.text+0x1c7): undefined reference to `pd_1'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dsnote.dir/build.make:1871: dsnote] Error 1
make[1]: *** [CMakeFiles/Makefile2:272: CMakeFiles/dsnote.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: dsnote-git-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
dsnote-git - exit status 4

System Information

OS: Arch Linux x86_64 Kernel: 6.8.1-arch1-1 Shell: bash 5.2.26 DE: Plasma 6.0.2 WM: kwin Theme: [Plasma], Breeze-Dark [GTK2], Breeze [GTK3] Icons: [Plasma], breeze-dark [GTK2/3] CPU: Intel i7-7700HQ (8) @ 3.800GHz GPU: Intel HD Graphics 630 GPU: NVIDIA GeForce GTX 1050 Mobile clang: version 17.0.6, Target: x86_64-pc-linux-gnu, Thread model: posix

moriartynz avatar Mar 21 '24 07:03 moriartynz

Thanks for the report.

Indeed, AUR build is currently failing. This is not the only problem actually. Even if you managed to build it, you won't be able to install the package due to missing dependencies.

Arch is a rolling distro and changing all the time. These kind of problems are somewhat "expected". I will try to fix this soon.

Similar issue: https://github.com/mkiol/dsnote/issues/108

mkiol avatar Mar 22 '24 06:03 mkiol

Fix: d8acd11884bc48b4b1c3f0209acab93291f3600d

mkiol avatar Mar 29 '24 17:03 mkiol

Issue is now resolved in dsnote-git package.

Sorry that it took so long.

mkiol avatar May 22 '24 05:05 mkiol