From patchwork Thu Aug 9 15:21:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 10561533 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 47AF71515 for ; Thu, 9 Aug 2018 15:21:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 331E92B604 for ; Thu, 9 Aug 2018 15:21:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3190C2B605; Thu, 9 Aug 2018 15:21:41 +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 BB91C2B607 for ; Thu, 9 Aug 2018 15:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732007AbeHIRrD (ORCPT ); Thu, 9 Aug 2018 13:47:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33420 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731994AbeHIRrD (ORCPT ); Thu, 9 Aug 2018 13:47:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7354F4023444 for ; Thu, 9 Aug 2018 15:21:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-94.pek2.redhat.com [10.72.12.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4A7B2166BA2; Thu, 9 Aug 2018 15:21:37 +0000 (UTC) From: Zorro Lang To: fstests@vger.kernel.org Cc: dhowells@redhat.com Subject: [PATCH] src/statx: fix undefined reference to xfstests_statx Date: Thu, 9 Aug 2018 23:21:32 +0800 Message-Id: <20180809152132.4965-1-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 09 Aug 2018 15:21:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 09 Aug 2018 15:21:39 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'zlang@redhat.com' RCPT:'' Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP xfstests build fails after glibc updated to 2.28: /tmp/cc3s96Dw.o: In function `main': /root/xfstests-dev/src/stat_test.c:690: undefined reference to `xfstests_statx' /tmp/cc3s96Dw.o: In function `get_reference': /root/xfstests-dev/src/stat_test.c:301: undefined reference to `xfstests_statx' /tmp/cc3s96Dw.o: In function `main': /root/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx' collect2: error: ld returned 1 exit status gmake[2]: *** [Makefile:82: stat_test] Error 1 gmake[1]: *** [include/buildrules:31: src] Error 2 make: *** [Makefile:53: default] Error 2 Due to glibc-headers-2.28 defines struct statx and all related things, include STATX_TYPE. But xfstests src/statx.h won't build xfstests_statx() function STATX_TYPE has been defined, that doesn't make sense. If all statx things has been defined by glibc, we can skip xfstests internal statx definition, but xfstests_statx() function is still needed, because it's called by other programs. Signed-off-by: Zorro Lang --- CC David Howells , the original author of src/statx.h. For this change won't break his original design. Thanks, Zorro src/statx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/statx.h b/src/statx.h index 5d58208a..f6aaafd6 100644 --- a/src/statx.h +++ b/src/statx.h @@ -160,6 +160,8 @@ struct statx { #define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */ +#endif /* STATX_TYPE */ + static inline int xfstests_statx(int dfd, const char *filename, unsigned flags, unsigned int mask, struct statx *buffer) @@ -172,5 +174,4 @@ int xfstests_statx(int dfd, const char *filename, unsigned flags, #endif } -#endif /* STATX_TYPE */ #endif /* STATX_H */