[FFmpeg-cvslog] configure: add -fPIE instead of -pie to C flags for ThreadSanitizer

Wan-Teh Chang git at videolan.org
Thu Apr 13 23:04:30 EEST 2017


ffmpeg | branch: master | Wan-Teh Chang <wtc at google.com> | Fri Dec  2 11:27:17 2016 -0800| [f22da2cdf90dc892d483e2d4003cffc0500816f6] | committer: Luca Barbato

configure: add -fPIE instead of -pie to C flags for ThreadSanitizer

-pie was added to C flags for ThreadSanitizer in commit
19f251a2882a8d0779b432e63bf282e4d9c443bb. Under clang 3.8.0, the -pie
flag causes a compiler warning and a linker error when running configure
--toolchain=clang-tsan. Here is an excerpt from config.log:

clang ... -fsanitize=thread -pie -std=c11 -fomit-frame-pointer -pthread -c -o /tmp/ffconf.A8SsaoCF.o /tmp/ffconf.JdpujQlD.c
clang: warning: argument unused during compilation: '-pie'
clang -fsanitize=thread -pie -Wl,--as-needed -o /tmp/ffconf.2iYA4bsw /tmp/ffconf.A8SsaoCF.o -lm -lm -lbz2 -lz -pthread
/usr/bin/ld: /tmp/ffconf.A8SsaoCF.o: relocation R_X86_64_PC32 against undefined symbol `atan2f@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To be conservative, I changed -pie to -fPIE. But the documentation seems
to imply just -fsanitize=thread is enough:

http://clang.llvm.org/docs/ThreadSanitizer.html
https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual

Signed-off-by: Wan-Teh Chang <wtc at google.com>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f22da2cdf90dc892d483e2d4003cffc0500816f6
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 4c11e5e033..1183090613 100755
--- a/configure
+++ b/configure
@@ -2819,7 +2819,7 @@ case "$toolchain" in
     ;;
     *-tsan)
         cc_default="${toolchain%-tsan}"
-        add_cflags  -fsanitize=thread -pie
+        add_cflags  -fsanitize=thread -fPIE
         add_ldflags -fsanitize=thread -pie
         case "$toolchain" in
             gcc-tsan)



More information about the ffmpeg-cvslog mailing list