[DTrace-devel] [PATCH] spec: add support for building on OL10
Kris Van Hees
kris.van.hees at oracle.com
Fri Apr 11 18:37:34 UTC 2025
On Tue, Apr 08, 2025 at 12:44:45PM -0400, Eugene Loh via DTrace-devel wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> though I don't really know what's going on here.
Thanks.
> A few questions/comments:
>
> Should the change in Java devel dependency be mentioned in the commit
> message (or be in its own little patch)?
It could be its own patch but I can just mention it in the commit msg.
> The comment "dead portions of the spec file concerning the former translator
> generation mechanism" makes me wonder why all that is in this patch rather
> than being in its own separate patch. Also, does that change mean changes
> in other files as well, or is it really confined to the .spec file?
This is a resync of the spec file based on what we have used to do builds.
Since the spec file is OL specific, we do not always use the same level of
granularity of patches. This dead code removal has been pending for a while,
but couldn't be merged until now.
> And...
>
> On 4/8/25 09:45, Kris Van Hees via DTrace-devel wrote:
> > Building on OL10 requires a few adjustments. This patch also removes
> > some dead portions of the spec file concerning the former translator
> > generation mechanism.
> >
> > LTO is also disabled for building DTrace.
> >
> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> > ---
> > dtrace.spec | 85 +++++++++++++++--------------------------------------
> > 1 file changed, 23 insertions(+), 62 deletions(-)
> >
> > diff --git a/dtrace.spec b/dtrace.spec
> > index 902ad7d8..776432e0 100644
> > --- a/dtrace.spec
> > +++ b/dtrace.spec
> > @@ -13,43 +13,32 @@
> > # "--without libctf" to the rpmbuild command to bypass libctf.
> > %define with_libctf %{?_without_libctf: 0} %{?!_without_libctf: 1}
> > -# Kernel lists
> > -#
> > -# Translators are automatically generated by M4 macros from selected kernels.
> > -# Only major.minor version impacts produced data so there is no need to add
> > -# each specific kernel to the list.
> > -#
> > -# A list of kernels used during translator processing is in the dtrace_kernels
> > -# macro. A selected kernel whose headers are used during compilation is in the
> > -# build_kernel macro.
> > -#
> > -# You can override both from the rpmbuild command line if required. To build an
> > -# RPM from locally-installed headers, define local_build on the command line.
> > -# To build translators against locally-installed kernel headers in directories
> > -# under /usr/src/kernels, define local_kernels on the command line (in addition
> > -# to dtrace_kernels).
> > -
> > -%if "%{?dist}" == ".el9"
> > -%{!?build_kernel: %define build_kernel 5.15.0-0.16.2%{?dist}uek}
> > -%{!?dtrace_kernels: %define dtrace_kernels %{build_kernel}}
> > -%endif
> > -%if "%{?dist}" == ".el8"
> > -%{!?build_kernel: %define build_kernel 5.4.17-2102.206.1%{?dist}uek}
> > -%{!?dtrace_kernels: %define dtrace_kernels %{build_kernel} 5.15.0-0.16.2%{?dist}uek}
> > -%endif
> > %if "%{?dist}" == ".el7"
> > -%{!?build_kernel: %define build_kernel 5.4.17-2018%{?dist}uek}
> > -%{!?dtrace_kernels: %define dtrace_kernels %{build_kernel}}
> > %define with_libctf 0
> > %endif
> > -# ARM64 doesn't yet have a 32-bit glibc, so all support for 32-on-64 must be
> > -# disabled.
> > -%ifnarch aarch64
> > -%define glibc32 glibc-devel(%{__isa_name}-32) libgcc(%{__isa_name}-32)
> > +# OL10 requires an explicit BPF toolset version.
> > +%if "%{?dist}" == ".el10"
> > +%define bpfv -14
> > +%define bpfc BPFC=bpf-unknown-none-gcc-14
> > %else
> > +%define bpfv %{nil}
> > +%define bpfc %{nil}
> > +%endif
> > +
> > +# By default, do not build with 32-on-64 support.
> > %define glibc32 %{nil}
> > +
> > +# Enable it for non-ARM64 builds excpet for OL10.
>
> Typo: excpet.
Thanks.
> > +# ARM64 does not support 32-on-64 either.
>
> Comment seems unnecessary given the immediately preceding line.
Will drop.
> > +%ifnarch aarch64
> > +%if "%{?dist}" != ".el10"
> > +%define glibc32 glibc-devel(%{__isa_name}-32) libgcc(%{__isa_name}-32)
> > %endif
> > +%endif
> > +
> > +# Build DTrace without LTO.
> > +%global _lto_cflags %{nil}
> > BuildRequires: rpm
> > Name: dtrace
> > @@ -69,11 +58,7 @@ BuildRequires: fuse3-devel >= 3.2.0
> > %define maybe_use_fuse2 %{nil}
> > %endif
> > %{?systemd_requires}
> > -BuildRequires: kernel%{variant}-devel = %{build_kernel}
> > -%if "%{?dist}" == ".el8"
> > -BuildRequires: kernel%{variant}-devel = 5.15.0-0.16.2%{?dist}uek
> > -%endif
> > -BuildRequires: gcc-bpf-unknown-none
> > +BuildRequires: gcc-bpf-unknown-none%{bpfv}
> > BuildRequires: binutils-bpf-unknown-none
> > %ifnarch aarch64
> > Requires: binutils
> > @@ -88,32 +73,11 @@ BuildRequires: libdtrace-ctf-devel >= 1.1.0
> > %endif
> > Summary: DTrace user interface.
> > Version: 2.0.2
> > -Release: 1%{?dist}
> > +Release: 5%{?dist}
> > Source: dtrace-%{version}.tar.bz2
> > BuildRoot: %{_tmppath}/%{name}-%{version}-build
> > ExclusiveArch: x86_64 aarch64
> > -# Substitute in kernel-version-specific requirements.
> > -
> > -%{lua:
> > - local srcdirexp = ""
> > - dtrace_kernels = rpm.expand("%{dtrace_kernels}")
> > - local_kernels = rpm.expand("%{local_kernels}")
> > - for k in string.gmatch(dtrace_kernels, "[^ ]+") do
> > - if local_kernels == "" then
> > - print(rpm.expand("BuildRequires: kernel%{variant}-devel = " .. k .. "\n"))
> > - end
> > - srcdirexp = srcdirexp .. " " .. k .. "*"
> > - end
> > - rpm.define("srcdirexp " .. srcdirexp)
> > -}
> > -
> > -# Expand kernel versions to full directory names
> > -%global kerneldirs %(cd /usr/src/kernels; \
> > - for ver in %{srcdirexp}; do printf "%s " $ver; done)
> > -%global bldkerneldir %(cd /usr/src/kernels; \
> > - for ver in %{build_kernel}*; do printf "%s" $ver; done)
> > -
> > %description
> > DTrace user interface and dtrace(1) command.
> > @@ -148,7 +112,7 @@ Summary: DTrace testsuite.
> > Requires: make glibc-devel(%{__isa_name}-64) libgcc(%{__isa_name}-64)
> > Requires: dtrace-headers >= 2.0.0 module-init-tools
> > Requires: %{name}-devel = %{version}-%{release} perl gcc java
> > -Requires: java-1.8.0-openjdk-devel perl-IO-Socket-IP xfsprogs
> > +Requires: java-devel perl-IO-Socket-IP xfsprogs
> > Requires: exportfs vim-minimal %{name}%{?_isa} = %{version}-%{release}
> > Requires: coreutils wireshark %{glibc32}
> > Requires: perf time bc nfs-utils
> > @@ -168,8 +132,7 @@ it always tests the installed DTrace.
> > %build
> > make -j $(getconf _NPROCESSORS_ONLN) VERSION=%{version} \
> > - KERNELMODDIR=/usr/src/kernels KERNELSRCNAME= KERNELBLDNAME= \
> > - KERNELS="%{kerneldirs}" %{maybe_use_fuse2}
> > + %{bpfc} %{maybe_use_fuse2}
> > # Force off debuginfo splitting. We have no debuginfo in dtrace proper,
> > # and the testsuite requires debuginfo for proper operation.
> > @@ -183,8 +146,6 @@ make -j $(getconf _NPROCESSORS_ONLN) VERSION=%{version} \
> > mkdir -p $RPM_BUILD_ROOT/usr/sbin
> > make DESTDIR=$RPM_BUILD_ROOT VERSION=%{version} \
> > - KERNELMODDIR=/usr/src/kernels KERNELSRCNAME= KERNELBLDNAME= \
> > - KERNELS="%{kerneldirs}" \
> > HDRPREFIX="$RPM_BUILD_ROOT/usr/include" \
> > install install-test
>
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel
More information about the DTrace-devel
mailing list