From 09e1e3e821447c9afad16be0c02a3808c61131c9 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 26 May 2025 12:08:43 +0200 Subject: [PATCH] Add el-8, needed a nweer boost to build with clang --- .../dockerfiles/Dockerfile.target.oraclelinux-8 | 3 ++- builder-support/post-build | 5 +---- builder-support/specs/pdns-recursor.spec | 15 +++++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/builder-support/dockerfiles/Dockerfile.target.oraclelinux-8 b/builder-support/dockerfiles/Dockerfile.target.oraclelinux-8 index e364952f01..2d7807bd81 100644 --- a/builder-support/dockerfiles/Dockerfile.target.oraclelinux-8 +++ b/builder-support/dockerfiles/Dockerfile.target.oraclelinux-8 @@ -3,10 +3,11 @@ # This defines the distribution base layer # Put only the bare minimum of common commands here, without dev tools -FROM oraclelinux:8 as dist-base +FROM oraclelinux:8 AS dist-base ARG BUILDER_CACHE_BUSTER= RUN touch /var/lib/rpm/* && dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ + dnf install -y epel-release && \ dnf install -y 'dnf-command(config-manager)' yum && \ dnf config-manager --set-enabled ol8_codeready_builder && \ dnf install gcc-toolset-13 diff --git a/builder-support/post-build b/builder-support/post-build index bd416455df..c6fa584eb4 100755 --- a/builder-support/post-build +++ b/builder-support/post-build @@ -22,10 +22,7 @@ fi # with a find condition for pdns to exclude accidentally matching pdns-recursor*. for prog in pdns-recursor dnsdist; do if [ $(find ${SRCDIR}/dist -name "${prog}*" 2>/dev/null | wc -l) -ne 0 ]; then - extension="tar.bz2" - if [ "$prog" = "dnsdist" ]; then - extension="tar.xz" - fi + extension="tar.xz" dst=${DESTDIR}/${prog}/${BUILDER_VERSION} mkdir -p ${dst} cp ${BUILDER_TMP}/${BUILDER_VERSION}/sdist/${prog}*.${extension} ${dst} diff --git a/builder-support/specs/pdns-recursor.spec b/builder-support/specs/pdns-recursor.spec index 19986238c6..885e05d258 100644 --- a/builder-support/specs/pdns-recursor.spec +++ b/builder-support/specs/pdns-recursor.spec @@ -12,15 +12,19 @@ Provides: powerdns-recursor = %{version}-%{release} BuildRequires: clang BuildRequires: lld +BuildRequires: ninja-build +%if 0%{?rhel} < 9 +BuildRequires: boost1.78-devel +%else BuildRequires: boost-devel +%endif BuildRequires: fstrm-devel BuildRequires: hostname BuildRequires: libcap-devel BuildRequires: libcurl-devel BuildRequires: libsodium-devel BuildRequires: net-snmp-devel -BuildRequires: ninja-build BuildRequires: openssl-devel BuildRequires: systemd BuildRequires: systemd-devel @@ -44,7 +48,6 @@ Requires(pre): shadow-utils PowerDNS Recursor is a non authoritative/recursing DNS server. Use this package if you need a dns cache for your network. - %prep %autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION} @@ -56,6 +59,10 @@ package if you need a dns cache for your network. %endif %build +%if 0%{?rhel} < 9 +export BOOST_INCLUDEDIR=/usr/include/boost1.78 +export BOOST_LIBRARYDIR=/usr/lib64/boost1.78 +%endif # We need to build with LLVM/clang to be able to use LTO, since we are linking against a static Rust library built with LLVM export CC=clang export CXX=clang++ @@ -74,8 +81,8 @@ export LDFLAGS="-fuse-ld=lld -Wl,--build-id=sha1" %else %define stack_clash_protection -fstack-clash-protection %endif -export CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -gdwarf-4" -export CXXFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -gdwarf-4" +export CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables %{stack_clash_protection} %{cf_protection} -gdwarf-4" +export CXXFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables %{stack_clash_protection} %{cf_protection} -gdwarf-4" %endif # Note that the RPM meson macro "helpfully" sets -- 2.47.2