From patchwork Tue Aug 7 12:35:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10558653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC255139A for ; Tue, 7 Aug 2018 12:36:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D80FE29C82 for ; Tue, 7 Aug 2018 12:36:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C963A29C8D; Tue, 7 Aug 2018 12:36:12 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 4E80329C82 for ; Tue, 7 Aug 2018 12:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732703AbeHGOuT (ORCPT ); Tue, 7 Aug 2018 10:50:19 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:62418 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727429AbeHGOuS (ORCPT ); Tue, 7 Aug 2018 10:50:18 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="43173031" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 Aug 2018 20:36:00 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 8BA944B41EE4 for ; Tue, 7 Aug 2018 20:35:58 +0800 (CST) Received: from fnst.localdomain (10.167.226.155) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 7 Aug 2018 20:35:54 +0800 From: Lu Fengqi To: Subject: [PATCH] src/stat_test: fix undefined reference to `xfstests_statx' Date: Tue, 7 Aug 2018 20:35:51 +0800 Message-ID: <20180807123551.5744-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: 8BA944B41EE4.ACBE3 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since glibc 2.28 has added the statx function after commit fd70af45528d ("Add the statx function"), stat_test.c will include /usr/include/bits/statx.h eventually by "include ". That causes the STATX_TYPE has already been defined before include "status.h", then xfstests_statx will not be defined. So make fails with the following error message: /usr/bin/ld: /tmp/cc2Isfch.o: in function `main': /home/luke/workspace/xfstests-dev/src/stat_test.c:690: undefined reference to `xfstests_statx' /usr/bin/ld: /tmp/cc2Isfch.o: in function `get_reference': /home/luke/workspace/xfstests-dev/src/stat_test.c:301: undefined reference to `xfstests_statx' /usr/bin/ld: /tmp/cc2Isfch.o: in function `main': /home/luke/workspace/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx' Just move out the definition of xfstests_statx between "#ifndef STATX_TYPE" and "#endif /* STATX_TYPE */". Signed-off-by: Lu Fengqi --- src/statx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/statx.h b/src/statx.h index 5d58208a94e6..3f239d791dfe 100644 --- a/src/statx.h +++ b/src/statx.h @@ -159,6 +159,7 @@ struct statx { #define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */ #define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */ +#endif /* STATX_TYPE */ static inline int xfstests_statx(int dfd, const char *filename, unsigned flags, @@ -172,5 +173,4 @@ int xfstests_statx(int dfd, const char *filename, unsigned flags, #endif } -#endif /* STATX_TYPE */ #endif /* STATX_H */