X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id E86C8DC012D for ; Sun, 19 May 2013 18:15:35 +0000 (UTC) Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 755B02084D for ; Sun, 19 May 2013 14:15:33 -0400 (EDT) Received: from web3.nyi.mail.srv.osa ([10.202.2.213]) by compute5.internal (MEProxy); Sun, 19 May 2013 14:15:33 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date; s=smtpout; bh=vwbANStUlWe05FFXE6kZR6VNs2Q=; b=Cv9mnaCxZE/vJ/EBUy8RZ+0umLqX P7UIvNY3Wt94SmuUCDqxyZpRRRCWwtiHcMpOhyRSFIc5yzpKXDrpeVxppKEZxYl5 FI48xvV03dM/jEA1ya8SWju/Sw43GkbdUXQEFrO7wAV3c9lD6e0VhefWSiiMcc12 jX/dLMdJ6QLPGV4= Received: by web3.nyi.mail.srv.osa (Postfix, from userid 99) id 0B9E75E15AB; Sun, 19 May 2013 14:15:33 -0400 (EDT) Message-Id: <1368987332.22675.140661233004329.596433CC@webmail.messagingengine.com> X-Sasl-Enc: dg1J155CEoJLTKUzXkpJ+4JUmt+5wfg1y/wo5/GTSDLd 1368987332 From: Dubiousjim To: Alpine X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - html Subject: Re: [alpine-devel] Bunch of questions about Alpine's gcc package Date: Sun, 19 May 2013 14:15:32 -0400 On Sun, May 19, 2013 at 01:08:29PM +0200, Natanael Copa wrote: > > > --enable-cld > > http://en.wikipedia.org/wiki/Direction_flag > I think this was the reason: > http://lwn.net/Articles/272048/ http://gcc.gnu.org/install/configure.html says: --enable-cld This option enables -mcld by default for 32-bit x86 targets. See ?i386 and x86-64 Options? in the main manual That is, this reverts to the behavior that GCC implemented before v3.4.0. (Explained in the LWN article linked above.) The cross-reference in "the main manual" says: http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/i386-and-x86_002d64-Options.html says: -mcld This option instructs GCC to emit a cld instruction in the prologue of functions that use string instructions. String instructions depend on the DF flag to select between autoincrement or autodecrement mode. While the ABI specifies the DF flag to be cleared on function entry, some operating systems violate this specification by not clearing the DF flag in their exception dispatchers. The exception handler can be invoked with the DF flag set, which leads to wrong direction mode when string instructions are used. This option can be enabled by default on 32-bit x86 targets by configuring GCC with the --enable-cld configure option. Generation of cld instructions can be suppressed with the -mno-cld compiler option in this case. Reading the comments on the LWN article, it looks like this issue was fixed in the Linux kernel soon after it arose. See http://marc.info/?l=git-commits-head&m=120492000901739&w=2 (committed in 2008). And indeed, the 3.9.2 kernel sources have: ./arch/x86/kernel/signal.c-678- * Clear the direction flag as per the ABI for function entry. ./arch/x86/kernel/signal.c-679- */ ./arch/x86/kernel/signal.c:680: regs->flags &= ~X86_EFLAGS_DF; So as far as I can see, we can drop this configure flag on GCC and go with the behavior introduced in gcc 4.3.0 (conforming to the ABI spec). People using GCC with non-Linux kernels, or 2008-or-older versions of the Linux kernel, are the ones who may need it. This judgment is based on my reading the above sources, and some things they link to. Others may be better-informed. --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---