Skip to content

Commit

Permalink
dnsdist: Wild shot at building our packages with clang++
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Jan 20, 2025
1 parent ba51ba3 commit 4905dbc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions builder-support/debian/dnsdist/debian-bookworm/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Priority: optional
Maintainer: PowerDNS.COM BV <[email protected]>
Uploaders: PowerDNS.COM BV <[email protected]>
Build-Depends: debhelper (>= 10),
clang,
libboost-all-dev,
libbpf-dev [linux-any],
libcap-dev,
Expand All @@ -22,6 +23,7 @@ Build-Depends: debhelper (>= 10),
libsystemd-dev [linux-any],
libwslay-dev,
libxdp-dev [linux-any],
lld,
pkg-config,
python3-yaml,
ragel,
Expand Down
4 changes: 4 additions & 0 deletions builder-support/debian/dnsdist/debian-bookworm/rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ include /usr/share/dpkg/default.mk

# for atomic support on powerpc (automatic on mipsel)
LDFLAGS += -latomic
# to link the Rust static library and the C++ code with LTO enabled
LDFLAGS += -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-as-needed -ldl
CC=clang
CXX=clang++

# Only enable systemd integration on Linux operating systems
ifeq ($(DEB_HOST_ARCH_OS),linux)
Expand Down
2 changes: 2 additions & 0 deletions builder-support/debian/dnsdist/debian-buster/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Priority: optional
Maintainer: PowerDNS.COM BV <[email protected]>
Uploaders: PowerDNS.COM BV <[email protected]>
Build-Depends: debhelper (>= 10),
clang,
libboost-all-dev,
libcap-dev,
libcdb-dev,
Expand All @@ -20,6 +21,7 @@ Build-Depends: debhelper (>= 10),
libssl-dev,
libsystemd-dev [linux-any],
libwslay-dev,
lld,
pkg-config,
python3-yaml,
ragel,
Expand Down
4 changes: 4 additions & 0 deletions builder-support/debian/dnsdist/debian-buster/rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ include /usr/share/dpkg/default.mk

# for atomic support on powerpc (automatic on mipsel)
LDFLAGS += -latomic
# to link the Rust static library and the C++ code with LTO enabled
LDFLAGS += -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-as-needed -ldl
CC=clang
CXX=clang++

# Only enable systemd integration on Linux operating systems
ifeq ($(DEB_HOST_ARCH_OS),linux)
Expand Down
1 change: 0 additions & 1 deletion builder-support/dockerfiles/Dockerfile.dnsdist
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ RUN /dnsdist/builder/helpers/set-configure-ac-version.sh && \
./configure --disable-dependency-tracking && \
make dist
RUN cp dnsdist-${BUILDER_VERSION}.tar.bz2 /sdist/

14 changes: 13 additions & 1 deletion builder-support/specs/dnsdist.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Source: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
BuildRequires: readline-devel
BuildRequires: libedit-devel
BuildRequires: openssl-devel
BuildRequires: python3-pyyaml

%if 0%{?suse_version}
BuildRequires: lua-devel
Expand All @@ -22,6 +21,12 @@ BuildRequires: systemd-devel
BuildRequires: boost169-devel
%else
BuildRequires: boost-devel
BuildRequires: python3-pyyaml
%endif

%if 0%{?rhel} >= 8
BuildRequires: clang
BuildRequires: lld
%endif

%if 0%{?rhel} >= 7 || 0%{?amzn} == 2023
Expand Down Expand Up @@ -72,6 +77,11 @@ dnsdist is a high-performance DNS loadbalancer that is scriptable in Lua.
export CPPFLAGS=-I/usr/include/boost169
export LDFLAGS=-L/usr/lib64/boost169
%endif
%if 0%{?rhel} >= 8
export CC=clang
export CXX=clang++
export LDFLAGS="-fuse-ld=lld -Wl,--build-id=sha1"
%endif

export AR=gcc-ar
export RANLIB=gcc-ranlib
Expand Down Expand Up @@ -110,6 +120,8 @@ export RANLIB=gcc-ranlib
--enable-dns-over-quic \
--enable-dns-over-http3 \
--with-quiche \
%endif
%if 0%{?rhel} >= 8
--enable-yaml \
%endif
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/lib64/pkgconfig
Expand Down

0 comments on commit 4905dbc

Please sign in to comment.