From d863c4426a9e1ea2ae94434a711fa242ce7ea8e3 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Wed, 15 Sep 2021 15:04:54 +0100 Subject: [PATCH] hermes: upgrade to new base builder (#6447) --- projects/hermes/Dockerfile | 19 +++++++++++-------- projects/hermes/build.sh | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/projects/hermes/Dockerfile b/projects/hermes/Dockerfile index 360878fba..70f4293fc 100644 --- a/projects/hermes/Dockerfile +++ b/projects/hermes/Dockerfile @@ -14,15 +14,18 @@ # ################################################################################ -# Using Ubuntu 16.04 because of breakage on Ubuntu 20.04. -# See https://github.com/google/oss-fuzz/issues/6291 for more details. -FROM gcr.io/oss-fuzz-base/base-builder:xenial -# Delete line above and uncomment line below to upgrade to 20.04. -# FROM gcr.io/oss-fuzz-base/base-builder +FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && \ - apt-get install -y make autoconf automake libtool wget libicu-dev \ - ninja-build python zip libreadline-dev libatomic-ops-dev + apt-get install -y make autoconf automake libtool wget \ + python zip libreadline-dev libatomic-ops-dev + +RUN pip3 install meson ninja +RUN ln -s /usr/local/bin/ninja /usr/bin/ninja + +RUN wget https://github.com/unicode-org/icu/archive/refs/tags/cldr/2021-08-25.tar.gz && \ + tar xzvf ./2021-08-25.tar.gz && \ + mv ./icu-cldr-2021-08-25/icu4c $SRC/icu RUN git clone https://github.com/facebook/hermes.git -WORKDIR hermes +WORKDIR $SRC COPY build.sh $SRC/ diff --git a/projects/hermes/build.sh b/projects/hermes/build.sh index 01c11f3c0..7bf7a9b4d 100755 --- a/projects/hermes/build.sh +++ b/projects/hermes/build.sh @@ -15,6 +15,23 @@ # ################################################################################ +# build ICU for linking statically. +cd $SRC/icu/source +./configure --disable-shared --enable-static --disable-layoutex \ + --disable-tests --disable-samples --with-data-packaging=static +make install -j$(nproc) + +# Ugly ugly hack to get static linking to work for icu. +cd lib +ls *.a | xargs -n1 ar x +rm *.a +ar r libicu.a *.{ao,o} +ln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicudata.a +ln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicuuc.a +ln -s $PWD/libicu.a /usr/lib/x86_64-linux-gnu/libicui18n.a + +cd $SRC/hermes + if [ "${SANITIZER}" = address ] then CONFIGURE_FLAGS="--enable-asan"