Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945750 - media-libs/webrtc-audio-processing-0.3.1-r1: Fatal error relocating /lib/libwebrtc_audio_processing.so.1: __mulsc3 [and __divsc3]: symbol not found
Summary: media-libs/webrtc-audio-processing-0.3.1-r1: Fatal error relocating /lib/libw...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-02 15:12 UTC by aryan
Modified: 2025-01-07 08:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,15.91 KB, text/plain)
2024-12-02 15:12 UTC, aryan
Details
media-libs/webrtc-audio-processing-1.3-r3 build.log (build.log,501.58 KB, text/x-log)
2024-12-03 11:48 UTC, aryan
Details
fresh emerge --info (emerge_info.txt,14.70 KB, text/plain)
2024-12-04 12:57 UTC, aryan
Details
media-libs/webrtc-audio-processing-0.3.1-r1 build.log (build.log,443.90 KB, text/x-log)
2024-12-04 18:01 UTC, aryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aryan 2024-12-02 15:12:20 UTC
Created attachment 913073 [details]
emerge --info

When doing ldd /lib/libwebrtc_audio_processing.so.1 I have this output:

   ldd (0x734bb0afa000)
	/usr/local/lib/libhardened_malloc.so => /usr/local/lib/libhardened_malloc.so (0x734bb09fb000)
	libc++.so.1 => /lib/libc++.so.1 (0x734bb08ee000)
	libc++abi.so.1 => /lib/libc++abi.so.1 (0x734bb08aa000)
	libc.so => ldd (0x734bb0afa000)
	libunwind.so.1 => /lib/libunwind.so.1 (0x734bb089d000)
Error relocating /lib/libwebrtc_audio_processing.so.1: __mulsc3: symbol not found
Error relocating /lib/libwebrtc_audio_processing.so.1: __divsc3: symbol not found

I am on a musl system and I heard from someone that these symbols are gcc specific? I don't have gcc on my system and so far I am not experiencing any issues on applications other than net-im/dino(+rtp), which won't launch with this issue being present.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-02 15:16:26 UTC
__mulsc3 and __divsc3 are builtins. They should be provided by libgcc or by compiler-rt.

Please share the build log from webrtc-processing.
Comment 2 aryan 2024-12-03 11:48:15 UTC
Created attachment 913227 [details]
media-libs/webrtc-audio-processing-1.3-r3 build.log

Here is the build.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-03 11:56:14 UTC
> LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro"

Please don't do -Wl,-z,defs willy-nilly. Ditto -ftrapv. Almost all the rest are defaults on hardened profiles anyway. -fcf-protection is also pointless on musl where it does no enforcement.

Anyway, I suggest building webrtc-audio-processing manually from a git clone, then inspecting with `nm` to see where the first references to __mulsc3 and __divsc3 appear.

Given the current state of your system as discussed earlier, I don't think this makes sense as a bug at this point.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-03 13:06:04 UTC
I don't think that log corresponds to your ldd output either (different SONAME).

Anyway, you really need to figure out why __divsc3 and friends are left unresolved. compiler-rt should have them (check with `nm`). If it does, why isn't it being linked?

I also bet if you try to reproduce this in a clean chroot, you won't be able to, which will tell us it's something else about your system. Please try that.
Comment 5 aryan 2024-12-03 13:19:21 UTC
Thanks I will remove -fcf-protection=full and -Wl,-z,defs from my flags. I set the other ones since I am not on a hardened profile just musl-llvm.

There was an error with the version of webrtc-audio-processing its actually 0.3.1-r1 that owns /lib/libwebrtc_audio_processing.so.1 and not 1.3-r3 (which has no issues whatsoever). I have taken the source files and compiled them manually to check with nm.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-03 13:24:23 UTC
(In reply to aryan from comment #5)
> Thanks I will remove -fcf-protection=full and -Wl,-z,defs from my flags. I
> set the other ones since I am not on a hardened profile just musl-llvm.
> 

Most of those are still on by default as of 23.0: https://wiki.gentoo.org/wiki/Hardened/Toolchain#Changes.

> There was an error with the version of webrtc-audio-processing its actually
> 0.3.1-r1 that owns /lib/libwebrtc_audio_processing.so.1 and not 1.3-r3
> (which has no issues whatsoever). I have taken the source files and compiled
> them manually to check with nm.

Please share the right log. But really, do that chroot experiment (and record the steps you take so I can reproduce).
Comment 7 aryan 2024-12-04 12:51:48 UTC
I have now created a new system using this stage3 https://distfiles.gentoo.org/releases/arm64/autobuilds/current-stage3-arm64-musl-llvm/stage3-arm64-musl-llvm-20241201T233522Z.tar.xz

I have then edited make.conf to add my make.conf flags etc then emerged world just like the installation steps have told me to.

Then I did emerge -1 \=media-libs/webrtc-audio-processing-0.3.1-r1 then have done ldd /lib/libwebrtc_audio_processing.so to obtain this output:

	ldd (0x7b7dd19c2000)
	/usr/local/lib/libhardened_malloc.so => /usr/local/lib/libhardened_malloc.so (0x7b7dd18c3000)
	libc++.so.1 => /lib/libc++.so.1 (0x7b7dd17b6000)
	libc++abi.so.1 => /lib/libc++abi.so.1 (0x7b7dd1772000)
	libc.so => ldd (0x7b7dd19c2000)
	libunwind.so.1 => /lib/libunwind.so.1 (0x7b7dd1765000)
Error relocating /lib/libwebrtc_audio_processing.so: __mulsc3: symbol not found
Error relocating /lib/libwebrtc_audio_processing.so: __divsc3: symbol not found

I will post the new emerge --info as well as the build.log
Comment 8 aryan 2024-12-04 12:57:03 UTC
Created attachment 913294 [details]
fresh emerge --info
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-04 12:57:56 UTC
Please also then repeat the steps to refine it and minimise the CFLAGS etc needed.
Comment 10 aryan 2024-12-04 13:19:01 UTC
(In reply to Sam James from comment #9)
> Please also then repeat the steps to refine it and minimise the CFLAGS etc
> needed.

Thank you I am now recompiling world with:

# Compilation

## Options
MAKEOPTS="--jobs 4"

## Flags

### Compiler Flags
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"

### CPU Flags
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"

# Portage

## Flags
ACCEPT_KEYWORDS="~amd64"

## Options
BINPKG_COMPRESS="zstd"
BINPKG_FORMAT="gpkg"

CHOST="x86_64-pc-linux-musl"
LC_MESSAGES=C.utf8

NOCOLOR="false"

GENTOO_MIRRORS="https://mirror.init7.net/gentoo/"

DISTDIR="/var/cache/distfiles/"
PKGDIR="/var/cache/binpkgs/"
PORTDIR="/var/db/repos/gentoo/"
PORTAGE_TMPDIR="/var/tmp/"

UNINSTALL_IGNORE="${UNINSTALL_IGNORE} /bin/ /lib/ /sbin/ /usr/sbin/"
UNINSTALL_IGNORE="${UNINSTALL_IGNORE} /usr/lib/modules/*"

# Logging
PORTAGE_ELOG_CLASSES="warn error log"
PORTAGE_ELOG_SYSTEM="save"
Comment 11 aryan 2024-12-04 18:01:23 UTC
Created attachment 913302 [details]
media-libs/webrtc-audio-processing-0.3.1-r1 build.log

Here is the updated build log.
Comment 12 aryan 2024-12-04 18:01:56 UTC
ldd /lib/libwebrtc_audio_processing.so
        ldd (0x7b27e61f3000)
        libc++.so.1 => /lib/libc++.so.1 (0x7b27e6023000)
        libc++abi.so.1 => /lib/libc++abi.so.1 (0x7b27e5fe5000)
        libc.so => ldd (0x7b27e61f3000)
        libunwind.so.1 => /lib/libunwind.so.1 (0x7b27e5fd9000)
Error relocating /lib/libwebrtc_audio_processing.so: __mulsc3: symbol not found
Error relocating /lib/libwebrtc_audio_processing.so: __divsc3: symbol not found

This is the output of ldd.
Comment 13 Mike Gilbert gentoo-dev 2024-12-05 20:33:41 UTC
(In reply to aryan from comment #7)
> I have now created a new system using this stage3
> https://distfiles.gentoo.org/releases/arm64/autobuilds/current-stage3-arm64-
> musl-llvm/stage3-arm64-musl-llvm-20241201T233522Z.tar.xz

This stage tarball is for arm64, but your other comments look like an amd64 config. Did you provide the wrong link?
Comment 14 aryan 2024-12-05 20:35:48 UTC
(In reply to Mike Gilbert from comment #13)
> (In reply to aryan from comment #7)
> > I have now created a new system using this stage3
> > https://distfiles.gentoo.org/releases/arm64/autobuilds/current-stage3-arm64-
> > musl-llvm/stage3-arm64-musl-llvm-20241201T233522Z.tar.xz
> 
> This stage tarball is for arm64, but your other comments look like an amd64
> config. Did you provide the wrong link?

Yes silly me I meant amd64 https://gentoo.osuosl.org/releases/amd64/autobuilds/current-stage3-amd64-musl-llvm/stage3-amd64-musl-llvm-20241201T164824Z.tar.xz
Comment 15 aryan 2024-12-05 20:39:30 UTC
However, I also believe if anyone has a musl/llvm system without needing to change any configurations and compiling media-libs/webrtc-audio-process-0.3.1-r1, this would be reproducible if gcc is not installed and the binutils-plugin is not enabled for llvm.
Comment 16 aryan 2025-01-07 08:35:28 UTC
I can confirm that the symbols are present in compiler-rt

$ nm /usr/lib/clang/19/lib/linux/libclang_rt.builtins-x86_64.a | grep -E '(__mulsc3|__divsc3)'
0000000000000000 T __divsc3
0000000000000000 T __mulsc3

It seems like an issue with how media-libs/webrtc-audio-processing:0 is being built. I am aware that they changed that process in media-libs/webrtc-audio-processing:1 as the issue is not present there but I believe in this version it could be that glibc manages to handle the issue and resolve the symbols itself whereas with musl it does not (suggested by parona).