From patchwork Tue Jul 25 09:21:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie XiuQi X-Patchwork-Id: 13326150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8470C001E0 for ; Tue, 25 Jul 2023 09:24:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55C068D0002; Tue, 25 Jul 2023 05:24:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50AF86B0078; Tue, 25 Jul 2023 05:24:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FAD18D0002; Tue, 25 Jul 2023 05:24:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3116D6B0075 for ; Tue, 25 Jul 2023 05:24:22 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F25F8120D12 for ; Tue, 25 Jul 2023 09:24:21 +0000 (UTC) X-FDA: 81049598322.17.93E0DF9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf28.hostedemail.com (Postfix) with ESMTP id 94E3FC000C for ; Tue, 25 Jul 2023 09:24:18 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of xiexiuqi@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=xiexiuqi@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690277059; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=fk0bRaEtl5kj/zrwrFkljRf436dsaakQ3K/hDbr0JXo=; b=8BOtHLaHVTJtj8C7ZUJsKVG5jEGE3QutBJ/E8V50CWOKW0viL+P0o9QlaElNuXGCY2BKYw eqpF2nazMv7dSOgTi3dKYli/eqTnOHRUKxXnAf4Ed7aUwNDLlkUNHMNTXEB/HGHC4BVFuM it2PWO7dDGKrvw49rbcLRASjfVxpKO8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690277059; a=rsa-sha256; cv=none; b=22P3gS4IgryjTMFjkfsKbOtNWnfS/6lSi90aRIeH5VbjfqS3t4TSiBgOmIxwZ6RUmP27Aa sn+6FLUfTQgXX7LvQrMUPbPaIqrhCWHKbKalAZ1IS75fUigsPYeJDub/wcP/jVaJ7XD2xB xZ++038beQbW1b9MAUEA7fL4pT7EZ84= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of xiexiuqi@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=xiexiuqi@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from canpemm500001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R9BN229vQzNmjC; Tue, 25 Jul 2023 17:20:50 +0800 (CST) Received: from localhost.localdomain (10.175.103.91) by canpemm500001.china.huawei.com (7.192.104.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 17:24:12 +0800 From: Xie XiuQi To: , , CC: , , , Subject: [PATCH] tools/mm: fix undefined reference to pthread_once Date: Tue, 25 Jul 2023 17:21:49 +0800 Message-ID: <20230725092149.443119-1-xiexiuqi@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500001.china.huawei.com (7.192.104.163) X-CFilter-Loop: Reflected X-Stat-Signature: mxeysu9ysa53ee66c7498ktbr3eidzut X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 94E3FC000C X-Rspam-User: X-HE-Tag: 1690277058-472407 X-HE-Meta: U2FsdGVkX1+pm9IzyyBO83aHXhp7fS/QcYR4HtsyI5e1ZYruvjHhKmKqmY6fvKtzKY5ccGHYEGqG2ruwDnKRhl+KYcVN4HYehpw4ytXfmaUSvkiGNzRoQ/BaOumtyTDzLJBRbyRAcOYgWVmzZxPxVZzxd6LY4RPeIUsgHUVDN8+wzmxDnTPrUU1M3O0Bq5/h+pKfDGrBNN3mi73gSc9pDe1kSQdETT7XO79U7Jpve21qZUhMU14CzgL+hGdY0x8h1MSLzA8MZqZD0O0N1wh8i05AgYIXTAIp2XwTgOUwrkHcLoijZ1xDIyKJpuAeIdmkh0daDS69Y5/cx0BQ4n8cjVr0b3MgILr3O9Kpnw/nozViagWJYNS7gYT2t3KhuJrC0xG2/yarjYSA+qk7JgvwCAf8Kml5NmMCwpbU8rZM2WAzA7VV8IaGDMf4+HX2lM1eTTw6IC3TxeS5g8NXdtz1D8pzkYRpCzNpCOYeUVv5roa9/UpFadoqRie4PTZB4YlFOjWaCa04QrgBykTZ3PaA094sN6Rj3lJWbupSHyS715mplC2xkKywmI7un8dETeDaEHEEU3dR3Uy7Klweed6N+NK+LAGUmfN+Cys1B0mqFog4WwscS7xoazBa7ZCPHvfh+c1MZTRdJwrGaCZ90LvuKPVT3Prrx6x8aNAcYgidtGft9wCZe/O0YuwRAZplpsSOfUIf/6WPWQCC7MFFNUMJ/56v9hnLIOG8qyeMV5rWnWF1iK69RFr+d0JtvWz1Y5zk8JwPED0UoGMTGj64xsFWUWdG49ODy5Wg3u4fvj2Aqwto0Fm3634wyD5qJuzzxDuuoNLAJT69jVcznx1gGsCuk4Xavf1uPxNsD1ruv7KIzAyI9OSEeyC+T7ROnT4ITVdmOg+aui3JDGd1IIoM72BJwEkrmD9WpQjeQXJA73dKGLM6R23WaUaKLtr17Fjnk+7E4jjaACNDmRXLunL23Af x3lRZpj9 0b1/untfqnh3NSh4sT2q3u+DQDbxBOIELWkb6fsPD5kB20gLnBxqf1acg5Rvl9wi6Wd7Fx1+8ZoGysSFhd/CxDaQ4TqKVJ48F2SzTpIHjAryq8vT7mtGR6Yl+avoauCyouROH8LzgJd/fZrgtRdBZ2DnU9WZe6YKHiNLsPo4pAP+JJDJPIYUSAi/YDWY/zpdU30fY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit 97d5f2e9ee12 ("tools api fs: More thread safety for global filesystem variables") introduces pthread_once, so the libpthread should be added at link time, or we'll meet the following compile error when 'make -C tools/mm': gcc -Wall -Wextra -I../lib/ -o page-types page-types.c ../lib/api/libapi.a ~/linux/tools/lib/api/fs/fs.c:146: undefined reference to `pthread_once' ~/linux/tools/lib/api/fs/fs.c:147: undefined reference to `pthread_once' ~/linux/tools/lib/api/fs/fs.c:148: undefined reference to `pthread_once' ~/linux/tools/lib/api/fs/fs.c:149: undefined reference to `pthread_once' ~/linux/tools/lib/api/fs/fs.c:150: undefined reference to `pthread_once' /usr/bin/ld: ../lib/api/libapi.a(libapi-in.o):~/linux/tools/lib/api/fs/fs.c:151: more undefined references to `pthread_once' follow collect2: error: ld returned 1 exit status make: *** [Makefile:22: page-types] Error 1 Fixes: 97d5f2e9ee12 ("tools api fs: More thread safety for global filesystem variables") Signed-off-by: Xie XiuQi Acked-by: Ian Rogers --- tools/mm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mm/Makefile b/tools/mm/Makefile index 6c1da51f4177..9997b2e401ae 100644 --- a/tools/mm/Makefile +++ b/tools/mm/Makefile @@ -9,7 +9,7 @@ LIB_DIR = ../lib/api LIBS = $(LIB_DIR)/libapi.a CFLAGS += -Wall -Wextra -I../lib/ -LDFLAGS += $(LIBS) +LDFLAGS += $(LIBS) -lpthread all: $(TARGETS)