Issue 1801 in webm: Build failure with `--enable-shared` and ASan

191 views
Skip to first unread message

brigh… via monorail

unread,
May 12, 2023, 7:16:39 AM5/12/23
to webm-d...@webmproject.org
Status: Untriaged
Owner: ----
Labels: Type-Bug Pri-2
Components: libvpx

New issue 1801 by brigh...@gmail.com: Build failure with `--enable-shared` and ASan
https://bugs.chromium.org/p/webm/issues/detail?id=1801

Reproduce:
cd build
source ../tools/set_analyzer_env.sh address
../configure --enable-shared
make -j10

What is the expected behavior? What do you see instead?
There should be a libvpx.so linked with AddressSanitizer.

But i saw undefined reference error.
/usr/bin/ld: pickinter.c:(.text+0x5e5f): undefined reference to `__asan_report_load4'
/usr/bin/ld: ^Cmake[1]: *** Deleting file 'libvpx.so.8.0.0'

What version are you using? On what operating system?
version: git main
os: centos 7
clang: 15.0.0

Please provide any additional information below.

I guess this problem might be libvpx built with conflict flags with Asan.

Asan usage:
The AddressSanitizer run-time library should be linked to the final executable, so make sure to use clang (not ld) for the final link step. When linking shared libraries, the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link errors (don’t use it with AddressSanitizer).

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

jz… via monorail

unread,
May 12, 2023, 1:19:29 PM5/12/23
to webm-d...@webmproject.org
Updates:
Owner: jz...@google.com
Status: Assigned

Comment #1 on issue 1801 by jz...@google.com: Build failure with `--enable-shared` and ASan
https://bugs.chromium.org/p/webm/issues/detail?id=1801#c1

Thanks for filing the bug. I followed up with a change after seeing the one in libaom [1]. It will land today. I'll add this bug as a reference.

[1] https://chromium-review.googlesource.com/c/webm/libvpx/+/4521540

Git Watcher via monorail

unread,
May 12, 2023, 3:24:11 PM5/12/23
to webm-d...@webmproject.org
Updates:
Status: Fixed

Comment #2 on issue 1801 by Git Watcher: Build failure with `--enable-shared` and ASan
https://bugs.chromium.org/p/webm/issues/detail?id=1801#c2

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libvpx/+/2a9b810d3df62ff3c527ce3895f6b80d9d6f6296

commit 2a9b810d3df62ff3c527ce3895f6b80d9d6f6296
Author: James Zern <jz...@google.com>
Date: Mon May 08 23:58:59 2023

Don't use -Wl,-z,defs with Clang's sanitizers

This avoids link errors related to the sanitizers:
https://clang.llvm.org/docs/AddressSanitizer.html#usage

"When linking shared libraries, the AddressSanitizer run-time is not
linked, so -Wl,-z,defs may cause link errors ..."

See also:
https://crbug.com/aomedia/3438

Bug: webm:1801
Fixed: webm:1801
Change-Id: Ie212318005a5f7222e5486775175534025306367

[modify] https://crrev.com/2a9b810d3df62ff3c527ce3895f6b80d9d6f6296/build/make/Makefile
Reply all
Reply to author
Forward
0 new messages