From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F63F32D42D; Fri, 5 Dec 2025 15:32:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764948766; cv=none; b=KbG5v4lJIEk+Nvl1UTe1H24rTsFvkV3GCS6kY5UQNGSEYpASplt8qNlugE/pXewriKC9jIRML606a+TYBNm+ZaLwpyik64UkA0Lw08meSZSjahKOOF+l6vU5X0qWUPqSYHU7xa2pbAqcsyweD65EZKRCbn5bhhYHBLO6EnZfG6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764948766; c=relaxed/simple; bh=QqxCFfJ9TlSkDqUBov5vN0BMfcjU3jjfnHPRswY0DqY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mvaVMbvOtMPlXqRx+PAhEuLVXyP6mCC1tiY9uFBiYCu62TVMCfOUy1REM5bcoATNx/3Zb80QmqZGjsZXZV3MxjwHMH+js3y9YpVQBP8hWGq7mmjzp5YsIwroICVw2iEZe8mqVV6ekTKjMjEnqbLCSq77QTHXXn7xntV7TsgWCtw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 217531758; Fri, 5 Dec 2025 07:32:21 -0800 (PST) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0BF253F7A6; Fri, 5 Dec 2025 07:32:27 -0800 (PST) Date: Fri, 5 Dec 2025 15:32:25 +0000 From: Leo Yan To: Quentin Monnet Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Maguire Subject: Re: [PATCH] bpftool: Fix build with OpenSSL versions older than 3.0 Message-ID: <20251205153225.GQ724103@e132581.arm.com> References: <20251205145506.1270248-1-leo.yan@arm.com> <704bea33-84f7-4e20-9298-092eb35fa1ce@kernel.org> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <704bea33-84f7-4e20-9298-092eb35fa1ce@kernel.org> On Fri, Dec 05, 2025 at 03:06:33PM +0000, Quentin Monnet wrote: > On 05/12/2025 14:55, Leo Yan wrote: > > ERR_get_error_all() exists only in OpenSSL 3.0 and later. Older versions > > lack this API, causing build failure: > > > > sign.c: In function 'display_openssl_errors': > > sign.c:40:21: warning: implicit declaration of function 'ERR_get_error_all'; did you mean 'ERR_get_error_line'? [-Wimplicit-function-declaration] > > 40 | while ((e = ERR_get_error_all(&file, &line, NULL, &data, &flags))) { > > | ^~~~~~~~~~~~~~~~~ > > | ERR_get_error_line > > LINK /tmp/build/perf/util/bpf_skel/.tmp/bootstrap/bpftool > > /usr/lib/gcc/x86_64-alpine-linux-musl/11.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/build/perf/util/bpf_skel/.tmp/bootstrap/sign.o: in function `display_openssl_errors.constprop.0': > > sign.c:(.text+0x59): undefined reference to `ERR_get_error_all' > > collect2: error: ld returned 1 exit status > > > > Use the deprecated ERR_get_error_line_data() for OpenSSL < 3.0, and keep > > using ERR_get_error_all() when available. > > > > Fixes: 40863f4d6ef2 ("bpftool: Add support for signing BPF programs") > > Signed-off-by: Leo Yan > > --- > > tools/bpf/bpftool/sign.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/tools/bpf/bpftool/sign.c b/tools/bpf/bpftool/sign.c > > index b34f74d210e9..c98edd6d1dde 100644 > > --- a/tools/bpf/bpftool/sign.c > > +++ b/tools/bpf/bpftool/sign.c > > @@ -37,7 +37,11 @@ static void display_openssl_errors(int l) > > int flags; > > int line; > > > > +#if OPENSSL_VERSION_MAJOR >= 3 > > while ((e = ERR_get_error_all(&file, &line, NULL, &data, &flags))) { > > +#else > > + while ((e = ERR_get_error_line_data(&file, &line, &data, &flags))) { > > +#endif > > ERR_error_string_n(e, buf, sizeof(buf)); > > if (data && (flags & ERR_TXT_STRING)) { > > p_err("OpenSSL %s: %s:%d: %s", buf, file, line, data); > > > Thanks, but this should be addressed in bpf-next already, see commit > 90ae54b4c7ec ("bpftool: Allow bpftool to build with openssl < 3") Thanks for the info. I suspect someone has fixed it so I did not find it on the perf mailing list (I should search bpf ML). Please ignore this one. Leo