From e77fd7ddb987227fbc9dd133706427d05093e535 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 29 Aug 2021 19:10:49 +0900 Subject: [PATCH] Build libbpf on CI --- .github/workflows/build.yml | 20 +++++++++++++++++--- bpf/Makefile.am | 3 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89a39428..4714baac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,8 @@ jobs: libjansson-dev \ libjemalloc-dev \ libc-ares-dev \ + libelf-dev \ + libc6-dev-i386 \ cmake \ cmake-data echo 'CPPFLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined -g' >> $GITHUB_ENV @@ -75,6 +77,18 @@ jobs: run: | echo 'CC=gcc' >> $GITHUB_ENV echo 'CXX=g++' >> $GITHUB_ENV + - name: Build libbpf + if: matrix.http3 == 'http3' && matrix.compiler == 'clang' && runner.os == 'Linux' + run: | + git clone -b v0.4.0 https://github.com/libbpf/libbpf + cd libbpf + export PREFIX=$PWD/build + cd src + make install + + EXTRA_AUTOTOOLS_OPTS="--with-libbpf" + + echo 'EXTRA_AUTOTOOLS_OPTS='"$EXTRA_AUTOTOOLS_OPTS" >> $GITHUB_ENV - name: Build quictls/openssl if: matrix.http3 == 'http3' run: | @@ -104,9 +118,9 @@ jobs: - name: Setup extra environment variables for HTTP/3 if: matrix.http3 == 'http3' run: | - PKG_CONFIG_PATH="$PWD/openssl/build/lib/pkgconfig:$PWD/nghttp3/build/lib/pkgconfig:$PWD/ngtcp2/build/lib/pkgconfig:$PKG_CONFIG_PATH" - LDFLAGS="$LDFLAGS -Wl,-rpath,$PWD/openssl/build/lib" - EXTRA_AUTOTOOLS_OPTS="--enable-http3" + PKG_CONFIG_PATH="$PWD/openssl/build/lib/pkgconfig:$PWD/nghttp3/build/lib/pkgconfig:$PWD/ngtcp2/build/lib/pkgconfig:$PWD/libbpf/build/lib64/pkgconfig:$PKG_CONFIG_PATH" + LDFLAGS="$LDFLAGS -Wl,-rpath,$PWD/openssl/build/lib -Wl,-rpath,$PWD/libbpf/build/lib64" + EXTRA_AUTOTOOLS_OPTS="--enable-http3 $EXTRA_AUTOTOOLS_OPTS" echo 'PKG_CONFIG_PATH='"$PKG_CONFIG_PATH" >> $GITHUB_ENV echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV diff --git a/bpf/Makefile.am b/bpf/Makefile.am index 60fe7a13..8e19e910 100644 --- a/bpf/Makefile.am +++ b/bpf/Makefile.am @@ -34,4 +34,7 @@ $(builddir)/reuseport_kern.o: reuseport_kern.c $(CC) @LIBBPF_CFLAGS@ @BPFCFLAGS@ @EXTRABPFCFLAGS@ \ -target bpf -g -c $< -o $@ +clean-local: + -rm -f reuseport_kern.o + endif # HAVE_LIBBPF