From patchwork Tue Oct 25 17:19:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1171 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp67942vsd; Tue, 25 Oct 2016 10:19:54 -0700 (PDT) X-Received: by 10.194.223.97 with SMTP id qt1mr17108670wjc.33.1477415994263; Tue, 25 Oct 2016 10:19:54 -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 yc1si23313899wjb.247.2016.10.25.10.19.53; Tue, 25 Oct 2016 10:19:54 -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 F332D689D99; Tue, 25 Oct 2016 20:19:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC951689BC0 for ; Tue, 25 Oct 2016 20:19:41 +0300 (EEST) Received: by mail-wm0-f68.google.com with SMTP id h8so1669166wmi.5 for ; Tue, 25 Oct 2016 10:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=jUsg2JwTTVdYpcEY672H3AmxDPj5scZUNgfmReK9Mhg=; b=r2nvCrsHOoIq25XxNyKF75+2EXS4fzKU864TrjeBKwNlYs9H35LFdC0CcCk402L+cI pKaoWVFsZ4abDAiC0sXTduTMtrkKHXR37+DJRUEFphNvmIRusV8bzjtyIHCIR3zMyHG5 6RqRk5879bTJalvO6UpnTxFuUdZp9qld9h7pEDCuF0tAV/SXfhcKD02mZ4YkBLH7YAx5 2SJMgLaTBBhjYu4fq8WcTEbnNWLjoslHKyzM+328UB5SfbZrVrNjPREbgiyweNbM8o9B gKwL10GTz1lpz3s8eWS8EGTORKZSnLaWybEgePk0LNgoX+t8LeScPElwioTWy4tBWorP +bCg== 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:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=jUsg2JwTTVdYpcEY672H3AmxDPj5scZUNgfmReK9Mhg=; b=lc6bVdR8Z+w8gg/z1Yiaa2ZXk0CAPdb7hRW8ezOJJiwUTvxE6aaiXU+iKLYDRwZRKK f8xqGZ9cRCrr5387WeV7ibVYquPa8KQ92HiRTWnmDRgXedYSFHR3NzFoFDAJotKMzHlW 494cK727rLoVeUeBK7ih/bmRWMUxrDrh1RJvVLGR3RI79vwE+0iubJtWaLg3GMqwbRJw u5s9uzQ3n3FeXnqe1JnrkSO7fP549IvXf+vvVH70/h9tfbTOxnPlwUwlbNK4U+ZwSZvI ZLMyqWSbO6v5pvD24nK+hX1MqW/t4LqQEsyg4GaanxcbBdooGrcuGR/+zAsii9msoV0i Ffwg== X-Gm-Message-State: ABUngveIBdt3jUDW4/ezsLieog9MDVjA6M7ORYI9yOcEziEMGqLtnA+j8snFCdeyUHengA== X-Received: by 10.28.63.6 with SMTP id m6mr4716923wma.22.1477415984442; Tue, 25 Oct 2016 10:19:44 -0700 (PDT) Received: from [192.168.2.21] (p5B095228.dip0.t-ipconnect.de. [91.9.82.40]) by smtp.googlemail.com with ESMTPSA id o62sm4771992wmg.9.2016.10.25.10.19.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 10:19:43 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: <8019a3b4-c436-a2fa-8d58-b7d387af4190@googlemail.com> Date: Tue, 25 Oct 2016 19:19:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 Subject: [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" 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..14a20ed 100755 --- a/configure +++ b/configure @@ -1147,8 +1147,14 @@ check_func_headers(){ for hdr in $headers; do print_include $hdr done + # LTO could optimize out the test functions without this + echo "#if defined(__GNUC__) && __GNUC__ >= 4" + echo " #define USED __attribute__((used))" + echo "#else" + echo " #define USED" + echo "#endif" for func in $funcs; do - echo "long check_$func(void) { return (long) $func; }" + echo "USED long check_$func(void) { return (long) $func; }" done echo "int main(void) { return 0; }" } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers