Build libbpf on CI

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-29 19:10:49 +09:00
parent e5cb5dca61
commit e77fd7ddb9
2 changed files with 20 additions and 3 deletions

View File

@ -35,6 +35,8 @@ jobs:
libjansson-dev \ libjansson-dev \
libjemalloc-dev \ libjemalloc-dev \
libc-ares-dev \ libc-ares-dev \
libelf-dev \
libc6-dev-i386 \
cmake \ cmake \
cmake-data cmake-data
echo 'CPPFLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined -g' >> $GITHUB_ENV echo 'CPPFLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined -g' >> $GITHUB_ENV
@ -75,6 +77,18 @@ jobs:
run: | run: |
echo 'CC=gcc' >> $GITHUB_ENV echo 'CC=gcc' >> $GITHUB_ENV
echo 'CXX=g++' >> $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 - name: Build quictls/openssl
if: matrix.http3 == 'http3' if: matrix.http3 == 'http3'
run: | run: |
@ -104,9 +118,9 @@ jobs:
- name: Setup extra environment variables for HTTP/3 - name: Setup extra environment variables for HTTP/3
if: matrix.http3 == 'http3' if: matrix.http3 == 'http3'
run: | run: |
PKG_CONFIG_PATH="$PWD/openssl/build/lib/pkgconfig:$PWD/nghttp3/build/lib/pkgconfig:$PWD/ngtcp2/build/lib/pkgconfig:$PKG_CONFIG_PATH" 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" LDFLAGS="$LDFLAGS -Wl,-rpath,$PWD/openssl/build/lib -Wl,-rpath,$PWD/libbpf/build/lib64"
EXTRA_AUTOTOOLS_OPTS="--enable-http3" EXTRA_AUTOTOOLS_OPTS="--enable-http3 $EXTRA_AUTOTOOLS_OPTS"
echo 'PKG_CONFIG_PATH='"$PKG_CONFIG_PATH" >> $GITHUB_ENV echo 'PKG_CONFIG_PATH='"$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV

View File

@ -34,4 +34,7 @@ $(builddir)/reuseport_kern.o: reuseport_kern.c
$(CC) @LIBBPF_CFLAGS@ @BPFCFLAGS@ @EXTRABPFCFLAGS@ \ $(CC) @LIBBPF_CFLAGS@ @BPFCFLAGS@ @EXTRABPFCFLAGS@ \
-target bpf -g -c $< -o $@ -target bpf -g -c $< -o $@
clean-local:
-rm -f reuseport_kern.o
endif # HAVE_LIBBPF endif # HAVE_LIBBPF