From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51096 invoked by alias); 21 May 2019 16:15:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 51013 invoked by uid 89); 21 May 2019 16:15:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-6.0 required=5.0 tests=AWL,BAYES_00,KAM_COUK,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 spammy=it=e2, loader, HX-Languages-Length:1007, HX-Spam-Relays-External:ESMTPA?= X-HELO: smtp2.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp2.wavenetuk.net) (195.26.37.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 May 2019 16:15:36 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id 085296001A9; Tue, 21 May 2019 17:15:32 +0100 (BST) From: Iain Sandoe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: mfentry and Darwin. Message-Id: <975BF895-99C7-4249-A1CA-B4B69690E453@sandoe.co.uk> Date: Tue, 21 May 2019 16:15:00 -0000 Cc: gcc@gcc.gnu.org To: Uros Bizjak X-SW-Source: 2019-05/txt/msg00167.txt.bz2 Hi Uros, It seems to me that (even if it was working =E2=80=9Cproperly=E2=80=9D, whi= ch it isn't) =E2=80=98-mfentry=E2=80=99 would break ABI on Darwin for both= 32 and 64b - which require 16byte stack alignment at call sites. For Darwin, the dynamic loader enforces the requirement when it can and wil= l abort a program that tries to make a DSO linkage with the stack in an inc= orrect alignment. We previously had a bug against profiling caused by exac= tly this issue (but when the mcount call was in the post-prologue position). Actually, I=E2=80=99m not sure why it=E2=80=99s not an issue for other 64b = platforms that use the psABI (AFAIR, it=E2=80=99s only the 32b case that= =E2=80=99s Darwin-specific). Anyway, my current plan is to disable mfentry (for Darwin) - the alternativ= e might be some kind of =E2=80=9Calmost at the start of the function, but n= eeding some stack alignment change=E2=80=9D, I=E2=80=99m interested in if you know of any compelling use-cases that woul= d make it worth finding some work-around instead of disabling. thanks Iain