From patchwork Fri Sep 15 10:32:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Olsa X-Patchwork-Id: 13386844 X-Patchwork-Delegate: bpf@iogearbox.net 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 4D79063A5 for ; Fri, 15 Sep 2023 10:32:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E70C433C9; Fri, 15 Sep 2023 10:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694773953; bh=glvBzi50Crt0kBAVuW8cHMSxgrYkWeEer7JHK1luND0=; h=From:To:Cc:Subject:Date:From; b=FRPtM5EikGG7NjshReM5LVaTC7UgRBagdiFOnhnZfpIcyljUykUREpuh0n+zWMnRh 0iAVKXEdHzP2A3nJtCaaf1yxicxIAFUmef9OTDepYDyguLmzzkaVkKrkGqnRO0JkB2 wrwBMsFcg7k/OpW4ZDxampJpiKT/JHC3NZpPqIXLDyDUVmyz71jy7XGUZ2UXa8HVer ppbUbbrZ8S8gbSDNhs0u+r7WGbG3RBiZeh5Zeng9VU6tkzeOJ9sykO5XTdyUwKSGBA bMmrmsyjI9ptR8tK1VGWjUpc1c+6UHeYMwQtLE0YkSGwBs9akMd1c/Rh/lLfr8ja8b BZ1/kxAkEHSHA== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Marcus Seyfarth , Nick Desaulniers , bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo Subject: [PATCH bpf] bpf: Fix BTF_ID symbol generation Date: Fri, 15 Sep 2023 12:32:28 +0200 Message-ID: <20230915103228.1196234-1-jolsa@kernel.org> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net Marcus and Nick reported issue where BTF_ID macro generates same symbol in separate objects and that breaks final vmlinux link. Adding __LINE__ number suffix to make BTF_ID symbol more unique, which is not real fix, but it would help for now and meanwhile we can work on better solution as suggested by Andrii in [2]. [1] https://github.com/ClangBuiltLinux/linux/issues/1913 [2] https://lore.kernel.org/bpf/ZQQVr35crUtN1quS@krava/T/#m64d7c29c407d6adf0e7b420359958b3aafa7bf69 Reported-by: Marcus Seyfarth Reported-by: Nick Desaulniers Signed-off-by: Jiri Olsa --- include/linux/btf_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index a3462a9b8e18..a9cb10b0e2e9 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -49,7 +49,7 @@ word \ ____BTF_ID(symbol, word) #define __ID(prefix) \ - __PASTE(prefix, __COUNTER__) + __PASTE(__PASTE(prefix, __COUNTER__), __LINE__) /* * The BTF_ID defines unique symbol for each ID pointing