xiph/rnnoise

Clashing symbols with Opus

Krzmbrzl opened this issue · 5 comments

Hi,
We are developing a program (Mumble) that uses Opus as well as RNNoise. The issue we are facing is that RNNoise seems to define some symbols that are identical to Opus, causing a linker error like this one:

src/mumble/rnnoise/librnnoise.a(rnn.c.o): In function `compute_dense':
rnn.c:(.text+0x0): multiple definition of `compute_dense'
/home/user/MumbleBuild/vcpkg/installed/x64-linux/lib/libopus.a(mlp.c.o):mlp.c:(.text+0x0): first defined here
src/mumble/rnnoise/librnnoise.a(rnn.c.o): In function `compute_gru':
rnn.c:(.text+0x590): multiple definition of `compute_gru'
/home/user/MumbleBuild/vcpkg/installed/x64-linux/lib/libopus.a(mlp.c.o):mlp.c:(.text+0x690): first defined here
src/mumble/rnnoise/librnnoise.a(kiss_fft.c.o): In function `opus_fft_impl':
kiss_fft.c:(.text+0x2900): multiple definition of `opus_fft_impl'
/home/user/MumbleBuild/vcpkg/installed/x64-linux/lib/libopus.a(kiss_fft.c.o):kiss_fft.c:(.text+0x0): first defined here
src/mumble/rnnoise/librnnoise.a(kiss_fft.c.o): In function `opus_fft_c':
kiss_fft.c:(.text+0x39d0): multiple definition of `opus_fft_c'
/home/user/MumbleBuild/vcpkg/installed/x64-linux/lib/libopus.a(kiss_fft.c.o):kiss_fft.c:(.text+0x1090): first defined here
src/mumble/rnnoise/librnnoise.a(kiss_fft.c.o): In function `opus_ifft_c':
kiss_fft.c:(.text+0x3a30): multiple definition of `opus_ifft_c'
/home/user/MumbleBuild/vcpkg/installed/x64-linux/lib/libopus.a(kiss_fft.c.o):kiss_fft.c:(.text+0x1110): first defined here

Given that there even is a clash on something like opus_fft_impl I can't help but think that maybe some parts of the Opus code were used in this project without altering their name?

Without knowing any details about the code structure here, my suggestion would be to either rename those functions within RNNoise (e.g. prefix with rnnoise_) or exclude these functions (e.g. via preprocessor) if one also intends to link against Opus.

/cc @davidebeatrici

More specifically, we load Opus at runtime.

The problem is that we link to libsndfile, which internally links to Opus.

According to 3fe8622, the code is directly imported from Opus.

I just noticed that there seems to be an issue on GitLab that goes in the same direction.

Same problem happens when there is some dependency on Opus. Any update on resolving this issue?

I'm running into the same problem. Any updates over last year?

Not that I am aware of