• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -eu
2# Copyright 2019 Google Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16################################################################################
17
18# Dont build tests we do not care about
19echo "" > ./proxygen/httpclient/samples/CMakeLists.txt
20echo "" > ./proxygen/httpserver/tests/CMakeLists.txt
21echo "" > ./proxygen/lib/http/structuredheaders/test/CMakeLists.txt
22echo "" > ./proxygen/httpserver/filters/tests/CMakeLists.txt
23echo "" > ./proxygen/lib/http/session/test/CMakeLists.txt
24echo "" > ./proxygen/lib/http/codec/compress/test/CMakeLists.txt
25echo "" > ./proxygen/lib/services/test/CMakeLists.txt
26
27cd proxygen
28
29# Link to, and copy over, libunwind
30# We need to link to libunwind to ensure exception handling works
31# See https://clang.llvm.org/docs/Toolchain.html#unwind-library
32export LDFLAGS="-lunwind"
33mkdir -p $OUT/lib
34cp /usr/lib/x86_64-linux-gnu/libunwind.so.8 $OUT/lib/
35
36# Build everything
37./build.sh -m --no-install-dependencies --build-for-fuzzing
38
39# Patch rpath so fuzzers can find libunwind
40find ./_build/proxygen/fuzzers -type f -executable -exec patchelf --set-rpath '$ORIGIN/lib' {} \;
41
42# Copy fuzzers over to the destination
43find ./_build/proxygen/fuzzers -type f -executable -exec cp {} $OUT/ \;
44