From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11985 Path: news.gmane.org!.POSTED!not-for-mail From: Andre McCurdy 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:41:27 -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 1507340503 10340 195.159.176.226 (7 Oct 2017 01:41:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Oct 2017 01:41:43 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11998-gllmg-musl=m.gmane.org@lists.openwall.com Sat Oct 07 03:41:38 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 1e0e7S-0001cT-6O for gllmg-musl@m.gmane.org; Sat, 07 Oct 2017 03:41:34 +0200 Original-Received: (qmail 32118 invoked by uid 550); 7 Oct 2017 01:41:39 -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 32084 invoked from network); 7 Oct 2017 01:41:39 -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=ItgF7meHicMCEoKPu+JGPs3brBJz2hHCfw3cN/qTN4Q=; b=C19X6CZ2E5KY7U6sfsMNNoowy8xHUMDrcntcdGrPyMZfKg3BTlON4HiPh5oR15Izjq IqcZA4AWk5NydEJYGliPC4XHQTX+v03vqkbjllfVmTNRB6/aU6GUaBR4uMCSZtbsoSsP 18ylEgFvVYbJlSYy+7c/d67W/MEBiu8fVvDXTdC97Pq+8rzPnxHGcR5bffLROKw4Yzvw XUFoZs+79vfhiyXdHm/MATZPTYXXJHOPUxPdep7CUu9NfpF+37nlqXYv4dXGCdNbuL9e W2kmv1+zkFEt9x9En/pJq2eVuTqgldPSNpWnBBcqBrjPquEfveVayhhnyN9/RFJeYGaY NZIA== 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=ItgF7meHicMCEoKPu+JGPs3brBJz2hHCfw3cN/qTN4Q=; b=qoDJNxthXMvGjk7rlMZPUo2bSbzIwad4f5zxskvElEWmXYfwM+vAW9Tw5OJ9ZPTQF/ VNxbIzYxVjunXN/2r3KJ8y1njnYeXDhWTAd5C7+xeIJ++y+5lSdS9sDBfLa/bvJy+j3q KKUw91bk4c/mlGxju7WM81LszHrhahpgI2p3icmVKCe4bF5ymsK4HD3vSlqgs2vgN3gP kLGk3Us3RxcZ2G1EpC4KWfuJfZEKZKGPSeMIAgIXr5jzXcyCz2E1/1v6wQ4ENQPmu8Fz 3OiLRdfpQhTY7tYKzl3q/n2GAhmUyGfsxMIHjI8rH5n64Xdm++jBKobe9+43AgZZS2Jx 5KoQ== X-Gm-Message-State: AMCzsaWk2vKpepQxqJV7xF05/tAbEpNsh++FuCMXRJTeQ/5Ajjxyin5h YGtl4avKOOTERfpSPKayRzX2nAOkkV8FC2Szu/dJYA== X-Google-Smtp-Source: AOwi7QAvWi9Z5dyZC/3uT9q8r2QyKrRhsGeuWqkzVIP97sRI+BDXy2kCRT5WwBUnLuh+c7X54OWZZT1xRwbQHxB9iik= X-Received: by 10.28.91.75 with SMTP id p72mr3115766wmb.89.1507340487650; Fri, 06 Oct 2017 18:41:27 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11985 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? Sorry to reply to my own thread, but it looks like this long standing clang bug may actually be due to this same issue: http://clang-developers.42468.n3.nabble.com/Bug-in-ARM-Thumb-inline-asm-td4043905.html https://bugs.llvm.org/show_bug.cgi?id=34165 The only real difference being that where gcc aborts with an error about reusing r7, clang silently generates broken code :-(