From patchwork Wed Dec 14 15:47:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 1781 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp237507vsa; Wed, 14 Dec 2016 07:48:22 -0800 (PST) X-Received: by 10.28.23.16 with SMTP id 16mr8259319wmx.134.1481730502752; Wed, 14 Dec 2016 07:48:22 -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 hc8si54883851wjc.214.2016.12.14.07.48.21; Wed, 14 Dec 2016 07:48:22 -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=@gmail.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=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A27168992F; Wed, 14 Dec 2016 17:48:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wj0-f193.google.com (mail-wj0-f193.google.com [209.85.210.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60309689880 for ; Wed, 14 Dec 2016 17:48:06 +0200 (EET) Received: by mail-wj0-f193.google.com with SMTP id he10so5518054wjc.2 for ; Wed, 14 Dec 2016 07:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=rZo2ToiQ/oZqoKCkrkpKuHD0/u6BdK2MExHXxDsMy/o=; b=bR56FZzbe7NpJnE14oRj8Hp4WU12uWnP/2Xn25Yuo298vrpMrS9BOz+NcXVM6EVV8t 4yi2lg4m2ZrgQ29MieniSjdoK3vNviOnkt0yr6nKS/1NR0rrT4449iIw3IC3+WojpPKS GTU2DmH2R/VZD3W1MKIrc8uEg7N9tzmTZibJDB35otWj8ixp0gDo/9n+U2i0B5HdEQ+F yUG5oK2u90DkF32Z1EzSWp83nnQjIc2TLI57mP/g77lL4DhqfLELFHn9k82vlG4RBeDe /ps4TWssuIlnIar4XrT1jHmpcQcVpd3yymjZFQ33IfohCpeDO8T/5ssLJ7FRqlvDNxq8 yWIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rZo2ToiQ/oZqoKCkrkpKuHD0/u6BdK2MExHXxDsMy/o=; b=o95QdZHb8oV87JSv+J8y7cPaEtkSYEvYd4G/tTTGQ1Mv7FagLTLvTZxH8MisRbszpB q9uaFE3ym7a792CF8Hu4Bn+iIHpnS+0am/nsLcePhFFpiZgGHF0niwwr7EW5lTTQ8QvJ ofCtgF5yEWWTT7rbXAPWxAvx3NO5cwmMOqySqftPlbKiinP9zN8mQUVZp3O2/Lxa8H2u 6TLFqDMUTzkUnpB32zFNj8dUxKx1pLwB7ekMGvGfcZJZnljYBr96/BXg6wZ+KRy4IVnJ g4T0pkOsRV152lij6yZ7/rW1ol/fatNcDnOH2QiwVkNa4+7NOceNsQgjw94iU/9cMwjW J1Qg== X-Gm-Message-State: AKaTC00cPAAKpeR2AvOhorgsfEuhaxu46lJIXbR9Q/HL1A+BikJyCcQsd60PYeXuFB0fkw== X-Received: by 10.194.21.35 with SMTP id s3mr88757375wje.192.1481730491779; Wed, 14 Dec 2016 07:48:11 -0800 (PST) Received: from localhost.localdomain (2a01cb0c000ea900e039b034dc116c26.ipv6.abo.wanadoo.fr. [2a01:cb0c:e:a900:e039:b034:dc11:6c26]) by smtp.gmail.com with ESMTPSA id n17sm67860801wjq.6.2016.12.14.07.48.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Dec 2016 07:48:10 -0800 (PST) From: Steve Lhomme X-Google-Original-From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Dec 2016 16:47:56 +0100 Message-Id: <20161214154756.22116-1-robUx4@gmail.com> X-Mailer: git-send-email 2.10.2 Subject: [FFmpeg-devel] [PATCH] configure: fix linking with MSVC when using --disable-optimizations 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 Cc: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme Without any optimization flags, MSVC does no dead code elimination (DCE) at all, even for the most trivial cases. DCE is a prerequisite for building ffmpeg correctly, otherwise there are undefined references to functions for other architectures and disabled components. -Os -Og is the minimal optimization flags for MSVC that does include DCE. It warns that -Og will be removed but it doesn't work without. -O1 includes these flags and some other ones not necessary to link properly. --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 9dfd006..1a8a05c 100755 --- a/configure +++ b/configure @@ -4087,6 +4087,7 @@ probe_cc(){ _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" _cflags_size="-O1" + _cflags_noopt="-Os -Og" if $_cc -nologo- 2>&1 | grep -q Linker; then _ld_o='-out:$@' else