Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1518138lqo; Sun, 12 May 2024 06:15:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqmGQTGdD8ExiircahjpmT6D381VbLtHCW+2HPdUbNQzNAHrJuLevD4DG7rN1/LD4qcKQOUEEEmgva5qXNVnrbEXy0MbJBrF9BUIg91g== X-Google-Smtp-Source: AGHT+IGRg/zKD9icawbHmpKnbQ53abD9aOWTYuIEraNq+Jnbcj0ztw5HCsHsBbRgjY7jA7AYyz9d X-Received: by 2002:a05:6a21:1505:b0:1ad:7e68:570c with SMTP id adf61e73a8af0-1afde07d801mr11155753637.4.1715519732274; Sun, 12 May 2024 06:15:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715519732; cv=pass; d=google.com; s=arc-20160816; b=AZN43sKUfVwAL6llXZ+pdLkfhirLk0pkDYLROreeVvn0JUAfpNQycUiVDc2aXCEnDl DX9YibKM7ngaQTl2eFhvEHuk1h1hWeXEO7b/R0wdiYo47NhP75U5yi/lUM2xKoV+StZx OzT6P0I3x+jO3YcL6Tf0OaoLECiHZVzwXxoDoMSt/yOnlUfEWo7oevi028nXdZURsBfm 6uP0Qj68OfZFTMncCfSaC8Tnz37XR8/UPBGgGy4TZJ/ppW5ptGOGrzNacxYitBuxqto6 l8TZS04YWDRvPYTSItXL5pa0+s3ZvwlaazHED8kQa0ruKZPLyZ0jpUB9ZO2mnfKPL2nx 4Czg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4PfHety+PxFhWzw0XzGll+MjyrSUSsZBS/Hi9dE+I3g=; fh=60AEHb/FL0ZK5kocaVrtBU2hKyRI/4dmOI5cPYBswTw=; b=sN/gtA1KrtoU+pZL6DIPIOsqu0w165M+QkMP9LlVUkbsNwUSQ//kfQ4pGNONuooOZz fysh8Siu4QRmmrF+FtxCEIpn2pcz3L8rIZ0kjjeskjwTFRfi0chD4LfwGtktGuyKXKnl YPwiAHMnskCUAtVefH1YSRyLXWv+uzcuYa/H9ZVEme2cJje76O5YzGYKeSJp0fFOGeVX 4lpwrTEU2k9q9BAGidk6AaosMcnf4iM2VUmuCHj3LYVOzq70rahufvJHUb391WEZXd6F UZVg5iLoNSFwYVGBCj+mGcGoXBFvWHfZkTr/dw4Q1+vtxwP39laY9m0zK0mdYjTJMGhl OTKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H/8tBJsy"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b1d58bsi7392255b3a.267.2024.05.12.06.15.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 06:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H/8tBJsy"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176884-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3CEF6B21B29 for ; Sun, 12 May 2024 13:15:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3949A225D4; Sun, 12 May 2024 13:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H/8tBJsy" 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 5B704BA53; Sun, 12 May 2024 13:15:17 +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=1715519718; cv=none; b=nL9C+kzS/mzaWveWO1+k2jgl1QLP3G7IxWaRT/hLlgkEZMAWBxUrlXOdifGXuOokjymYFixeoIsdwlFrmanIqPcWZB1ID0rTrDmPkUWvRE39TE8D3QOU0jz5kBUEiwcR/Vill1zZaLVovFxiLQWyHwPRBc5egHdzTWUFyvLDnyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715519718; c=relaxed/simple; bh=eYhsw1LKGQZmVB+OR2v9kHH1UQ9oE4THIz6+WdBwC1M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RCDn25ScR2ot4+Y1H2YYcWODg5qcEn+9yXFVfHDBQt9phMTOSAXBVfZOQ2dgjeunrTIRL7EncTbrrawdXFvoCAc4vQBsdPY0+J3W0Gyi7vPdHSIafUXSZArzRahQHwCPlDBu/qz7D7GJXZS+FGKk/myEYOMj4jbz/0aK8nkcXwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H/8tBJsy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2E87C116B1; Sun, 12 May 2024 13:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715519717; bh=eYhsw1LKGQZmVB+OR2v9kHH1UQ9oE4THIz6+WdBwC1M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H/8tBJsy+AYtzm6PehlcTBsHcMudfheJ3OH9CHH4yAT6mMJIzpf3f5eoZ937A85+S QrXghY46lrC3y403rmvzmuIYk1pGbd3YbgWkRFDu7cN5VR8f2ZEf69AzsCJ3pSMlCj tAY+pAXGlXIb+lBkJDc683Fo2/X3/CSetk1JLOCFWKqOTGRH1tea3F/uDYDYKv2slZ 2X8duWoA0svRRQXvcf3eDY+/WGiGWoUuhK8qwk6gmYCIWHdJTm/Wm/9iy/Z+oSWVVk Vbhfoqx2uwXtpgaSTt9hCiBnN0hwdgJrIGcpesHpTp4oC9sGflQo1Wkeh7PwY0+H6w w38CvPuuz0kfQ== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-520f9d559f6so3903041e87.3; Sun, 12 May 2024 06:15:17 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXVTg7lJaWbzhVCd/RzZB2zhZ3lfLMyWVtedKiMxP+z/NgcLwt2LT4IGbtiT4xShgab5n54tGMbY+qbJcHlRhPNX/ds7TCeHDMej373 X-Gm-Message-State: AOJu0Yx0lzhg7pjPvI5Y4IqAiiN185dTqztrRAxK5nemu1uFaywWt5lG lfquiBLVtBV9igEFUL1LKIgH1VGXvF/WkiS8pHcHJauASxeLWSYltpgSrq6NXYtKHdUl2zvRxEc NvuKJuid38FQfuLKeknCpwYMITdw= X-Received: by 2002:a05:6512:360e:b0:51a:f362:ab30 with SMTP id 2adb3069b0e04-5220fb699ddmr4130489e87.7.1715519716549; Sun, 12 May 2024 06:15:16 -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:14:40 +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 On Sun, May 12, 2024 at 10:04=E2=80=AFPM Masahiro Yamada wrote: > > +CC: Nathan > > > On Sat, May 11, 2024 at 8:18=E2=80=AFPM Bagas Sanjaya wrote: > > > > Hi, > > > > Xu Zhen reported on Bugzilla (https://bugzilla.ke= rnel.org/show_bug.cgi?id=3D218825) thinlto build directory problem (especia= lly 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 extm= od_prefix > > > had not been assigned yet. Therefore, the thinlto cache dir is always= created > > > in the current directory. > > > > > > Even worse, the cache dir cannot be deleted when executing `make clea= n'. 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/iss= ues/292 > > > > > > This bug was introduced by commit dc5723b02e523b2c4a68667f7e28c65018f= 7202f > > > I agree this is a bug. > > > > > line 945: > KBUILD_LDFLAGS +=3D --thinlto-cache-dir=3D$(extmod_prefix).thinlto-cac= he > > > line 1034: > KBUILD_LDFLAGS +=3D $(call ld-option,--no-warn-rwx-segments) This one is probably OK because it is guarded by CONFIG_LD_IS_BFD, while LTO requires LD_IS_LLD. I see another ld-option at 1043. LDFLAGS_vmlinux +=3D $(call ld-option,--pack-dyn-relocs=3Drelr,-z pack-relative-relocs) Maybe, this is related to the issue (although I did not attempt to reproduce it). --=20 Best Regards Masahiro Yamada