Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1512385lqo; Sun, 12 May 2024 06:05:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlAAjZI3y3xAmpx7Qb9KlKPmq/V/sZvyWwGUd2JrqdpWXfvkG9kKbvSF8j8gqN+tLVR+kJsy66xjcI0yNAUrnqui6qkYSF6vprlNvftQ== X-Google-Smtp-Source: AGHT+IG4JWEzKFJOIKbyxMJn/xqpbKNBQLwLAsvSaB++5ynztodXH8ewXQjpPHscOefAM+Twt2EZ X-Received: by 2002:a17:907:1b14:b0:a59:d0fc:7ac5 with SMTP id a640c23a62f3a-a5a2d57d672mr604900766b.32.1715519105707; Sun, 12 May 2024 06:05:05 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba3af6si391993166b.600.2024.05.12.06.05.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 06:05:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176883-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=n5xQhY38; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-176883-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176883-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6E5021F21F94 for ; Sun, 12 May 2024 13:05:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C603E224DC; Sun, 12 May 2024 13:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n5xQhY38" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7785210FB; Sun, 12 May 2024 13:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715519098; cv=none; b=RJWGAQBnqO7amA/Lh5A6yjpamnApjHQzff4dmbjE3s95iZr1nXZlmeOCGlxVouRpSQFCLUparwvg86MJRK3qemMyqhzx3IrzUiDNMb/7cMjd7sA63lsZYBePJmJ75C6iQ0NGjIe7YNvLK2Ai2CjcuUdo39d9T6hKeqpCLKcFmjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715519098; c=relaxed/simple; bh=iKxuRfjzkLsbnpQNvycMUdmiI0SkGYOUjoOFJAsqVcQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CbEHW6gN1Pn0ev1nCecW7G2AtjLFWSFDtYkjEf2U+gQdrgOUG4hQ2qLVvc9Z2tu4L7sf9NqJj1/hrzO5eka/Ca+Ak6kedrfZ0s9wEPzTXHnL3U0ZpV139xNajcC5qxd1tuoU2BULFt9kEgp7WOrQDTlDoCwh3k1yrLZseo2WN7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n5xQhY38; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C8B4C32783; Sun, 12 May 2024 13:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715519097; bh=iKxuRfjzkLsbnpQNvycMUdmiI0SkGYOUjoOFJAsqVcQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=n5xQhY38Z5lPtgyv2CpBDoR7/ahRWgPIfZbKe/SJwvVb3SiuFLz0yjaYiZDHk0VgQ 0zNckxk+LJCCKRv//HwbIzZQcvnlZ0by/FYrXP5JDLgKBdZ6m6W87It0gCxXgsqhrJ wWiOna4WyH9sYoWmRS1Nbeq8ELVE915my8bjokWCjN31neyGhW/j84vg78BFO7d5G2 NF+nMeLtrJPObOYxMXJV8T+0yS2G3CuaPiCd4ZF39oQhVLkC/PFxrDrytj9RbOljKy rkScLedcfFw+o2qozOYsREMHZgsogVinXv0SZtB1MjlfEbv7E5UE8073qPohfKPruU wYj9xQOwW4JYw== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51f2ebbd8a7so3665003e87.2; Sun, 12 May 2024 06:04:57 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCX+D7cSpKrjf9GNx4QYcKOE0G107dvsZUd8OjK5EHEVBCmCPIjyiAH8DsaDFnme3GrE9c4GHHlnjqrcybdX/oKHnD7ChUKm4xfKFbCw X-Gm-Message-State: AOJu0YwRE6EUl9DH+Lp4b9t5cW1IXWR6jIt56SGeZW8C60Gan60lHdew R9gzXQsh6Y2G036RIko+OOQbHQ0E3rBv1FmV1TwkbEp06uQzsGjNB2XWxnVK/mUMMjdHNNix9JG 2LCIkwCO7gz+YvleWFln+9xxY0xU= X-Received: by 2002:ac2:4e8d:0:b0:51f:c8f:630e with SMTP id 2adb3069b0e04-5220fc734e1mr4239936e87.35.1715519095959; Sun, 12 May 2024 06:04:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Sun, 12 May 2024 22:04:19 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Incorrect thinlto cache directory path in Makefile To: Bagas Sanjaya Cc: Linux Kernel Mailing List , Linux Kernel Build System , Sami Tolvanen , Kees Cook , Xu Zhen , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable +CC: Nathan On Sat, May 11, 2024 at 8:18=E2=80=AFPM Bagas Sanjaya wrote: > > Hi, > > Xu Zhen reported on Bugzilla (https://bugzilla.kern= el.org/show_bug.cgi?id=3D218825) thinlto build directory problem (especiall= y on > DKMS modules). He wrote: > > > In Makefile, the ld flag `--thinlto-cache-dir' is set to > > `$(extmod_prefix).thinlto-cache'. But at that time, the variable extmod= _prefix > > had not been assigned yet. Therefore, the thinlto cache dir is always c= reated > > in the current directory. > > > > Even worse, the cache dir cannot be deleted when executing `make clean'= This > > is because its path was written as `$(KBUILD_EXTMOD)/.thinlto-cache' in= the > > clean: target. > > > > Some users have been troubled by it: https://github.com/dell/dkms/issue= s/292 > > > > This bug was introduced by commit dc5723b02e523b2c4a68667f7e28c65018f72= 02f I agree this is a bug. line 945: KBUILD_LDFLAGS +=3D --thinlto-cache-dir=3D$(extmod_prefix).thinlto-cache line 1034: KBUILD_LDFLAGS +=3D $(call ld-option,--no-warn-rwx-segments) line 1095: export extmod_prefix =3D $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/) $(call ld-option ) at line 1034 adds --thinlto-cache-dir=3D.thinlto-cache because --thinlto-cache-dir=3D$(extmod_prefix).thinlto-cache was added at line 945, but $(extmod_prefix) is empty until it is defined at line 1095. However, the offending line was already removed for another issue. See the following in linux-next: Author: Nathan Chancellor Date: Wed May 1 15:55:25 2024 -0700 kbuild: Remove support for Clang's ThinLTO caching If --thinlto-cache-dir comes back, I hope Nathan will take care of this issue. > Thanks. > > -- > An old man doll... just what I always wanted! - Clara --=20 Best Regards Masahiro Yamada