Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference to opus_select_arch #327

Open
BKPepe opened this issue Mar 24, 2024 · 2 comments
Open

Undefined reference to opus_select_arch #327

BKPepe opened this issue Mar 24, 2024 · 2 comments

Comments

@BKPepe
Copy link

BKPepe commented Mar 24, 2024

Hey guys,

Recently in OpenWrt master branch @krant updated opus to the latest version and wanted to use Meson in commit openwrt/packages@6c3db5d.

However, after some time and properly being tested, he found out that there are some issues with Meson for some targets in OpenWrt:

[135/168] Linking target src/libopus.so.0.10.0
FAILED: src/libopus.so.0.10.0 
arm-openwrt-linux-muslgnueabi-gcc  -o src/libopus.so.0.10.0 src/libopus.so.0.10.0.p/opus.c.o src/libopus.so.0.10.0.p/opus_decoder.c.o src/libopus.so.0.10.0.p/opus_encoder.c.o src/libopus.so.0.10.0.p/extensions.c.o src/libopus.so.0.10.0.p/opus_multistream.c.o src/libopus.so.0.10.0.p/opus_multistream_encoder.c.o src/libopus.so.0.10.0.p/opus_multistream_decoder.c.o src/libopus.so.0.10.0.p/repacketizer.c.o src/libopus.so.0.10.0.p/opus_projection_encoder.c.o src/libopus.so.0.10.0.p/opus_projection_decoder.c.o src/libopus.so.0.10.0.p/mapping_matrix.c.o src/libopus.so.0.10.0.p/analysis.c.o src/libopus.so.0.10.0.p/mlp.c.o src/libopus.so.0.10.0.p/mlp_data.c.o -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/lib -Wl,--as-needed -Wl,--no-undefined -fuse-ld=bfd -shared -fPIC -Wl,--start-group -Wl,-soname,libopus.so.0 -Wl,--whole-archive celt/libopus-celt.a silk/libopus-silk.a -Wl,--no-whole-archive -fuse-ld=bfd -znow -zrelro -lm -Wl,--end-group
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_decoder.c.o: in function `opus_decoder_init':
opus_decoder.c:(.text+0x11c8): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_decoder.c.o: in function `opus_dred_decoder_init':
opus_decoder.c:(.text+0x1ee0): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_encoder.c.o: in function `opus_encoder_init':
opus_encoder.c:(.text+0x2174): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_multistream_encoder.c.o: in function `opus_multistream_encoder_init_impl':
opus_multistream_encoder.c:(.text+0x224): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/analysis.c.o: in function `tonality_analysis_init':
analysis.c:(.text+0x236c): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/celt_decoder.c.o:celt_decoder.c:(.text+0x2db8): more undefined references to `opus_select_arch' follow
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/pitch.c.o: in function `pitch_search':
pitch.c:(.text+0xd60): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/celt_lpc.c.o: in function `_celt_autocorr':
celt_lpc.c:(.text+0xea0): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/init_decoder.c.o: in function `silk_reset_decoder':
init_decoder.c:(.text+0x24): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/fixed_burg_modified_FIX.c.o: in function `silk_burg_modified_c':
burg_modified_FIX.c:(.text+0xc64): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/fixed_pitch_analysis_core_FIX.c.o: in function `silk_pitch_analysis_core':
pitch_analysis_core_FIX.c:(.text+0xfc0): undefined reference to `CELT_PITCH_XCORR_IMPL'
collect2: error: ld returned 1 exit status

I am not sure why he could not reach you and discuss his issue with you guys, but maybe he is just shy, or he does not like me at all. Haha! 😆 😆 We could keep this in our repository, but I am afraid that you would not like it.

Could you please look at the issue we are dealing with? Otherwise, we will get back to using autotools as he proposed in openwrt/packages#23727

@jmvalin
Copy link
Member

jmvalin commented Mar 24, 2024

I assume you're using the latest git (main)? Can you give mode details on the exact meson command you're using and provide the generated config.h? For the symbols to be missing, it means either 1) celt/arm/armcpu.c and celt/arm/arm_celt_map.c didn't get compiled, or 2) they were compiled but the defines caused the symbols not to be defined. Can you check which of those is the case? In general, anything with your build that would be different from a 32-bit RPi build?
Regarding autotools, I'd say that if possible, it might actually be a better option since it's better tested than the other build systems. That being said, I still intend on fixing this meson issue.

@BKPepe
Copy link
Author

BKPepe commented Apr 7, 2024

@krant Kind reminder to look at this issue, which you reported to us in OpenWrt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants