From patchwork Thu Jun 29 23:26:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 114485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9985299vqr; Thu, 29 Jun 2023 16:44:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3f/VnykEOJfxowSj1b+6+RJOIxIdSq0t21loBVp3+tHiTBBC2SKAaJQ+nznfMwweKKao+ X-Received: by 2002:a05:6e02:12e3:b0:345:69b3:ba41 with SMTP id l3-20020a056e0212e300b0034569b3ba41mr895298iln.2.1688082274037; Thu, 29 Jun 2023 16:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688082274; cv=none; d=google.com; s=arc-20160816; b=dwc/boeKPJAbLvsM1afkxLBaHHwfZ94Lh2Rv4qSPgvFwOOHiXiYpHGFKfQJJ1SmEYm uGv1VVFOGUuMjRywEeHM9R5URUSQ+BlJ8GWRRma+QD3FcM7bzgw41ISJs3KGEFv1Rtyb TESLZIM9qizfQ4UCFRuhD4Gy/qS2M3xkI+mrVO6J0vFA5VLJjha43P+NlQvM60qaA5DP ajFr4ObwiuYujZT+5MnGZLnHIMAt69YCwvI4ZDEtLcnapQBopd/m9Hc73Mv25EM6gbgw +K3ojHYkWhakOAz7txUgtqXsIFfM4D+U3OYr4OQV25XDj141jxgYLVLnGA0uYvSHvjHy 2IoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=HeV25QBvW7gHqhvdVMW2x1HgOgXy413kIAqriLFqtmY=; fh=GzghTQzqgly4pZn8BwQ4U8bZ8zCadAK8Sl/utskeyEs=; b=qsAdpJ0l92w1kivFP5EQ4cgxrYfLRxC18wHmMtfKrClh1AYCZB7yacHxcVzpsIUCa5 qT6qO627fIPqU6sh4uLYsmt3Zqf3SiOEcNctCYufSfaJRm4W61B7d96IKFx/Jl9LMB2c I8VSshz8ZuT1xXLd9NYCvjNq/HEZoMJJBqMUHBJY51HKbgiopT5/XmmIZI8CDxymfwKr qe9fMMgsKUSt0T34XNUkhnK1G5+UNsgxw+HO4GRSTGRcIrU3S9g0bYEjvuE0YMHI7ieD V14NXib9OW4qVgkPWVEpMAGkq/8MMgduUuzBlU679GL2Ns68VqFODJAiiPyTPz0EVhQm f3kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a63e34e000000b0053f32b910c1si11298652pgj.700.2023.06.29.16.44.19; Thu, 29 Jun 2023 16:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbjF2X10 (ORCPT + 99 others); Thu, 29 Jun 2023 19:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjF2X1Y (ORCPT ); Thu, 29 Jun 2023 19:27:24 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD0A1FE7; Thu, 29 Jun 2023 16:27:22 -0700 (PDT) X-QQ-mid: bizesmtp71t1688081232ti5nzs9c Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Jun 2023 07:27:11 +0800 (CST) X-QQ-SSF: 00200000000000D0W000000A0000000 X-QQ-FEAT: q+EIYT+FhZp1QK6qVIW9/zys5/KvQqS+TKOloNFVdqbJx/9/bvxODLmCOphZz y9+f4YPiil1IcYvKMFJp05kBj1sxwVhflNVeqk1yCTzpfMR2Yv2gqiHtlQJDxWUsrO/9Pj3 WXlKB+g3MsWThlTe5KAmbSDgenTw/b7cG8nJ+q4xC1D7JWNs7FW2Bl/TNcPFS0m1hlrfbQs YRptoCHdUObycOZ8PikqrUOT5VZLLcJgcYLQetbfB5hdwO2pZs3Z4t/TZ0PAmpBgcx0PM70 CFWvfM9isuV0+nkhLbZkdZPk7Y0SYJ7KD+1eSNEfk2iWxGlcD5/62jPSRN4o0KYqgSFGLlz 4UcPV1x4z8UiIaqIO5kSsHF6Ut5+cYfLev2/gdn3UYcY3avkpnUgt7FUxGott8CbjdolC5t X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1369624537871017279 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 03/15] selftests/nolibc: add _LARGEFILE64_SOURCE for musl Date: Fri, 30 Jun 2023 07:26:57 +0800 Message-Id: <7486b55751e388b7c532246f068a77a187f0abc0.1688078605.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770082558565108214?= X-GMAIL-MSGID: =?utf-8?q?1770082558565108214?= _GNU_SOURCE Implies _LARGEFILE64_SOURCE in glibc, but in musl, the default configuration doesn't enable _LARGEFILE64_SOURCE. From include/dirent.h of musl, getdents64 is provided as getdents when _LARGEFILE64_SOURCE is defined. #if defined(_LARGEFILE64_SOURCE) ... #define getdents64 getdents #endif Let's define _LARGEFILE64_SOURCE to fix up this compile error: tools/testing/selftests/nolibc/nolibc-test.c: In function ‘test_getdents64’: tools/testing/selftests/nolibc/nolibc-test.c:453:8: warning: implicit declaration of function ‘getdents64’; did you mean ‘getdents’? [-Wimplicit-function-declaration] 453 | ret = getdents64(fd, (void *)buffer, sizeof(buffer)); | ^~~~~~~~~~ | getdents /usr/bin/ld: /tmp/ccKILm5u.o: in function `test_getdents64': nolibc-test.c:(.text+0xe3e): undefined reference to `getdents64' collect2: error: ld returned 1 exit status Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 785b1f4cbdc5..29c21880a198 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ #define _GNU_SOURCE +#define _LARGEFILE64_SOURCE /* libc-specific include files * The program may be built in 3 ways: