From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11984 Path: news.gmane.org!.POSTED!not-for-mail From: Khem Raj Newsgroups: gmane.linux.lib.musl.general Subject: Re: How to handle attempts to combine ARM Thumb with frame pointers? Date: Fri, 6 Oct 2017 18:24:18 -0700 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1507339511 9947 195.159.176.226 (7 Oct 2017 01:25:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Oct 2017 01:25:11 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11997-gllmg-musl=m.gmane.org@lists.openwall.com Sat Oct 07 03:25:04 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1e0drM-000111-CV for gllmg-musl@m.gmane.org; Sat, 07 Oct 2017 03:24:56 +0200 Original-Received: (qmail 12139 invoked by uid 550); 7 Oct 2017 01:25:01 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 12112 invoked from network); 7 Oct 2017 01:25:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=24xzccwMwsr67BQ5CAAz0VGG7EIY4L0zz6O1QyB8qEM=; b=Qkrg+wrGSmMfYVKXKUV6SlYmZbBncDGRK4ceM2N7CuERi86HymqM6G1P8ELlBwJKIQ /7gPIfU2CEJhvih8IX5oWVfwpfbxeO47qpp6i/frQmTN2oK0aylBD8sHmVpP99KOrAvi GpbNldgdaOxikqA+vALUaYpyeGp3aF5wO9Qf9Qocr/ts66bsCZmJcosHCTq6TbYyksnQ 6l8XV3ECHGfJR5JH+MnJgeVX8UlCbkBtlfRKkEHEo6TBTsMs4oQJVZ2RoKTu+JXRslvS 5I7WVByV73hAxd3sBDMU/lrMtktEUt1icQS7w05+6F+3P0HkTSAGn3UJNVDY6/R+Svs2 9Q/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=24xzccwMwsr67BQ5CAAz0VGG7EIY4L0zz6O1QyB8qEM=; b=t5y5OsIPW0pz95jBpfBHHlDqV2nGqBt7woQUYu2nVD4wJvPKQcs4heFPcLi0PQ7B9P ueVo0gqRLLQemmvdPE8jH5xxNEpZrd0WG6Vsp4xhuF+wMIsyhv2F5CdAEYElXD3mpI2p wR1mhBBax5h+y0HBiqrSRqElaFhmpEysiJg2fc3wd+cLVQvJIAHF0QrnHX20lDm1iLoM oncrXMhcQC4WYRWLcy9zROwd3geHfjjuU8rCj2ixz1y8PTN56uC1o07y+o+gR4MByERv fYGr8ejX/8Yl2MqM7psZRBoD63ecq7d53j+Wbyr9lRzZGIXZUR76axxRLd8nL9PH6Mys on9g== X-Gm-Message-State: AMCzsaWE6qUhNBPTZykc2Y7VFtKvbMZaHBrk6Ao40XEginy8lrW32eHb QxeZgw/VglmbXADDkRtTZotTvm3VwP4qkYv8kBlHww== X-Google-Smtp-Source: AOwi7QBqOqABR84jVCv8h5HG6oQjJAordLsV9yoTR+PPyz+GKUlF2sjjeY0UhRjhdNYkn6gEUelRLxEosZoqjHy8f2M= X-Received: by 10.98.202.138 with SMTP id y10mr3753319pfk.151.1507339488662; Fri, 06 Oct 2017 18:24:48 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11984 Archived-At: On Fri, Oct 6, 2017 at 5:53 PM, Andre McCurdy wrote: > When compiling for ARM Thumb or Thumb2 with frame pointers enabled (ie > -O0 or with -fno-omit-frame-pointer in CFLAGS) the frame pointer is > stored in r7, which leads to build errors ("error: r7 cannot be used > in asm here") whenever a syscall macro is included in a C function. > It's certainly a corner case, but one which I've run into recently. > > Would it be worth trying to catch this combination earlier and failing > from the configure script? It's not trivial to do reliably since I > think detecting whether or not frame pointers are going to be used by > examining CFLAGS means determining the effective optimisation level if > multiple -O0, -Os, etc options are given, together with the effective > outcome of potentially multiple -fno-omit-frame-pointer and > -fomit-frame-pointer options. > > I can work on a patch for the configure script but first wanted to > check what the philosophy is - should the configure script be trying > to catch every possible misconfiguration? I think these files assume that frame pointer is not stored, quick fix is to compile the specific file with -fomit-frame-pointer something like CFLAGS- = -fomit-frame-pointer