From patchwork Tue Oct 25 23:35:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1174 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp206538vsd; Tue, 25 Oct 2016 16:35:44 -0700 (PDT) X-Received: by 10.194.110.73 with SMTP id hy9mr10556401wjb.139.1477438544248; Tue, 25 Oct 2016 16:35:44 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p16si6791150wma.90.2016.10.25.16.35.43; Tue, 25 Oct 2016 16:35:44 -0700 (PDT) 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=@googlemail.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; dmarc=fail (p=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3F3B689D38; Wed, 26 Oct 2016 02:35:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7D9E689CBE for ; Wed, 26 Oct 2016 02:35:32 +0300 (EEST) Received: by mail-wm0-f67.google.com with SMTP id m83so2283783wmc.6 for ; Tue, 25 Oct 2016 16:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=gToZVWQulKqwwLpy1NOBauBDv2cEEsIWW9teYJmJcdY=; b=RT29uKVERveupSSdcRYDCjz2bfMaru/TKAH966twM3DHu9M6E9C2kJx+8S61TJwSC8 5vSc5mHlbSERhUMvEzRy3ma2CU7sqoFNAUkw0CmSV4rX74kgsPheO0Xdt8Oh1v9Y6tJv +YXStW7I0NwYDcbkvVIRHlE9mUJsi6tCU7tzCze/crJrQmI2h//jpyOx+Vf0CCXlh9TO hts0lwLlHORRU0nPSiLrdx5wSOl4gRTtlca6jf2y2GRfxcYvvmWKKip3N4ozyR2ob92B jw+6ufmOaK1s+fJHQgt+FUGiZkwYWbvYprhwCmbfr+dcxH4rxX14myAfHCOla/WPhBfp FWpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=gToZVWQulKqwwLpy1NOBauBDv2cEEsIWW9teYJmJcdY=; b=i81VGu24WvFEB51C6VZoZ/AjWv8q7P7aWmWyOI7HFuValz18gH7RdGnnHSMJxfxJRR GTM1zHTi32pcoSpcStO5LSs0nU41KsJZrpZgFLOPXZQFt/InmbmwfTONkl3rptoewGv0 /u8FhCwx/R/vMRKOS74RdMmsRNF+CKGFfCxBoeUpMbPX0/P7rk4hC+FfOvFTFM2jgkMH Y3DFaQToOEG2b2YOlS7FEIYqgRwbQ+RrfPUkAkFXSzmjpUwMt6ULLx5oSgIAI6X13xgs 2nA4Q0w+oF5nAiRhyQt6HTnemSQCX8GxAYo1PtUW0eQCpzgFjDTFsOaukb16aB9xvC0s 4sxQ== X-Gm-Message-State: ABUngvdiXTttD1/0AK4JNjRIuqvq+Mqa23YZZA/Zdhw+EzkWNViqpCkq7ORSwzPR7VqTCQ== X-Received: by 10.194.142.116 with SMTP id rv20mr18639312wjb.184.1477438535446; Tue, 25 Oct 2016 16:35:35 -0700 (PDT) Received: from [192.168.2.21] (p5B095228.dip0.t-ipconnect.de. [91.9.82.40]) by smtp.googlemail.com with ESMTPSA id g9sm27627289wjk.25.2016.10.25.16.35.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 16:35:34 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: ffmpeg-devel@ffmpeg.org References: <8019a3b4-c436-a2fa-8d58-b7d387af4190@googlemail.com> <3cc24b4a-a4f4-ea25-501c-46c02ef68cd4@googlemail.com> <20161025232625.GS4602@nb4> Message-ID: Date: Wed, 26 Oct 2016 01:35:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161025232625.GS4602@nb4> Subject: Re: [FFmpeg-devel] [PATCH] configure: make sure LTO does not optimize out the test functions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 26.10.2016 01:26, Michael Niedermayer wrote: > On Wed, Oct 26, 2016 at 01:16:13AM +0200, Andreas Cadhalpun wrote: >> configure | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> 742684cf379693d08075d43fdfb75ed5e2e936c6 0001-configure-make-sure-LTO-does-not-optimize-out-the-te.patch >> From bb289a0b2b0948afa99227bcff188301c1143624 Mon Sep 17 00:00:00 2001 >> From: Andreas Cadhalpun >> Date: Tue, 25 Oct 2016 19:09:46 +0200 >> Subject: [PATCH] configure: make sure LTO does not optimize out the test >> functions >> >> Fixes trac ticket #5909 >> >> Bud-Id: https://bugs.gentoo.org/show_bug.cgi?id=598054 >> Signed-off-by: Andreas Cadhalpun >> --- >> configure | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/configure b/configure >> index 481f692..54faef1 100755 >> --- a/configure >> +++ b/configure >> @@ -1150,7 +1150,12 @@ check_func_headers(){ >> for func in $funcs; do >> echo "long check_$func(void) { return (long) $func; }" >> done >> - echo "int main(void) { return 0; }" >> + echo "int main(void) { int ret = 0;" >> + # LTO could optimize out the test functions without this >> + for func in $funcs; do >> + echo " ret |= ((intptr_t)check_$func) & 0xFFFF;" >> + done >> + echo "return ret; }" > > breaks configure > > i get this: > > ERROR: LoadLibrary/dlopen not found for avisynth I forgot to include stdint.h. Fixed patch attached. Best regards, Andreas Acked-by: Michael From 3f062e381b69c8e9b59f6caa700c23deaec53b45 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Tue, 25 Oct 2016 19:09:46 +0200 Subject: [PATCH] configure: make sure LTO does not optimize out the test functions Fixes trac ticket #5909 Bud-Id: https://bugs.gentoo.org/show_bug.cgi?id=598054 Signed-off-by: Andreas Cadhalpun --- configure | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 481f692..5ee78eb 100755 --- a/configure +++ b/configure @@ -1147,10 +1147,16 @@ check_func_headers(){ for hdr in $headers; do print_include $hdr done + echo "#include " for func in $funcs; do echo "long check_$func(void) { return (long) $func; }" done - echo "int main(void) { return 0; }" + echo "int main(void) { int ret = 0;" + # LTO could optimize out the test functions without this + for func in $funcs; do + echo " ret |= ((intptr_t)check_$func) & 0xFFFF;" + done + echo "return ret; }" } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers } -- 2.9.3