From patchwork Thu Mar 15 10:42:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coly Li X-Patchwork-Id: 10284209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7BCF26061F for ; Thu, 15 Mar 2018 10:43:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78CF028740 for ; Thu, 15 Mar 2018 10:43:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65A0F288FA; Thu, 15 Mar 2018 10:43:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BA6A289BC for ; Thu, 15 Mar 2018 10:43:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbeCOKm6 (ORCPT ); Thu, 15 Mar 2018 06:42:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:54800 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbeCOKm4 (ORCPT ); Thu, 15 Mar 2018 06:42:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5451DAECC; Thu, 15 Mar 2018 10:42:55 +0000 (UTC) From: Coly Li To: linux-bcache@vger.kernel.org Cc: linux-block@vger.kernel.org, Coly Li Subject: [PATCH 1/4] bcache-tools: change bcache.c:crc64() to non-inline function Date: Thu, 15 Mar 2018 18:42:37 +0800 Message-Id: <20180315104240.24647-2-colyli@suse.de> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180315104240.24647-1-colyli@suse.de> References: <20180315104240.24647-1-colyli@suse.de> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP bcache.o is used as a static lib but not explicitly compile and linked as position independent code. The only routine in bcache.c is inline function crc64(). For gcc 7.X this inline function will be optimized out in such situation, and when linking bcache.o to make-bcache or bcache-show-super there will be an error "no reference to crc64()". The simplest way to fix the compiling failure is to change crc64() to be a non-inline function, then there will be an entry of crc64() in symbols table of bcache.o. Signed-off-by: Coly Li --- bcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bcache.c b/bcache.c index 8f37445..8b4b986 100644 --- a/bcache.c +++ b/bcache.c @@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = { 0x9AFCE626CE85B507ULL }; -inline uint64_t crc64(const void *_data, size_t len) +uint64_t crc64(const void *_data, size_t len) { uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; const unsigned char *data = _data;