<commit_before>#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# Build SwiftShader
pushd third_party/externals/swiftshader/
export SWIFTSHADER_INCLUDE_PATH=$PWD/include
rm -rf build
mkdir build

cd build
if [ $SANITIZER == "profile" ]; then
  cmake ..
elif [ $SANITIZER == "coverage" ]; then
  # TODO(metzman): Remove this once "coverage" builds are removed from OSS-Fuzz.
  CFLAGS= CXXFLAGS="-stdlib=libc++" cmake ..
else
  if [ $SANITIZER == "address" ]; then
    CMAKE_SANITIZER="ASAN"
  elif [ $SANITIZER == "memory" ]; then
    CMAKE_SANITIZER="MSAN"
  elif [ $SANITIZER == "undefined" ]; then
    CMAKE_SANITIZER="UBSAN"
  else
    exit 1
  fi
  cmake .. -D$CMAKE_SANITIZER=1
fi

make -j
cp libGLESv2.so libEGL.so $OUT
export SWIFTSHADER_LIB_PATH=$OUT

popd
# These are any clang warnings we need to silence.
DISABLE="-Wno-zero-as-null-pointer-constant -Wno-unused-template
         -Wno-cast-qual -Wno-self-assign -Wno-return-std-move-in-c++11"
# Disable UBSan vptr since target built with -fno-rtti.
export CFLAGS="$CFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH -DGR_EGL_TRY_GLES3_THEN_GLES2 -fno-sanitize=vptr"
export CXXFLAGS="$CXXFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH -DGR_EGL_TRY_GLES3_THEN_GLES2 -fno-sanitize=vptr "-DIS_FUZZING_WITH_LIBFUZZER""
export LDFLAGS="-lFuzzingEngine $CXXFLAGS -L$SWIFTSHADER_LIB_PATH"
<commit_msg>[Skia] Speculative fix for build failure. (#1825)<commit_after>#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# Build SwiftShader
pushd third_party/externals/swiftshader/
export SWIFTSHADER_INCLUDE_PATH=$PWD/include
rm -rf build
mkdir build

cd build
if [ $SANITIZER == "profile" ]; then
  cmake ..
elif [ $SANITIZER == "coverage" ]; then
  # TODO(metzman): Remove this once "coverage" builds are removed from OSS-Fuzz.
  CFLAGS= CXXFLAGS="-stdlib=libc++" cmake ..
else
  if [ $SANITIZER == "address" ]; then
    CMAKE_SANITIZER="ASAN"
  elif [ $SANITIZER == "memory" ]; then
    CMAKE_SANITIZER="MSAN"
  elif [ $SANITIZER == "undefined" ]; then
    CMAKE_SANITIZER="UBSAN"
  else
    exit 1
  fi
  CFLAGS= CXXFLAGS="-stdlib=libc++" cmake .. -D$CMAKE_SANITIZER=1
fi

make -j
cp libGLESv2.so libEGL.so $OUT
export SWIFTSHADER_LIB_PATH=$OUT

popd
# These are any clang warnings we need to silence.
DISABLE="-Wno-zero-as-null-pointer-constant -Wno-unused-template
         -Wno-cast-qual -Wno-self-assign -Wno-return-std-move-in-c++11"
# Disable UBSan vptr since target built with -fno-rtti.
export CFLAGS="$CFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH -DGR_EGL_TRY_GLES3_THEN_GLES2 -fno-sanitize=vptr"
export CXXFLAGS="$CXXFLAGS $DISABLE -I$SWIFTSHADER_INCLUDE_PATH -DGR_EGL_TRY_GLES3_THEN_GLES2 -fno-sanitize=vptr "-DIS_FUZZING_WITH_LIBFUZZER""
export LDFLAGS="-lFuzzingEngine $CXXFLAGS -L$SWIFTSHADER_LIB_PATH"

{'fraction_non_alphanumeric': 0.14271457085828343, 'fraction_numerical': 0.009481037924151697, 'mean_word_length': 4.65444287729196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6777687', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1387, 'n_words': 388}