From patchwork Fri Dec 2 22:04:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan-Teh Chang X-Patchwork-Id: 1662 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp519754vsa; Fri, 2 Dec 2016 14:05:26 -0800 (PST) X-Received: by 10.28.74.133 with SMTP id n5mr4641019wmi.132.1480716326195; Fri, 02 Dec 2016 14:05:26 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z3si4698656wme.12.2016.12.02.14.05.25; Fri, 02 Dec 2016 14:05:26 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DDB4D689F5C; Sat, 3 Dec 2016 00:05:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f48.google.com (mail-pg0-f48.google.com [74.125.83.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 587C16899F0 for ; Sat, 3 Dec 2016 00:05:07 +0200 (EET) Received: by mail-pg0-f48.google.com with SMTP id f188so111308447pgc.3 for ; Fri, 02 Dec 2016 14:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id; bh=gI2ZjC2wz0T4XZEB2b9G69bKRW7+pjUELO5gAwAI+oc=; b=KiHqFuBD8FwaBMl8XL//SNQtKo6Rcb76xQnmkZK+4Oup39FUZay6sF81C73V9eJqsu RRTC/yo2zWiVeAVotoF0RnxJkeSp6VJj90srFXsFgQFiOccHEaHxJBpl8sFdwphDJEsm K1KmtzJuLQWH8PDUbtHssQ82aUl43/JNjhGrU+RpmzcrytogeyOZxc+koYPm9UP89oX4 zyjtvWxxSQScGuDepTR9NMJrIvJpJkq9egIOIKIvYWI8ETJeQyH+c0EuD/gAVZZADLTw m/WOYdtbpN8En9vZKhmV3fgSZo2KANelAetUlam3JXgBRU7jC3OI3/T0VAfCUgvHrjgD +Xwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=gI2ZjC2wz0T4XZEB2b9G69bKRW7+pjUELO5gAwAI+oc=; b=NdcDnCidEGk+4rn5cfuacan0QOKX+M6EwibbCXvD1ctZnUqxBZmUiU9tqVzHOXlhHL cNQQOfxGPTw8bpYfAmbEdma9IG0blUq8RrCzj2jYBpM2daG+xcOESbiErUsgulhbBu+R juWAfhlMH48lVBYfdadieIbZ71Q9q9J+Y4c+yuNN+w5x7htIDXTnwqsPDWNqXxHfJsOo hZ75TBLS+dSdL2BVvE+QxNm4zE4Q/iZ/S80jWROr4wOVIRTJkY0eERV/QmH3u6DWlhMZ 1XeeH6Hosm06ikBZYNSQmI4hv8qLDnTVCWTWaG20+losedIM6a3ESbqx4dfkYSfMvHzG qiRg== X-Gm-Message-State: AKaTC00coKGUzRZQNHq4jSJO3l3pA+Xn4Bz1pa4GqwyNfD91B3C0uyL3anefweNrm+twSGxc X-Received: by 10.84.216.28 with SMTP id m28mr101741389pli.107.1480716313719; Fri, 02 Dec 2016 14:05:13 -0800 (PST) Received: from wtc-desktop.mtv.corp.google.com ([100.98.5.45]) by smtp.googlemail.com with ESMTPSA id y134sm9839487pfg.81.2016.12.02.14.05.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Dec 2016 14:05:13 -0800 (PST) From: Wan-Teh Chang To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Dec 2016 14:04:53 -0800 Message-Id: <1480716293-13606-1-git-send-email-wtc@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Subject: [FFmpeg-devel] [PATCH] configure: add -fPIE instead of -pie to C flags for ThreadSanitizer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" -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.hL61stP9.o /tmp/ffconf.YO6ZaSFG.c clang: warning: argument unused during compilation: '-pie' clang -fsanitize=thread -pie -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.W5c2e41l /tmp/ffconf.hL61stP9.o -lbz2 -pthread /usr/bin/ld: /tmp/ffconf.hL61stP9.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 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index ee473b9..0e1ae61 100755 --- a/configure +++ b/configure @@ -3523,7 +3523,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)