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

Build error when enable sanitizer option in latest commit code #2045

Closed
3 tasks done
occia opened this issue Jan 16, 2022 · 1 comment
Closed
3 tasks done

Build error when enable sanitizer option in latest commit code #2045

occia opened this issue Jan 16, 2022 · 1 comment

Comments

@occia
Copy link

occia commented Jan 16, 2022

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/


I tried build the gpac latest commit (9a79be3, Fri Jan 14 19:28:16 2022) with sanitizer enabled. However, the compilation failed due to undefined reference to _DYNAMIC.
Detailed fail results are sth like the following:

make[1]: Leaving directory '/src/projects/gpac-9a79be3f64/gpac/src'
make -C applications all
make[1]: Entering directory '/src/projects/gpac-9a79be3f64/gpac/applications'
set -e; for i in gpac mp4box  ; do make -C $i all; done
make[2]: Entering directory '/src/projects/gpac-9a79be3f64/gpac/applications/gpac'
  CC main.c
afl-cc ++3.12c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: LLVM-PCGUARD
SanitizerCoveragePCGUARD++3.12c
[+] Instrumented 1898 locations with no collisions (non-hardened mode).
afl-cc ++3.12c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: LLVM-PCGUARD
/usr/bin/ld: /usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
/usr/bin/ld: /usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_linux.cpp.o): in function `__asan::AsanDoesNotSupportStaticLinkage()':
(.text._ZN6__asan31AsanDoesNotSupportStaticLinkageEv+0x3): undefined reference to `_DYNAMIC'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:56: gpac] Error 1
make[2]: Leaving directory '/src/projects/gpac-9a79be3f64/gpac/applications/gpac'
make[1]: *** [Makefile:41: apps] Error 2

I mainly follow this wiki and here are the build commands:

./configure --static-mp4box --prefix=./install --enable-sanitizer --enable-afl --enable-afl-clang --cc=afl-clang-fast --cxx=afl-clang-fast++
make

May you help on this? Thank you.

@jeanlf jeanlf closed this as completed in 2a14bfc Jan 17, 2022
@jeanlf
Copy link
Member

jeanlf commented Jan 17, 2022

--static-bin (new name for --static-mp4box) will generate a complete static executable (except on osx), not compatible with asan usage. I patched the configure to throw a warning and disable static build when asan is used.

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