0

Remove Xenial instrumented libraries

They're no longer used in Chrome (though they may still be used
be other projects like V8 and WebRTC).

R=thestig

Bug: 1260217
Change-Id: I75267cf70843059260c8c04fd944c172747d3b27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4210943
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1100163}
This commit is contained in:
Tom Anderson
2023-02-01 23:42:40 +00:00
committed by Chromium LUCI CQ
parent e263d2e349
commit fe9ef130c0
35 changed files with 18 additions and 2111 deletions

@ -9,7 +9,7 @@ others are optional, and are currently unused.
### Setting up a chroot
Building the libraries requires `apt-get source`, so the build must be done from
an Ubuntu 16.04 environment. The preferred way is using a chroot. To get
an Ubuntu 20.04 environment. The preferred way is using a chroot. To get
started, install `debootstrap` and `schroot`. If you're running a Debian-based
distro, run:
@ -17,19 +17,19 @@ distro, run:
sudo apt install debootstrap schroot
```
Create a configuration for a Xenial chroot:
Create a configuration for a Focal chroot:
```shell
sudo $EDITOR /etc/schroot/chroot.d/xenial_amd64.conf
sudo $EDITOR /etc/schroot/chroot.d/focal_amd64.conf
```
Add the following to the new file, replacing the instances of `thomasanderson`
with your own username.
```
[xenial_amd64]
description=Ubuntu 16.04 Xenial for amd64
directory=/srv/chroot/xenial_amd64
[focal_amd64]
description=Ubuntu 20.04 Focal for amd64
directory=/srv/chroot/focal_amd64
personality=linux
root-users=thomasanderson
type=directory
@ -39,8 +39,8 @@ users=thomasanderson
Bootstrap the chroot:
```shell
sudo mkdir -p /srv/chroot/xenial_amd64
sudo debootstrap --variant=buildd --arch=amd64 xenial /srv/chroot/xenial_amd64 http://archive.ubuntu.com/ubuntu/
sudo mkdir -p /srv/chroot/focal_amd64
sudo debootstrap --variant=buildd --arch=amd64 focal /srv/chroot/focal_amd64 http://archive.ubuntu.com/ubuntu/
```
If your `$HOME` directory is not `/home` (as is the case on gLinux), then route
@ -54,24 +54,24 @@ sudo mount --bind "$HOME" /home
Add `sources.list`:
```shell
sudo $EDITOR /srv/chroot/xenial_amd64/etc/apt/sources.list
sudo $EDITOR /srv/chroot/focal_amd64/etc/apt/sources.list
```
Add the following contents to the file:
```
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe
```
Enter the chroot and install the necessary packages:
```shell
schroot -c xenial_amd64 -u root --directory /home/dev/chromium/src
schroot -c focal_amd64 -u root --directory /home/dev/chromium/src
apt update
apt install lsb-release sudo python pkg-config libgtk2.0-bin libdrm-dev nih-dbus-tool help2man
```
@ -85,7 +85,7 @@ third_party/instrumented_libraries/scripts/install-build-deps.sh
Change to a non-root user:
```shell
exit
schroot -c xenial_amd64 -u `whoami` --directory /home/dev/chromium/src
schroot -c focal_amd64 -u `whoami` --directory /home/dev/chromium/src
```
Add `depot_tools` to your `PATH`. For example, I have it in `~/dev/depot_tools`,
@ -99,7 +99,7 @@ Now we're ready to build the libraries. A clean build takes a little over 8
minutes on a 72-thread machine.
```shell
third_party/instrumented_libraries/scripts/build_and_package.py --parallel -j $(nproc) all xenial
third_party/instrumented_libraries/scripts/build_and_package.py --parallel -j $(nproc) all focal
```
## Uploading the libraries

@ -1,852 +0,0 @@
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/python.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/goma.gni")
group("locally_built") {
visibility = [ "//third_party/instrumented_libraries:deps" ]
deps = [
":atk1.0",
":brltty",
":dee",
":freetype",
":harfbuzz",
":libappindicator3-1",
":libasound2",
":libatk-bridge2.0-0",
":libatspi2.0-0",
":libavahi-client3",
":libcairo2",
":libcap2",
":libcgmanager0",
":libcredentialkit_pkcs11",
":libcups2",
":libcurl3-gnutls",
":libdbus-1-3",
":libdbus-glib-1-2",
":libdbusmenu",
":libdbusmenu-glib4",
":libexpat1",
":libffi6",
":libfontconfig1",
":libgcrypt20",
":libgdk-pixbuf2.0-0",
":libglib2.0-0",
":libgnome-keyring0",
":libgnutls30",
":libgpg-error0",
":libgtk-3-0",
":libidn11",
":libido3-0.1-0",
":libindicator3-7",
":libjasper1",
":libjpeg-turbo8",
":libldap-2.4-2",
":libnih-dbus1",
":libnih1",
":libnspr4",
":libp11-kit0",
":libpci3",
":libpcre3",
":libpixman-1-0",
":libpng12-0",
":librtmp1",
":libsasl2-2",
":libsecret",
":libtasn1-6",
":libudev1",
":libunity9",
":libva1",
":libwayland-client0",
":libx11-6",
":libxau6",
":libxcb1",
":libxcomposite1",
":libxcursor1",
":libxdamage1",
":libxdmcp6",
":libxext6",
":libxfixes3",
":libxi6",
":libxinerama1",
":libxkbcommon0",
":libxrandr2",
":libxrender1",
":libxss1",
":libxtst6",
":nss",
":pango1.0",
":pulseaudio",
":zlib1g",
]
data = [ "${root_out_dir}/instrumented_libraries/lib" ]
}
template("instrumented_library") {
action(target_name) {
script = "scripts/download_build_install.py"
build_method = "destdir"
if (defined(invoker.build_method)) {
build_method = invoker.build_method
}
cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang")
cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++")
if (use_goma) {
cc = "${goma_dir}/gomacc ${cc}"
cxx = "${goma_dir}/gomacc ${cxx}"
}
package_cflags = [
"-O2",
"-gline-tables-only",
"-fPIC",
"-w",
"-U_FORTIFY_SOURCE",
"-fno-omit-frame-pointer",
"-fsanitize=memory",
"-fsanitize-memory-track-origins=${msan_track_origins}",
]
package_ldflags = [ "-fsanitize=memory" ]
if (defined(invoker.package_cflags)) {
package_cflags += invoker.package_cflags
}
if (defined(invoker.package_ldflags)) {
package_ldflags += invoker.package_ldflags
}
if (defined(invoker.deps)) {
deps = invoker.deps
}
product_dir = rebase_path(root_out_dir)
intermediate_dir = rebase_path(target_gen_dir)
args = [
"--build-method=${build_method}",
"--cc=${cc}",
"--cxx=${cxx}",
"--intermediate-dir=${intermediate_dir}",
"--libdir=lib",
"--package=${target_name}",
"--product-dir=${product_dir}",
"--cflags=${package_cflags}",
"--ldflags=${package_ldflags}",
]
outputs = [ "${root_out_dir}/instrumented_libraries/${target_name}.txt" ]
inputs = []
if (defined(invoker.pre_build)) {
inputs += [ invoker.pre_build ]
args += [ "--pre-build=${invoker.pre_build}" ]
}
if (defined(invoker.patches)) {
inputs += invoker.patches
foreach(patch, invoker.patches) {
args += [ "--patch=${patch}" ]
}
}
if (defined(invoker.msan_ignorelist)) {
inputs += [ invoker.msan_ignorelist ]
args += [ "--sanitizer-ignorelist=${invoker.msan_ignorelist}" ]
}
if (defined(invoker.extra_configure_flags)) {
args += [ "--extra-configure-flags=${invoker.extra_configure_flags}" ]
}
}
}
instrumented_library("atk1.0") {
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
]
}
instrumented_library("brltty") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--without-viavoice",
"--without-theta",
"--without-swift",
"--bindir=/sbin",
"--with-curses=ncursesw",
"--disable-stripping",
# We don't need any of those.
"--disable-java-bindings",
"--disable-lisp-bindings",
"--disable-ocaml-bindings",
"--disable-python-bindings",
"--disable-tcl-bindings",
]
}
instrumented_library("dee") {
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("freetype") {
pre_build = "scripts/pre-build/freetype.sh"
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("harfbuzz") {
package_cflags = [ "-Wno-c++11-narrowing" ]
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--with-graphite2=yes",
"--with-gobject",
# See above.
"--disable-introspection",
]
}
instrumented_library("libappindicator3-1") {
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
"--with-gtk=3",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libasound2") {
extra_configure_flags = [ "--disable-static" ]
pre_build = "scripts/pre-build/libasound2.sh"
}
instrumented_library("libatk-bridge2.0-0") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libatspi2.0-0") {
extra_configure_flags = [
"--disable-static",
"--disable-introspection",
]
}
instrumented_library("libavahi-client3") {
extra_configure_flags = [
"--disable-static",
"--disable-introspection",
"--disable-gtk3",
# From debian/rules.
"--enable-compat-libdns_sd",
"--disable-mono",
"--disable-monodoc",
"--disable-qt3",
"--with-systemdsystemunitdir=/lib/systemd/system",
]
patches = [ "patches/libavahi-client3.diff" ]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libcairo2") {
extra_configure_flags = [
"--disable-gtk-doc",
"--disable-static",
]
# Required due to aclocal version mismatch.
pre_build = "scripts/pre-build/autoreconf.sh"
}
instrumented_library("libcap2") {
extra_configure_flags = [ "--disable-static" ]
build_method = "custom_libcap"
}
instrumented_library("libcgmanager0") {
extra_configure_flags = [ "--disable-static" ]
# Required due to autoconf version mismatch.
pre_build = "scripts/pre-build/autoreconf.sh"
}
instrumented_library("libcredentialkit_pkcs11") {
build_method = "stub"
}
instrumented_library("libcups2") {
patches = [ "patches/libcups2.diff" ]
extra_configure_flags = [
"--disable-static",
# All from debian/rules.
"--localedir=/usr/share/cups/locale",
"--enable-slp",
"--enable-libpaper",
"--enable-ssl",
"--enable-gnutls",
"--disable-openssl",
"--enable-threads",
"--enable-debug",
"--enable-dbus",
"--with-dbusdir=/etc/dbus-1",
"--enable-gssapi",
"--enable-avahi",
"--with-pdftops=/usr/bin/gs",
"--disable-launchd",
"--with-cups-group=lp",
"--with-system-groups=lpadmin",
"--with-printcap=/var/run/cups/printcap",
"--with-log-file-perm=0640",
"--with-local_protocols=\"CUPS dnssd\"",
"--with-remote_protocols=\"CUPS dnssd\"",
"--enable-libusb",
]
pre_build = "scripts/pre-build/libcups2.sh"
}
instrumented_library("libcurl3-gnutls") {
build_method = "custom_libcurl"
# Don't generate zsh completions.
patches = [ "patches/libcurl3-gnutls.diff" ]
}
instrumented_library("libdbus-1-3") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--disable-libaudit",
"--enable-apparmor",
"--enable-systemd",
"--libexecdir=/lib/dbus-1.0",
"--with-systemdsystemunitdir=/lib/systemd/system",
"--disable-tests",
"--exec-prefix=/",
# From dh_auto_configure.
"--prefix=/usr",
"--localstatedir=/var",
]
}
instrumented_library("libdbus-glib-1-2") {
extra_configure_flags = [
# Use system dbus-binding-tool. The just-built one is instrumented but
# doesn't have the correct RPATH, and will crash.
"--with-dbus-binding-tool=dbus-binding-tool",
"--disable-static",
]
}
instrumented_library("libdbusmenu") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--disable-scrollkeeper",
"--with-gtk=2",
# See above.
"--disable-introspection",
"--disable-vala",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libdbusmenu-glib4") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--disable-scrollkeeper",
"--enable-gtk-doc",
# --enable-introspection introduces a build step that attempts to run
# a just-built binary and crashes. Vala requires introspection.
# TODO(eugenis): find a better fix.
"--disable-introspection",
"--disable-vala",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libexpat1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libffi6") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libfontconfig1") {
extra_configure_flags = [
"--disable-docs",
"--sysconfdir=/etc/",
"--disable-static",
# From debian/rules.
"--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts",
]
}
instrumented_library("libgcrypt20") {
package_ldflags = [ "-Wl,-z,muldefs" ]
extra_configure_flags = [
# From debian/rules.
"--enable-noexecstack",
"--enable-ld-version-script",
"--disable-static",
# http://crbug.com/344505
"--disable-asm",
]
}
instrumented_library("libgdk-pixbuf2.0-0") {
extra_configure_flags = [
"--disable-static",
"--without-libjasper",
"--disable-introspection",
# From debian/rules.
"--with-x11",
# Do not use loadable modules. Same as with Pango, there's no easy way
# to make gdk-pixbuf pick instrumented versions over system-installed
# ones.
"--disable-modules",
]
pre_build = "scripts/pre-build/libgdk-pixbuf2.0-0.sh"
}
instrumented_library("libglib2.0-0") {
extra_configure_flags = [
"--disable-gtk-doc",
"--disable-gtk-doc-html",
"--disable-gtk-doc-pdf",
"--disable-static",
# --with-pcre=system (the default) fails because the system-supplied
# PCRE does not support Unicode properties or UTF-8.
"--with-pcre=internal",
]
msan_ignorelist = "ignorelists/msan/libglib2.0-0.txt"
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libgnome-keyring0") {
extra_configure_flags = [
"--disable-static",
"--enable-tests=no",
# Make the build less problematic.
"--disable-introspection",
]
package_ldflags = [ "-Wl,--as-needed" ]
}
instrumented_library("libgnutls30") {
extra_configure_flags = [
# from debian/rules.
"--enable-ld-version-script",
"--enable-cxx",
"--without-lzo",
"--disable-guile",
"--with-libgcrypt",
"--with-packager=Debian",
# MSAN is not compatible with instructions such as CPUID.
# https://github.com/google/oss-fuzz/issues/578
"--disable-hardware-acceleration",
]
patches = [
# Make sure to use the memset/memcmp provided by MSAN, not the
# gnutls-provided ones.
"patches/libgnutls30.1.diff",
# Work around several usages of uninitialized memory. The allocated
# memory is contained within libgnutls, so will not affect Chromium test
# coverage.
"patches/libgnutls30.2.diff",
]
}
instrumented_library("libgpg-error0") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libgtk-3-0") {
package_cflags = [ "-Wno-return-type" ]
extra_configure_flags = [
"--disable-static",
"--disable-introspection",
# From debian/rules.
"--enable-test-print-backend",
"--enable-x11-backend",
]
pre_build = "scripts/pre-build/libgtk-3-0.sh"
patches = [
# MSAN does not support GL, so it must be disabled in GTK.
# https://www.chromium.org/developers/testing/memorysanitizer#TOC-Disable-OpenGL
"patches/libgtk-3-0.diff",
]
}
instrumented_library("libido3-0.1-0") {
package_cflags = [ "-Wno-return-type" ]
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
"--with-gtk=3",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libidn11") {
package_ldflags = [ "-Wl,-z,undefs" ]
build_method = "debian"
pre_build = "scripts/pre-build/libidn.sh"
}
instrumented_library("libindicator3-7") {
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libjasper1") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--enable-shared=yes",
]
}
instrumented_library("libjpeg-turbo8") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--with-jpeg8",
]
}
instrumented_library("libldap-2.4-2") {
extra_configure_flags = [
"--disable-slapd",
# From debian/rules.
"--enable-debug",
"--enable-dynamic",
"--enable-syslog",
"--enable-proctitle",
"--enable-ipv6",
"--enable-local",
"--with-subdir=ldap",
"--with-cyrus-sasl",
"--with-threads",
"--with-gssapi",
"--with-tls=gnutls",
"--with-odbc=unixodbc",
]
# Debian adds a custom patch that adds @VERSION_OPTION@, which must
# be substituted before building.
pre_build = "scripts/pre-build/dh_autoreconf.sh"
}
instrumented_library("libnih1") {
extra_configure_flags = [ "--disable-static" ]
pre_build = "scripts/pre-build/libnih1.sh"
patches = [ "patches/libnih1.diff" ]
}
instrumented_library("libnih-dbus1") {
extra_configure_flags = [ "--disable-static" ]
pre_build = "scripts/pre-build/libnih1.sh"
patches = [ "patches/libnih1.diff" ]
}
instrumented_library("libnspr4") {
extra_configure_flags = [
"--enable-64bit",
"--disable-static",
# TSan reports data races on debug variables.
"--disable-debug",
]
pre_build = "scripts/pre-build/libnspr4.sh"
}
instrumented_library("libp11-kit0") {
extra_configure_flags = [ "--disable-static" ]
# Required due to autoconf version mismatch.
pre_build = "scripts/pre-build/autoreconf.sh"
}
instrumented_library("libpci3") {
extra_configure_flags = [ "--disable-static" ]
build_method = "custom_libpci3"
}
instrumented_library("libpcre3") {
extra_configure_flags = [
"--enable-utf8",
"--enable-unicode-properties",
"--disable-static",
]
pre_build = "scripts/pre-build/dh_autoreconf.sh"
}
instrumented_library("libpixman-1-0") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--disable-gtk",
"--disable-silent-rules",
# Avoid a clang issue. http://crbug.com/449183
"--disable-mmx",
]
patches = [
"patches/libpixman-1-0.1.diff",
# Fix an incompatibility when building with clang.
"patches/libpixman-1-0.2.diff",
]
}
instrumented_library("libpng12-0") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("librtmp1") {
build_method = "debian"
# Ensure we build with clang.
patches = [ "patches/librtmp1.diff" ]
}
instrumented_library("libsasl2-2") {
build_method = "debian"
pre_build = "scripts/pre-build/libsasl2-2.sh"
package_cflags = [ "-Wno-return-type" ]
}
instrumented_library("libsecret") {
extra_configure_flags = [
"--disable-static",
# See above.
"--disable-introspection",
]
pre_build = "scripts/pre-build/autoreconf.sh"
}
instrumented_library("libtasn1-3") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--enable-ld-version-script",
]
}
instrumented_library("libtasn1-6") {
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--enable-ld-version-script",
]
}
instrumented_library("libunity9") {
extra_configure_flags = [ "--disable-static" ]
pre_build = "scripts/pre-build/autogen.sh"
}
instrumented_library("libva1") {
extra_configure_flags = [ "--disable-static" ]
pre_build = "scripts/pre-build/libva1.sh"
}
instrumented_library("libwayland-client0") {
extra_configure_flags = [
"--disable-static",
"--disable-documentation",
]
# Do not use the just-built wayland_scanner because it is not runnable due
# to uninstrumented dependencies.
extra_configure_flags += [ "--with-host-scanner" ]
}
instrumented_library("libx11-6") {
extra_configure_flags = [
"--disable-specs",
"--disable-static",
]
msan_ignorelist = "ignorelists/msan/libx11-6.txt"
}
instrumented_library("libxau6") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxcb1") {
extra_configure_flags = [
"--disable-build-docs",
"--disable-static",
]
pre_build = "scripts/pre-build/autoreconf.sh"
}
instrumented_library("libxcomposite1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxcursor1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxdamage1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxdmcp6") {
extra_configure_flags = [
"--disable-docs",
"--disable-static",
]
}
instrumented_library("libxext6") {
extra_configure_flags = [
"--disable-specs",
"--disable-static",
]
}
instrumented_library("libxfixes3") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxi6") {
extra_configure_flags = [
"--disable-specs",
"--disable-docs",
"--disable-static",
]
}
instrumented_library("libxinerama1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxkbcommon0") {
package_ldflags = [ "-Wl,-z,undefs" ]
build_method = "debian"
pre_build = "scripts/pre-build/xkbcommon.sh"
}
instrumented_library("libxrandr2") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxrender1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxss1") {
extra_configure_flags = [ "--disable-static" ]
}
instrumented_library("libxtst6") {
extra_configure_flags = [
"--disable-specs",
"--disable-static",
]
}
instrumented_library("nss") {
# TODO(eugenis): get rid of this dependency
deps = [ ":libnspr4" ]
patches = [ "patches/nss.diff" ]
build_method = "custom_nss"
}
instrumented_library("pango1.0") {
extra_configure_flags = [
"--disable-static",
# Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
"--enable-introspection=no",
# Pango is normally used with dynamically loaded modules. However,
# ensuring pango is able to find instrumented versions of those modules
# is a huge pain in the neck. Let's link them statically instead, and
# hope for the best.
"--with-included-modules=yes",
]
}
instrumented_library("pulseaudio") {
# New location of libpulsecommon.
package_ldflags = [ "-Wl,-R,XORIGIN/pulseaudio/." ]
extra_configure_flags = [
"--disable-static",
# From debian/rules.
"--enable-x11",
"--disable-hal-compat",
# Disable some ARM-related code that fails compilation. No idea why
# this even impacts x86-64 builds.
"--disable-neon-opt",
# There's a build failure caused (I think) by a missing include, so skip
# building the offending file to avoid maintaining a patch.
"--disable-android-hal",
]
pre_build = "scripts/pre-build/pulseaudio.sh"
}
instrumented_library("libudev1") {
build_method = "debian"
pre_build = "scripts/pre-build/udev.sh"
}
instrumented_library("zlib1g") {
# --disable-static is not supported
patches = [ "patches/zlib1g.diff" ]
}

@ -1,2 +0,0 @@
# MSan needs an interceptor for wcsxfrm(). http://crbug.com/423410
fun:g_utf8_collate_key

@ -1,2 +0,0 @@
# https://bugs.freedesktop.org/show_bug.cgi?id=81236
fun:XIconifyWindow

@ -1,12 +0,0 @@
--- ./common/acx_pthread.m4 2015-10-10 00:39:05.000000000 +0000
+++ ../avahi-patched/common/acx_pthread.m4 2021-09-01 22:42:25.700475819 +0000
@@ -232,7 +232,8 @@
# internally use various flags which are still necessary.
AC_MSG_CHECKING([whether to check for GCC pthread/shared inconsistencies])
- check_inconsistencies=yes
+ # Necessary to make ./configure compatible with clang.
+ check_inconsistencies=no
case "${host_cpu}-${host_os}" in
*-darwin*) check_inconsistencies=no ;;
esac

@ -1,46 +0,0 @@
diff -rupN ./man/Makefile ../cups-1.5.3-patched/man/Makefile
--- ./man/Makefile 2014-01-31 20:19:55.000000000 +0400
+++ ../cups-1.5.3-patched/man/Makefile 2014-01-31 20:21:56.449781676 +0400
@@ -69,6 +69,12 @@ MAN8 = cupsaccept.$(MAN8EXT) \
LANGUAGES=de fr
+# Man pages build may fail. We don't need those in instrumented builds anyway.
+MAN1 =
+MAN5 =
+MAN7 =
+MAN8 =
+
#
# Make everything...
#
diff -rupN ./man/Makefile.l10n ../cups-1.5.3-patched/man/Makefile.l10n
--- ./man/Makefile.l10n 2014-01-31 20:19:55.000000000 +0400
+++ ../cups-1.5.3-patched/man/Makefile.l10n 2014-01-31 20:22:13.889535988 +0400
@@ -57,6 +57,11 @@ MAN8 = cupsaccept.$(MAN8EXT) \
lpmove.$(MAN8EXT) \
lpc.$(MAN8EXT)
+# Man pages build may fail. We don't need those in instrumented builds anyway.
+MAN1 =
+MAN5 =
+MAN7 =
+MAN8 =
#
# Make everything...
diff -ru cups-1.7.2.bak/scheduler/conf.h cups-1.7.2/scheduler/conf.h
--- cups-1.7.2.bak/scheduler/conf.h 2020-09-28 13:36:59.018017680 -0700
+++ cups-1.7.2/scheduler/conf.h 2020-09-28 13:36:47.393946500 -0700
@@ -266,9 +266,9 @@
#ifdef HAVE_GSSAPI
VAR char *GSSServiceName VALUE(NULL);
/* GSS service name */
-int HaveServerCreds VALUE(0);
+__attribute__((weak)) int HaveServerCreds VALUE(0);
/* Do we have server credentials? */
-gss_cred_id_t ServerCreds; /* Server's GSS credentials */
+__attribute__((weak)) gss_cred_id_t ServerCreds; /* Server's GSS credentials */
#endif /* HAVE_GSSAPI */

@ -1,14 +0,0 @@
diff -rupN curl-7.47.0/scripts/Makefile.am curl-7.47.0.new/scripts/Makefile.am
--- curl-7.47.0/scripts/Makefile.am 2021-09-24 22:17:11.304187277 +0000
+++ curl-7.47.0.new/scripts/Makefile.am 2021-09-24 22:15:59.739606569 +0000
@@ -30,8 +30,8 @@ $(ZSH_COMPLETION_FUNCTION_FILENAME): zsh
if CROSSCOMPILING
@echo "NOTICE: we can't generate zsh completion when cross-compiling!"
else # if not cross-compiling:
- @if ! test -x "$(PERL)"; then echo "No perl: can't install zsh.pl"; exit 0; fi
- $(PERL) $(srcdir)/zsh.pl $(top_builddir)/src/curl > $@
+ @echo "NOTICE: we can't generate zsh completion in MSAN builds"
+ touch $@
endif
install-data-local:

@ -1,41 +0,0 @@
diff --color -rupN gnutls28-3.4.10/lib/safe-memfuncs.c gnutls28-3.4.10.new/lib/safe-memfuncs.c
--- gnutls28-3.4.10/lib/safe-memfuncs.c 2015-04-04 01:30:48.000000000 -0700
+++ gnutls28-3.4.10.new/lib/safe-memfuncs.c 2021-09-24 16:19:27.754634473 -0700
@@ -39,18 +39,7 @@
**/
void gnutls_memset(void *data, int c, size_t size)
{
- volatile unsigned volatile_zero = 0;
- volatile char *vdata = (volatile char*)data;
-
- /* This is based on a nice trick for safe memset,
- * sent by David Jacobson in the openssl-dev mailing list.
- */
-
- if (size > 0) {
- do {
- memset(data, c, size);
- } while(vdata[volatile_zero] != c);
- }
+ memset(data, c, size);
}
/**
@@ -69,16 +58,7 @@ void gnutls_memset(void *data, int c, si
**/
int gnutls_memcmp(const void *s1, const void *s2, size_t n)
{
- unsigned i;
- unsigned status = 0;
- const uint8_t *_s1 = s1;
- const uint8_t *_s2 = s2;
-
- for (i=0;i<n;i++) {
- status |= (_s1[i] ^ _s2[i]);
- }
-
- return status;
+ return memcmp(s1, s2, n);
}
#ifdef TEST_SAFE_MEMSET

@ -1,47 +0,0 @@
diff -rup gnutls28-3.4.10.bak/lib/gnutls_mbuffers.c gnutls28-3.4.10/lib/gnutls_mbuffers.c
--- gnutls28-3.4.10.bak/lib/gnutls_mbuffers.c 2021-09-28 19:32:36.657779361 +0000
+++ gnutls28-3.4.10/lib/gnutls_mbuffers.c 2021-09-28 19:57:20.893828258 +0000
@@ -330,7 +330,7 @@ mbuffer_st *_mbuffer_alloc_align16(size_
}
/* set the structure to zero */
- memset(st, 0, sizeof(*st));
+ memset(st, 0, maximum_size + sizeof(mbuffer_st) + ALIGN_SIZE);
/* payload points after the mbuffer_st structure */
st->msg.data = (uint8_t *) st + sizeof(mbuffer_st);
diff -rup gnutls28-3.4.10.bak/lib/gnutls_state.c gnutls28-3.4.10/lib/gnutls_state.c
--- gnutls28-3.4.10.bak/lib/gnutls_state.c 2021-09-28 19:32:36.689779620 +0000
+++ gnutls28-3.4.10/lib/gnutls_state.c 2021-09-28 19:51:38.311029189 +0000
@@ -804,6 +804,7 @@ P_hash(gnutls_mac_algorithm_t algorithm,
mac_hd_st td2;
int i, times, how, blocksize, A_size;
uint8_t final[MAX_HASH_SIZE], Atmp[MAX_SEED_SIZE];
+ memset(final, 0, MAX_HASH_SIZE);
int output_bytes, result;
const mac_entry_st *me = mac_to_entry(algorithm);
Binary files gnutls28-3.4.10.bak/lib/nettle/.libs/cipher.o and gnutls28-3.4.10/lib/nettle/.libs/cipher.o differ
Binary files gnutls28-3.4.10.bak/lib/nettle/.libs/libcrypto.a and gnutls28-3.4.10/lib/nettle/.libs/libcrypto.a differ
diff -rup gnutls28-3.4.10.bak/lib/nettle/cipher.c gnutls28-3.4.10/lib/nettle/cipher.c
--- gnutls28-3.4.10.bak/lib/nettle/cipher.c 2021-09-28 19:32:36.681779555 +0000
+++ gnutls28-3.4.10/lib/nettle/cipher.c 2021-09-28 19:47:34.521036429 +0000
@@ -664,6 +664,7 @@ wrap_nettle_cipher_aead_decrypt(void *_c
if (ctx->cipher->aead_decrypt == NULL) {
/* proper AEAD cipher */
uint8_t tag[MAX_HASH_SIZE];
+ memset(tag, 0, MAX_HASH_SIZE);
ctx->cipher->set_iv(ctx->ctx_ptr, nonce_size, nonce);
ctx->cipher->auth(ctx->ctx_ptr, auth_size, auth);
diff -rup gnutls28-3.4.10/lib/nettle/pk.c gnutls28-3.4.10.new/lib/nettle/pk.c
--- gnutls28-3.4.10/lib/nettle/pk.c 2015-07-21 09:42:08.000000000 +0000
+++ gnutls28-3.4.10.new/lib/nettle/pk.c 2021-09-28 20:25:00.439384325 +0000
@@ -248,6 +248,7 @@ dh_cleanup:
case GNUTLS_PK_EC:
{
struct ecc_scalar ecc_priv;
+ memset(&ecc_priv, 0, sizeof(ecc_priv));
struct ecc_point ecc_pub;
const struct ecc_curve *curve;

@ -1,10 +0,0 @@
diff -rupN gtk+3.0-3.18.9/gdk/gdkglobals.c gtk+3.0-3.18.9.new/gdk/gdkglobals.c
--- gtk+3.0-3.18.9/gdk/gdkglobals.c 2021-09-21 19:47:52.578347112 +0000
+++ gtk+3.0-3.18.9.new/gdk/gdkglobals.c 2021-09-21 19:48:31.938662992 +0000
@@ -34,5 +34,5 @@ GList *_gdk_default_filters
gchar *_gdk_display_name = NULL;
gchar *_gdk_display_arg_name = NULL;
gboolean _gdk_disable_multidevice = FALSE;
-guint _gdk_gl_flags = 0;
+guint _gdk_gl_flags = GDK_GL_DISABLE;
GdkRenderingMode _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;

@ -1,12 +0,0 @@
diff -ru libnih-1.0.3.bak/nih-dbus-tool/output.h libnih-1.0.3/nih-dbus-tool/output.h
--- libnih-1.0.3.bak/nih-dbus-tool/output.h 2020-09-28 13:19:09.795416156 -0700
+++ libnih-1.0.3/nih-dbus-tool/output.h 2020-09-28 13:19:29.139536349 -0700
@@ -27,7 +27,7 @@
NIH_BEGIN_EXTERN
-char *output_package;
+extern char *output_package;
int output (const char *source_path, int source_fd,
const char *header_path, int header_fd,

@ -1,23 +0,0 @@
--- pixman-0.30.2/configure.ac.orig 2014-08-19 15:53:39.376032738 +0400
+++ pixman-0.30.2/configure.ac 2014-08-19 15:53:55.264181469 +0400
@@ -844,12 +844,13 @@ if test x$have_gettimeofday = xyes && te
AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Whether we have gettimeofday()])
fi
-dnl =====================================
-dnl Check for missing sqrtf() as, e.g., for Solaris 9
-
-AC_SEARCH_LIBS([sqrtf], [m], [],
- [AC_DEFINE([sqrtf], [sqrt],
- [Define to sqrt if you do not have the `sqrtf' function.])])
+# Not needed for Clang Linux builds. Fixes http://crbug.com/404526.
+#dnl =====================================
+#dnl Check for missing sqrtf() as, e.g., for Solaris 9
+#
+#AC_SEARCH_LIBS([sqrtf], [m], [],
+# [AC_DEFINE([sqrtf], [sqrt],
+# [Define to sqrt if you do not have the `sqrtf' function.])])
dnl =====================================
dnl Thread local storage

@ -1,68 +0,0 @@
From bd2b49185b28c5024597a5e530af9fc25de3193a Mon Sep 17 00:00:00 2001
From: Vladimir Smirnov <civil@gentoo.org>
Date: Mon, 4 Jun 2018 10:04:15 -0700
Subject: [PATCH 2310/2310] test: Adjust for clang's removal of
__builtin_shuffle
__builtin_shuffle was removed in clang 5.0.
Build log says:
test/utils-prng.c:207:27: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
^
test/utils-prng.c:207:25: error: assigning to 'uint8x16' (vector of 16 'uint8_t' values) from incompatible type 'int'
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated
Link to original discussion:
http://lists.llvm.org/pipermail/cfe-dev/2017-August/055140.html
It's possible to build pixman if attached patch is applied. Basically
patch adds check for __builtin_shuffle support and in case there is
none, falls back to clang-specific __builtin_shufflevector that do the
same but have different API.
Bugzilla: https://bugs.gentoo.org/646360
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104886
Tested-by: Philip Chimento <philip.chimento@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
---
test/utils-prng.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/test/utils-prng.c b/test/utils-prng.c
index c27b5be..0cf53dd 100644
--- a/test/utils-prng.c
+++ b/test/utils-prng.c
@@ -199,12 +199,25 @@ randmemset_internal (prng_t *prng,
}
else
{
+
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
+
#ifdef HAVE_GCC_VECTOR_EXTENSIONS
- const uint8x16 bswap_shufflemask =
+# if __has_builtin(__builtin_shufflevector)
+ randdata.vb =
+ __builtin_shufflevector (randdata.vb, randdata.vb,
+ 3, 2, 1, 0, 7, 6 , 5, 4,
+ 11, 10, 9, 8, 15, 14, 13, 12);
+# else
+ static const uint8x16 bswap_shufflemask =
{
3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
};
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
+# endif
+
store_rand_128_data (buf, &randdata, aligned);
buf += 16;
#else
--
2.33.0.309.g3052b89438-goog

@ -1,13 +0,0 @@
diff -rupN rtmpdump-2.4+20151223.gitfa8646d/debian/rules rtmpdump-2.4+20151223.gitfa8646d.new/debian/rules
--- rtmpdump-2.4+20151223.gitfa8646d/debian/rules 2021-09-15 20:05:12.286425496 +0000
+++ rtmpdump-2.4+20151223.gitfa8646d.new/debian/rules 2021-09-15 20:07:07.067365697 +0000
@@ -11,7 +11,8 @@ MAKEVARS= \
CRYPTO=GNUTLS \
libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
XCFLAGS="$(CFLAGS) $(CPPFLAGS)" \
- XLDFLAGS="$(LDFLAGS)"
+ XLDFLAGS="$(LDFLAGS)" \
+ CC=$(CC)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
MAKEVARS += CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-

@ -1,55 +0,0 @@
diff -rupN ./nss/lib/freebl/Makefile ../nss-3.17.1-patched/nss/lib/freebl/Makefile
--- ./nss/lib/freebl/Makefile 2014-09-23 23:09:22.000000000 +0400
+++ ../nss-3.17.1-patched/nss/lib/freebl/Makefile 2014-09-26 20:36:05.639317008 +0400
@@ -214,18 +214,20 @@ endif # Darwin
ifeq ($(OS_TARGET),Linux)
ifeq ($(CPU_ARCH),x86_64)
- ASFILES = arcfour-amd64-gas.s mpi_amd64_gas.s
+# Disable inline asm in instrumented builds.
+# ASFILES = arcfour-amd64-gas.s mpi_amd64_gas.s
ASFLAGS += -fPIC -Wa,--noexecstack
- DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY
- DEFINES += -DNSS_USE_COMBA
+# DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY
+# DEFINES += -DNSS_USE_COMBA
DEFINES += -DMP_IS_LITTLE_ENDIAN
# DEFINES += -DMPI_AMD64_ADD
# comment the next four lines to turn off Intel HW acceleration.
- DEFINES += -DUSE_HW_AES -DINTEL_GCM
- ASFILES += intel-aes.s intel-gcm.s
+# DEFINES += -DUSE_HW_AES -DINTEL_GCM
+# ASFILES += intel-aes.s intel-gcm.s
+# This is just intrinsics and should be fine.
EXTRA_SRCS += intel-gcm-wrap.c
INTEL_GCM = 1
- MPI_SRCS += mpi_amd64.c mp_comba.c
+# MPI_SRCS += mpi_amd64.c mp_comba.c
endif
ifeq ($(CPU_ARCH),x86)
ASFILES = mpi_x86.s
es
--- ./nss/lib/sysinit/nsssysinit.c 2019-10-23 01:27:12.205366237 +0000
+++ ../nss-3.17.1-patched/nss/lib/sysinit/nsssysinit.c 2019-10-23 01:26:49.045359974 +0000
@@ -42,7 +42,9 @@
static char *
getUserDB(void)
{
- char *userdir = PR_GetEnvSecure("HOME");
+ // Prevent nss from trying to pull in PR_GetEnvSecure from libnspr4, which
+ // the latter library doesn't seem to export.
+ char *userdir = secure_getenv("HOME");
char *nssdir = NULL;
if (userdir == NULL) {
@@ -134,7 +136,9 @@
static PRBool
getFIPSEnv(void)
{
- char *fipsEnv = PR_GetEnvSecure("NSS_FIPS");
+ // Prevent nss from trying to pull in PR_GetEnvSecure from libnspr4, which
+ // the latter library doesn't seem to export.
+ char *fipsEnv = secure_getenv("NSS_FIPS");
if (!fipsEnv) {
return PR_FALSE;
}

@ -1,12 +0,0 @@
diff -rupN ./configure ../zlib-1.2.3.4.dfsg-patched/configure
--- ./configure 2009-12-24 18:09:43.000000000 +0300
+++ ../zlib-1.2.3.4.dfsg-patched/configure 2014-06-03 17:53:45.082074669 +0400
@@ -72,6 +72,8 @@ cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in
*gcc*) gcc=1 ;;
+ # Use the version script for clang builds as well.
+ *clang*) gcc=1 ;;
esac
if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then

@ -1,533 +0,0 @@
#!/usr/bin/env python3
# Copyright 2013 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Downloads, builds (with instrumentation) and installs shared libraries."""
import argparse
import ast
import errno
import fcntl
import os
import platform
import glob
import re
import shlex
import shutil
import subprocess
import sys
SCRIPT_ABSOLUTE_PATH = os.path.dirname(os.path.abspath(__file__))
def unescape_flags(s):
"""Un-escapes build flags received from GYP.
GYP escapes build flags as if they are to be inserted directly into a command
line, wrapping each flag in double quotes. When flags are passed via
CFLAGS/LDFLAGS instead, double quotes must be dropped.
"""
if not s:
return ''
try:
return ' '.join(ast.literal_eval(s))
except (SyntaxError, ValueError):
return ' '.join(shlex.split(s))
def real_path(path_relative_to_gyp):
"""Returns the absolute path to a file.
GYP generates paths relative to the location of the .gyp file, which is one
level above the location of this script. This function converts them to
absolute paths.
"""
return os.path.realpath(os.path.join(SCRIPT_ABSOLUTE_PATH, '..',
path_relative_to_gyp))
class InstrumentedPackageBuilder(object):
"""Checks out and builds a single instrumented package."""
def __init__(self, args, clobber):
self._cc = args.cc
self._cxx = args.cxx
self._extra_configure_flags = unescape_flags(args.extra_configure_flags)
self._libdir = args.libdir
self._package = args.package
self._patches = [real_path(patch) for patch in (args.patch or [])]
self._pre_build = \
real_path(args.pre_build) if args.pre_build else None
self._verbose = args.verbose
self._clobber = clobber
self._working_dir = os.path.join(
real_path(args.intermediate_dir), self._package, '')
product_dir = real_path(args.product_dir)
self._destdir = os.path.join(
product_dir, 'instrumented_libraries')
self._source_archives_dir = os.path.join(
product_dir, 'instrumented_libraries', 'sources', self._package)
self._cflags = unescape_flags(args.cflags)
if args.sanitizer_ignorelist:
ignorelist_file = real_path(args.sanitizer_ignorelist)
self._cflags += ' -fsanitize-blacklist=%s' % ignorelist_file # nocheck
self._ldflags = unescape_flags(args.ldflags)
self.init_build_env()
# Initialized later.
self._source_dir = None
self._source_archives = None
def init_build_env(self):
self._build_env = os.environ.copy()
self._build_env['CC'] = self._cc
self._build_env['CXX'] = self._cxx
self._build_env['CFLAGS'] = self._cflags
self._build_env['CXXFLAGS'] = self._cflags
self._build_env['LDFLAGS'] = self._ldflags
# libappindicator1 needs this.
self._build_env['CSC'] = '/usr/bin/mono-csc'
def shell_call(self, command, env=None, cwd=None, ignore_ret_code=False):
"""Wrapper around subprocess.Popen().
Calls command with specific environment and verbosity using
subprocess.Popen().
"""
child = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
env=env, shell=True, cwd=cwd)
stdout = child.communicate()[0].decode('utf-8')
if ignore_ret_code:
if self._verbose:
print(stdout)
return stdout
if self._verbose or child.returncode:
print(stdout)
if child.returncode:
raise Exception('Failed to run: %s' % command)
return stdout
def maybe_download_source(self):
"""Checks out the source code (if needed).
Checks out the source code for the package, if required (i.e. unless running
in no-clobber mode). Initializes self._source_dir and self._source_archives.
"""
get_fresh_source = self._clobber or not os.path.exists(self._working_dir)
if get_fresh_source:
shutil.rmtree(self._working_dir, ignore_errors=True)
os.makedirs(self._working_dir)
# Download one source package at a time, otherwise, there will
# be connection errors in gnutls_handshake().
lock = open('apt-source-lock', 'w')
fcntl.flock(lock, fcntl.LOCK_EX)
self.shell_call('apt-get source %s' % self._package,
cwd=self._working_dir)
fcntl.flock(lock, fcntl.LOCK_UN)
(dirpath, dirnames, filenames) = next(os.walk(self._working_dir))
if len(dirnames) != 1:
raise Exception(
'`apt-get source %s\' must create exactly one subdirectory.'
% self._package)
self._source_dir = os.path.join(dirpath, dirnames[0], '')
if len(filenames) == 0:
raise Exception('Can\'t find source archives after `apt-get source %s\'.'
% self._package)
self._source_archives = \
[os.path.join(dirpath, filename) for filename in filenames]
return get_fresh_source
def patch_source(self):
for patch in self._patches:
self.shell_call('patch -p1 -i %s' % patch, cwd=self._source_dir)
if self._pre_build:
self.shell_call(self._pre_build, cwd=self._source_dir)
def copy_source_archives(self):
"""Copies the downloaded source archives to the output dir.
For license compliance purposes, every Chromium build that includes
instrumented libraries must include their full source code.
"""
shutil.rmtree(self._source_archives_dir, ignore_errors=True)
os.makedirs(self._source_archives_dir)
for filename in self._source_archives:
shutil.copy(filename, self._source_archives_dir)
for patch in self._patches:
shutil.copy(patch, self._source_archives_dir)
def download_build_install(self):
got_fresh_source = self.maybe_download_source()
if got_fresh_source:
self.patch_source()
self.copy_source_archives()
if not os.path.exists(self.dest_libdir()):
os.makedirs(self.dest_libdir())
try:
self.build_and_install()
except Exception as exception:
print('ERROR: Failed to build package %s. Have you '
'run src/third_party/instrumented_libraries/scripts/'
'install-build-deps.sh?' % self._package)
raise
# Touch a text file to indicate package is installed.
stamp_file = os.path.join(self._destdir, '%s.txt' % self._package)
open(stamp_file, 'w').close()
# Remove downloaded package and generated temporary build files. Failed
# builds intentionally skip this step to help debug build failures.
if self._clobber:
self.shell_call('rm -rf %s' % self._working_dir)
def fix_rpaths(self, directory):
# TODO(eugenis): reimplement fix_rpaths.sh in Python.
script = real_path('scripts/fix_rpaths.sh')
self.shell_call("%s %s" % (script, directory))
def temp_dir(self):
"""Returns the directory which will be passed to `make install'."""
return os.path.join(self._source_dir, 'debian', 'instrumented_build')
def temp_libdir(self):
"""Returns the directory under temp_dir() containing the DSOs."""
return os.path.join(self.temp_dir(), self._libdir)
def dest_libdir(self):
"""Returns the final location of the DSOs."""
return os.path.join(self._destdir, self._libdir)
def cleanup_after_install(self):
"""Removes unneeded files in self.temp_libdir()."""
# .la files are not needed, nuke them.
# In case --no-static is not supported, nuke any static libraries we built.
self.shell_call(
'find %s -name *.la -or -name *.a | xargs rm -f' % self.temp_libdir())
# .pc files are not needed.
self.shell_call('rm %s/pkgconfig -rf' % self.temp_libdir())
def make(self, args, env=None, cwd=None, ignore_ret_code=False):
"""Invokes `make'.
Invokes `make' with the specified args, using self._build_env and
self._source_dir by default.
"""
if cwd is None:
cwd = self._source_dir
if env is None:
env = self._build_env
cmd = ['make'] + args
self.shell_call(' '.join(cmd), env=env, cwd=cwd,
ignore_ret_code=ignore_ret_code)
def make_install(self, args, **kwargs):
"""Invokes `make install'."""
self.make(['install'] + args, **kwargs)
def build_and_install(self):
"""Builds and installs the DSOs.
Builds the package with ./configure + make, installs it to a temporary
location, then moves the relevant files to their permanent location.
"""
configure_cmd = './configure --libdir=/%s/ %s' % (
self._libdir, self._extra_configure_flags)
self.shell_call(configure_cmd, env=self._build_env, cwd=self._source_dir)
# Some makefiles use BUILDROOT or INSTALL_ROOT instead of DESTDIR.
args = ['DESTDIR', 'BUILDROOT', 'INSTALL_ROOT']
make_args = ['%s=%s' % (name, self.temp_dir()) for name in args]
self.make(make_args)
self.make_install(make_args)
self.cleanup_after_install()
self.fix_rpaths(self.temp_libdir())
# Now move the contents of the temporary destdir to their final place.
# We only care for the contents of LIBDIR.
self.shell_call('cp %s/* %s/ -rdf' % (self.temp_libdir(),
self.dest_libdir()))
class DebianBuilder(InstrumentedPackageBuilder):
"""Builds a package using Debian's build system.
TODO(spang): Probably the rest of the packages should also use this method..
"""
def init_build_env(self):
self._build_env = os.environ.copy()
self._build_env['CC'] = self._cc
self._build_env['CXX'] = self._cxx
self._build_env['DEB_CFLAGS_APPEND'] = self._cflags
self._build_env['DEB_CXXFLAGS_APPEND'] = self._cflags
self._build_env['DEB_LDFLAGS_APPEND'] = self._ldflags
self._build_env['DEB_BUILD_OPTIONS'] = \
'nocheck notest nodoc nostrip parallel=%d' % os.cpu_count()
def build_and_install(self):
self.build_debian_packages()
self.install_packaged_libs()
def build_debian_packages(self):
configure_cmd = 'dpkg-buildpackage -B -uc'
self.shell_call(configure_cmd, env=self._build_env, cwd=self._source_dir)
def install_packaged_libs(self):
for deb_file in self.get_deb_files():
self.shell_call("dpkg-deb -x %s %s" % (deb_file, self.temp_dir()))
dpkg_arch = self.shell_call("dpkg-architecture -qDEB_HOST_MULTIARCH").strip()
lib_dirs = [
"usr/lib/%s" % dpkg_arch,
"lib/%s" % dpkg_arch,
]
lib_paths = [path for lib_dir in lib_dirs for path in
glob.glob(os.path.join(self.temp_dir(), lib_dir, "*.so.*"))]
for lib_path in lib_paths:
dest_path = os.path.join(self.dest_libdir(), os.path.basename(lib_path))
try:
os.unlink(dest_path)
except OSError as exception:
if exception.errno != errno.ENOENT:
raise
if os.path.islink(lib_path):
if self._verbose:
print('linking %s' % os.path.basename(lib_path))
os.symlink(os.readlink(lib_path), dest_path)
elif os.path.isfile(lib_path):
if self._verbose:
print('copying %s' % os.path.basename(lib_path))
shutil.copy(lib_path, dest_path)
def get_deb_files(self):
deb_files = []
files_file = os.path.join(self._source_dir, 'debian/files')
for line in open(files_file, 'r').read().splitlines():
filename, category, section = line.split(' ')
pathname = os.path.join(self._source_dir, '..', filename)
deb_files.append(pathname)
return deb_files
class LibcurlBuilder(DebianBuilder):
def build_and_install(self):
DebianBuilder.build_and_install(self)
self.shell_call('ln -rsf %s/libcurl-gnutls.so.4 %s/libcurl.so' %
(self.dest_libdir(), self.dest_libdir()))
class LibcapBuilder(InstrumentedPackageBuilder):
def build_and_install(self):
# libcap2 doesn't have a configure script
build_args = ['CC', 'CXX', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS']
make_args = [
'%s="%s"' % (name, self._build_env[name]) for name in build_args
]
self.make(make_args)
install_args = [
'DESTDIR=%s' % self.temp_dir(),
'lib=%s' % self._libdir,
# Skip a step that requires sudo.
'RAISE_SETFCAP=no'
]
self.make_install(install_args)
self.cleanup_after_install()
self.fix_rpaths(self.temp_libdir())
# Now move the contents of the temporary destdir to their final place.
# We only care for the contents of LIBDIR.
self.shell_call('cp %s/* %s/ -rdf' % (self.temp_libdir(),
self.dest_libdir()))
class Libpci3Builder(InstrumentedPackageBuilder):
def package_version(self):
"""Guesses libpci3 version from source directory name."""
dir_name = os.path.split(os.path.normpath(self._source_dir))[-1]
match = re.match('pciutils-(\d+\.\d+\.\d+)', dir_name)
if match is None:
raise Exception(
'Unable to guess libpci3 version from directory name: %s' % dir_name)
return match.group(1)
def temp_libdir(self):
# DSOs have to be picked up from <source_dir>/lib, since `make install'
# doesn't actualy install them anywhere.
return os.path.join(self._source_dir, 'lib')
def build_and_install(self):
# pciutils doesn't have a configure script
# This build process follows debian/rules.
self.shell_call('mkdir -p %s-udeb/usr/bin' % self.temp_dir())
build_args = ['CC', 'CXX', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS']
make_args = [
'%s="%s"' % (name, self._build_env[name]) for name in build_args
]
make_args += [
'LIBDIR=/%s/' % self._libdir,
'PREFIX=/usr',
'SBINDIR=/usr/bin',
'IDSDIR=/usr/share/misc',
'SHARED=yes',
# pciutils fails to build due to unresolved libkmod symbols. The binary
# package has no dependencies on libkmod, so it looks like it was
# actually built without libkmod support.
'LIBKMOD=no',
]
self.make(make_args)
# `make install' is not needed.
self.fix_rpaths(self.temp_libdir())
# Now install the DSOs to their final place.
self.shell_call(
'install -m 644 %s/libpci.so* %s' % (self.temp_libdir(),
self.dest_libdir()))
self.shell_call(
'ln -sf libpci.so.%s %s/libpci.so.3' % (self.package_version(),
self.dest_libdir()))
class NSSBuilder(InstrumentedPackageBuilder):
def build_and_install(self):
# NSS uses a build system that's different from configure/make/install. All
# flags must be passed as arguments to make.
make_args = [
# Do an optimized build.
'BUILD_OPT=1',
# CFLAGS/CXXFLAGS should not be used, as doing so overrides the flags in
# the makefile completely. The only way to append our flags is to tack
# them onto CC/CXX.
'CC="%s %s"' % (self._build_env['CC'], self._build_env['CFLAGS']),
'CXX="%s %s"' % (self._build_env['CXX'], self._build_env['CXXFLAGS']),
# We need to override ZDEFS_FLAG at least to avoid -Wl,-z,defs, which
# is not compatible with sanitizers. We also need some way to pass
# LDFLAGS without overriding the defaults. Conveniently, ZDEF_FLAG is
# always appended to link flags when building NSS on Linux, so we can
# just add our LDFLAGS here.
'ZDEFS_FLAG="-Wl,-z,nodefs %s"' % self._build_env['LDFLAGS'],
'NSPR_INCLUDE_DIR=/usr/include/nspr',
'NSPR_LIB_DIR=%s' % self.dest_libdir(),
'NSS_ENABLE_ECC=1'
]
if platform.architecture()[0] == '64bit':
make_args.append('USE_64=1')
# Make sure we don't override the default flags in the makefile.
for variable in ['CFLAGS', 'CXXFLAGS', 'LDFLAGS']:
del self._build_env[variable]
# Hardcoded paths.
temp_dir = os.path.join(self._source_dir, 'nss')
temp_libdir = os.path.join(temp_dir, 'lib')
# The build happens in <source_dir>/nss. Building fails after all
# the required DSOs have been built, so ignore the error.
self.make(make_args, cwd=temp_dir, ignore_ret_code=True)
self.fix_rpaths(temp_libdir)
# 'make install' is not supported. Copy the DSOs manually.
for (dirpath, dirnames, filenames) in os.walk(temp_libdir):
for filename in filenames:
if filename.endswith('.so'):
full_path = os.path.join(dirpath, filename)
if self._verbose:
print('download_build_install.py: installing ' + full_path)
shutil.copy(full_path, self.dest_libdir())
class StubBuilder(InstrumentedPackageBuilder):
def download_build_install(self):
self._touch(os.path.join(self._destdir, '%s.txt' % self._package))
self.shell_call('mkdir -p %s' % self.dest_libdir())
self._touch(os.path.join(self.dest_libdir(), '%s.so.0' % self._package))
def _touch(self, path):
with open(path, 'w'):
pass
def main():
parser = argparse.ArgumentParser(
description='Download, build and install an instrumented package.')
parser.add_argument('-p', '--package', required=True)
parser.add_argument(
'-i', '--product-dir', default='.',
help='Relative path to the directory with chrome binaries')
parser.add_argument(
'-m', '--intermediate-dir', default='.',
help='Relative path to the directory for temporary build files')
parser.add_argument('--extra-configure-flags', default='')
parser.add_argument('--cflags', default='')
parser.add_argument('--ldflags', default='')
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('--cc')
parser.add_argument('--cxx')
parser.add_argument('--patch', nargs='*')
# This should be a shell script to run before building specific libraries.
# This will be run after applying the patches above.
parser.add_argument('--pre-build', default='')
parser.add_argument('--build-method', default='destdir')
parser.add_argument('--sanitizer-ignorelist', default='')
# The LIBDIR argument to configure/make.
parser.add_argument('--libdir', default='lib')
# Ignore all empty arguments because in several cases gyp passes them to the
# script, but ArgumentParser treats them as positional arguments instead of
# ignoring (and doesn't have such options).
args = parser.parse_args([arg for arg in sys.argv[1:] if len(arg) != 0])
# Clobber by default, unless the developer wants to hack on the package's
# source code.
clobber = \
(os.environ.get('INSTRUMENTED_LIBRARIES_NO_CLOBBER', '') != '1')
if args.build_method == 'destdir':
builder = InstrumentedPackageBuilder(args, clobber)
elif args.build_method == 'custom_nss':
builder = NSSBuilder(args, clobber)
elif args.build_method == 'custom_libcap':
builder = LibcapBuilder(args, clobber)
elif args.build_method == 'custom_libcurl':
builder = LibcurlBuilder(args, clobber)
elif args.build_method == 'custom_libpci3':
builder = Libpci3Builder(args, clobber)
elif args.build_method == 'debian':
builder = DebianBuilder(args, clobber)
elif args.build_method == 'stub':
builder = StubBuilder(args, clobber)
else:
raise Exception('Unrecognized build method: %s' % args.build_method)
builder.download_build_install()
if __name__ == '__main__':
main()

@ -1,30 +0,0 @@
#!/bin/bash
# Copyright 2013 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Changes all RPATHs in a given directory from XORIGIN to $ORIGIN
# See the comment about XORIGIN in instrumented_libraries.gyp
# Fixes rpath from XORIGIN to $ORIGIN in a single file $1.
function fix_rpath {
if [ -w "$1" ]
then
# Only attempt to fix RPATH if the entry actually exists.
# FIXME(eugenis): find out why zlib1g on Precise doesn't get RPATH set.
if chrpath -l $1
then
echo "fix_rpaths.sh: fixing $1"
chrpath -r $(chrpath $1 | cut -d " " -f 2 | sed s/XORIGIN/\$ORIGIN/g \
| sed s/RPATH=//g) $1
fi
else
# FIXME(eugenis): libcups2 DSOs are created non-writable, causing this
# script to fail. As a temporary measure, ignore non-writable files.
echo "fix_rpaths.sh: skipping non-writable file $1"
fi
}
for i in $(find $1 | grep -P "\.so(.\d+)*$"); do
fix_rpath $i
done

@ -1,103 +0,0 @@
#!/bin/bash -e
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install build dependencies of packages which we instrument.
# Enable source repositories in Goobuntu.
if hash goobuntu-config 2> /dev/null
then
sudo goobuntu-config set include_deb_src true
fi
# TODO(eugenis): find a way to pull the list from the build config.
packages="\
atk1.0 \
brltty \
dee \
dpkg-dev \
freetype \
gnome-common \
gobject-introspection \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatspi2.0-0 \
libavahi-client3 \
libcairo2 \
libcap2 \
libcups2 \
libcurl3-gnutls \
libdbus-1-3 \
libdbus-glib-1-2 \
libdbusmenu \
libdbusmenu-glib4 \
libexpat1 \
libffi6 \
libfontconfig1 \
libgdk-pixbuf2.0-0 \
libglib2.0-0 \
libgnome-keyring0 \
libgpg-error0 \
libgraphite2-dev \
libgtk-3-0 \
libgtk2.0-bin \
libidn11 \
libido3-0.1-0 \
libindicator3-7 \
libjasper1 \
libjpeg-turbo8 \
libmicrohttpd-dev \
libnspr4 \
libp11-kit0 \
libpci3 \
libpcre3 \
libpixman-1-0 \
libpng12-0 \
librtmp-dev \
libsasl2-2 \
libunity9 \
libwayland-client0 \
libx11-6 \
libxau6 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxdmcp6 \
libxext6 \
libxfixes3 \
libxi6 \
libxinerama1 \
libxkbcommon0 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
nss \
pango1.0 \
pkg-config \
pulseaudio \
udev \
zlib1g"
# Extra build deps for pulseaudio, which apt-get build-dep may fail to install
# for reasons which are not entirely clear.
sudo apt-get install libltdl3-dev libjson0-dev \
libsndfile1-dev libspeexdsp-dev libjack0 \
chrpath -y # Chrpath is required by fix_rpaths.sh.
# Needed for libldap-2.4.2. libldap is not included in the above list because
# one if its dependencies, libgssapi3-heimdal, conflicts with libgssapi-krb5-2,
# required by libcurl. libgssapi3-heimdal isn't required for this build of
# libldap.
sudo apt-get install libsasl2-dev -y
sudo apt-get build-dep -y $packages
# Work around an issue where clang builds search for libapparmor.so in the wrong
# path. This is required for building udev, pulseaudio, and libdbus-1-3.
sudo ln -s /usr/lib/x86_64-linux-gnu/libapparmor.so \
/lib/x86_64-linux-gnu/libapparmor.so

@ -1,20 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Sometimes there isn't a pre-generated configure script, and we must first run
# autogen.sh to generate it. Even if there is one, sometimes we need to
# re-generate it.
# Unfortunately, we can't run autogen.sh unconditionally whenever it's present,
# as that sometimes breaks build. Which is why we have this file.
# Also, some packages may or may not have an autogen script, depending on
# version. Rather than clutter the GYP file with conditionals, we simply do
# nothing if the file is not present.
if [ -x ./autogen.sh ]
then
NOCONFIGURE=1 ./autogen.sh
fi

@ -1,6 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
autoreconf --force

@ -1,6 +0,0 @@
#!/bin/bash
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
dh_autoreconf

@ -1,13 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented freetype.
mkdir temp
mv * temp/
cd temp
./debian/rules patch
mv freetype-*/* ../
cd ..

@ -1,16 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libasound2.
# Instructions from the INSTALL file.
libtoolize --force --copy --automake
aclocal
autoheader
autoconf
automake --foreign --copy --add-missing
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/\(-Wl,--no-undefined\|-Wl,-z,defs\)//g" ./configure

@ -1,12 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before the build of instrumented libcups2.
# Libcup2 configure script, if the compiler name ends with "clang", enables PIE
# with a -Wl,-pie flag. That does not work at all, because the driver running in
# non-PIE mode links incompatible crtbegin.o (or something similarly named).
sed -i "s|-Wl,-pie|-pie|g" configure

@ -1,13 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libgdk-pixbuf2.0-0.
# Use the system-installed gdk-pixbuf-query-loaders during building. Normally a
# just-built one is used, however in MSan builds it will crash due to
# uninstrumented dependencies.
sed -i "s|\$(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders|/usr/bin/gdk-pixbuf-query-loaders|g" gdk-pixbuf/Makefile.am
autoreconf

@ -1,20 +0,0 @@
#!/bin/bash
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libgtk-3-0.
# Use the system-installed gtk-update-icon-cache during building. Normally a
# just-built one is used, however in MSan builds it will crash due to
# uninstrumented dependencies.
sed -i "s|./gtk-update-icon-cache|/usr/bin/gtk-update-icon-cache|g" gtk/Makefile.am
# Don't build immodules.cache. It requires running just-built executables that
# depend on glib, but using the system glib will cause msan errors. This file
# is only used in GTK test suites, and is unneeded for the instrumented build.
sed -i "s|all-local: immodules.cache||g" modules/input/Makefile.am
autoreconf

@ -1,14 +0,0 @@
#!/bin/bash
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libidn.
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/-no-undefined//g" ./lib/gl/Makefile.am
sed -i "s/-no-undefined//g" ./lib/Makefile.am
sed -i "s/-Wl,-z,defs//g" ./debian/rules
# Do not run tests.
sed -i "s/$(MAKE) check//g" ./debian/rules

@ -1,12 +0,0 @@
#!/bin/bash
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libnih1.
# Use the system-installed nih-dbus-tool during building. Normally a
# just-built one is used, however in MSan builds it will crash due to
# uninstrumented dependencies.
sed -i 's|NIH_DBUS_TOOL="\\${top_builddir}/nih-dbus-tool/nih-dbus-tool"|NIH_DBUS_TOOL="/usr/bin/nih-dbus-tool"|g' configure

@ -1,17 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libnspr4.
if [ -d nspr ]
then
mv nspr/* .
elif [ -d mozilla/nsprpub ]
then
mv mozilla/nsprpub/* .
else
echo "libnspr4.sh: package has unexpected directory structure. Please update this script."
return 1
fi

@ -1,14 +0,0 @@
#!/bin/bash
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libsasl.
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/-Wl,-z,defs//g" ./debian/rules
# Do not build the sample server/client.
sed -i "s/.*sample.*//g" ./debian/rules

@ -1,11 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented libva1.
# autogen is only required on Precise.
NOCONFIGURE=1 ./autogen.sh
sed -i "s|-no-undefined -Wl,--no-undefined||g" dummy_drv_video/Makefile.in

@ -1,14 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented pulseaudio.
automake --add-missing
autoreconf
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/\(-Wl,--no-undefined\|-Wl,-z,defs\)//g" ./configure
# The configure script enforces FORTIFY_SOURCE=2, but we can't live with that.
sed -i "s/-D_FORTIFY_SOURCE=2/-U_FORTIFY_SOURCE/g" ./configure

@ -1,15 +0,0 @@
#!/bin/bash
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented udev.
# Required due to autoconf version mismatch.
autoreconf --force
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/\(-Wl,--no-undefined\|-Wl,-z,defs\)//g" ./configure ./configure.ac
# Do not fortify source (doesn't work with MSan).
sed -i "s/-D_FORTIFY_SOURCE=2/-U_FORTIFY_SOURCE/g" ./configure ./configure.ac

@ -1,15 +0,0 @@
#!/bin/bash
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script does some preparations before build of instrumented xkbcommon.
# Do not warn about undefined sanitizer symbols in object files.
sed -i "s/\(-Wl,--no-undefined\|-Wl,-z,defs\)//g" ./Makefile.am
# Do not warn about uninstalled documentation.
sed -i "s/--fail-missing//g" ./debian/rules
# Do not warn about extra msan symbols.
sed -i "s/dh_makeshlibs -- -c4/dh_makeshlibs/g" ./debian/rules