Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp987938imd; Sat, 3 Nov 2018 14:58:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5fdPyjIWNkJnSHVcVGcw0Gs9eRKCVxODoPfTD9S23bU+vbRq9+/rAx0vKVBn2wsc6Gs+aIT X-Received: by 2002:a62:3301:: with SMTP id z1-v6mr16299280pfz.85.1541282294355; Sat, 03 Nov 2018 14:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541282294; cv=none; d=google.com; s=arc-20160816; b=03RixOKH3687whg/pLxV10teRAWzOtja+IWoXEf9WNofc6cf7aB6lNS4j8MqgGWwdf fO1d0b+/VOIEDh8Z4KYnwIRXUivZ0lZvtMjEupINr/5zq7bzF4/DU1H8Sb24KDnBESL4 VW8h2FWY1X8vLhjaeF7coqub5mVcjCnwWIp1GZNlMCakHrzan7wgcW3YjWq1fULk92JZ a6/YFgVj8RrlVA8xVmqmftkMTt/2MrfysTVikYYV+sNwdImJRuzzktZMwkSJf1TrkQsV IoFFu0vjql3V3iGyWpvCMlPt55zbqEmcWzdiENRDhScc9Wcmtr9j6OuMbKad/nfdJVnv 1qpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=/4QSxRfWA4eUmLWjxNBtXcxsBRsNWL9AR5jtvVrGzgA=; b=JPaB5bSy1I69d/80D497wFtOL8jLFK8Uh4ENAIdmU9kLvjojbdJhdasINMw8E3h7zM dRKD4ZfEmsOj3MqCL/p3oO+R5TM72SNZD79z+OkfRJKGWYaiMgQ2u9wS+OFwSKuETu9X x5byu8vqeudg6soV/CKUuWGtrEGbWpBWyBe12eX6nUltSuxSaTxSsNYI/EVpA61Q6ouH SLyRt3fzUU64TxzW6cZZ1fhAy8yqoo1MHGiOWa0eYrzXOk0GqR0ehmel1vqKyrB6SFAD QaTt4NR9YgRw6nYMo+reXvxnzEeo2fQCHHm9/oaUhla/Sar1byVPX5i3g6/+7L2CWUfL Ywrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RlNGohA+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q201-v6si24293052pfq.14.2018.11.03.14.57.25; Sat, 03 Nov 2018 14:58:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RlNGohA+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727288AbeKDGhp (ORCPT + 99 others); Sun, 4 Nov 2018 01:37:45 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:35650 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbeKDGhp (ORCPT ); Sun, 4 Nov 2018 01:37:45 -0500 Received: by mail-qk1-f195.google.com with SMTP id v68-v6so8831332qka.2; Sat, 03 Nov 2018 14:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=/4QSxRfWA4eUmLWjxNBtXcxsBRsNWL9AR5jtvVrGzgA=; b=RlNGohA+DjjthJztExxEu36L3Dn3VQC/3Koz90euBfgoCRGJM6U8D4wutbSizs9boz vTNrZ6al/ICEjSMFbOoENzkCFlRSE41Tyq1S+yHOI/qdUzDX+HUaOw7tLpCBV3iPCztJ CnDdorhZwhWQKvY56Btx6P9M3TGlqwriCNrKe0dvlc8ErLixGTW14fVj2Z3/H8q/8OQx TUmZu5nqe9hdHLTCcQ1IPdQ8EyiASy1kaJFn/OKvVS1slI1VzP8Z0x8d7RThPjfQc1AH XWS7vSWiMe05poS58IS1Sb1n/h+vUasiAy4HPI3XEhkYayKEtk9s82HQWWGky2269l9b QpUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=/4QSxRfWA4eUmLWjxNBtXcxsBRsNWL9AR5jtvVrGzgA=; b=Y6yAYmY6OhK26rTQlgLRfcxQBGjapx7eRsmRDalQETRut3xH7k8hvsw+Ylp+5b5Hsu VDGseWkeqdVunQNVlCFHbtun3Ooplksy+VvtbdwMJ5VbYRVt2XZOR0iahdtRx7WGu+Ip CXnXjOhcLaMl6fmCYLAIK+PYkLJLTJ4m96LUJxATwOwUcYSJo/ZntDMEKr+1JjUmEnqy CX7g9oNw/N+IcLbd9Q7/VQex/p+Bwu+MWY2uV+IWmdLbq6fcpSJAZYhzl+TTcDvjFvFS wDhk1ydggAn+cqvMvXQ4HZ1Ltg4VWMlGBccpRNL3GAMzaZS1NbRFD98O8YfxhIruFXHd 3JqA== X-Gm-Message-State: AGRZ1gIYSgl9ZfeLS9yNldXyAgC5bqEWQBasIhtWzoww5Pl/aUu9xEBB o8DTV0fMCYR1NilXBkYIPUEAtoWBF9IvFJg9oDg= X-Received: by 2002:ae9:e102:: with SMTP id g2mr14482787qkm.343.1541280315523; Sat, 03 Nov 2018 14:25:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9881:0:0:0:0:0 with HTTP; Sat, 3 Nov 2018 14:25:14 -0700 (PDT) In-Reply-To: <8e3a668d-79d2-6fc0-6291-b3d19b793d6f@suse.com> References: <20181103153941.1881966-1-arnd@arndb.de> <8e3a668d-79d2-6fc0-6291-b3d19b793d6f@suse.com> From: Arnd Bergmann Date: Sat, 3 Nov 2018 22:25:14 +0100 X-Google-Sender-Auth: ve6jy82uvd1kCmlkfSJA5D84mEs Message-ID: Subject: Re: [PATCH] btrfs: avoid link error with CONFIG_NO_AUTO_INLINE To: Nikolay Borisov Cc: Chris Mason , Josef Bacik , David Sterba , Changbin Du , Anand Jain , Misono Tomohiro , Qu Wenruo , Gu Jinxiang , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/18, Nikolay Borisov wrote: > On 3.11.18 =D0=B3. 17:39 =D1=87., Arnd Bergmann wrote: >> On 32-bit ARM with gcc-8, I see a link error with the addition of the >> CONFIG_NO_AUTO_INLINE option: >> >> fs/btrfs/super.o: In function `btrfs_statfs': >> super.c:(.text+0x67b8): undefined reference to `__aeabi_uldivmod' >> super.c:(.text+0x67fc): undefined reference to `__aeabi_uldivmod' >> super.c:(.text+0x6858): undefined reference to `__aeabi_uldivmod' >> super.c:(.text+0x6920): undefined reference to `__aeabi_uldivmod' >> super.c:(.text+0x693c): undefined reference to `__aeabi_uldivmod' >> fs/btrfs/super.o:super.c:(.text+0x6958): more undefined references to >> `__aeabi_uldivmod' follow >> >> So far this is the only file that shows the behavior, so I'd propose >> to just work around it by marking the functions as 'static inline' >> that normally get inlined here. >> >> The reference to __aeabi_uldivmod comes from a div_u64() which has an >> optimization for a constant division that uses a straight '/' operator >> when the result should be known to the compiler. My interpretation is >> that as we turn off inlining, gcc still expects the result to be constan= t >> but fails to use that constant value. > > I read this as "this is a compiler bug", no ? So you are providing a > hack around a compiler bug? Mostly, yes. The do_div() macro is really pushing the boundaries of what we can expect the compiler to do in terms of optimizations, and we've had problems with it in the past. IIRC the gcc developers would not classify this as a bug because the result of __builtin_constant_p() is not guaranteed to work the way we expect, it just does so most of the time. Arnd