diff --git a/DEPS b/DEPS index d6856d0e8931a2..772517f783eeb0 100644 --- a/DEPS +++ b/DEPS @@ -4092,7 +4092,7 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1', + '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins.tgz.sha1', ], }, { @@ -4104,7 +4104,7 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1', + '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins.tgz.sha1', ], }, { diff --git a/docs/linux/instrumented_libraries.md b/docs/linux/instrumented_libraries.md index 70a028f6c2ea1e..695c2e569f72d0 100644 --- a/docs/linux/instrumented_libraries.md +++ b/docs/linux/instrumented_libraries.md @@ -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 +third_party/instrumented_libraries/scripts/build_and_package.py --parallel -j $(nproc) all xenial ``` ## Uploading the libraries @@ -115,8 +115,7 @@ exit mv *.tgz third_party/instrumented_libraries/binaries # Upload. -upload_to_google_storage.py -b chromium-instrumented-libraries third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz -upload_to_google_storage.py -b chromium-instrumented-libraries third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz +upload_to_google_storage.py -b chromium-instrumented-libraries third_party/instrumented_libraries/binaries/msan*.tgz ``` ## Testing and uploading a CL diff --git a/third_party/instrumented_libraries/BUILD.gn b/third_party/instrumented_libraries/BUILD.gn index d7e0957c0fa131..85a1b35994d661 100644 --- a/third_party/instrumented_libraries/BUILD.gn +++ b/third_party/instrumented_libraries/BUILD.gn @@ -2,13 +2,15 @@ # 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") + +declare_args() { + instrumented_libraries_release = "xenial" +} group("deps") { if (use_locally_built_instrumented_libraries) { - deps = [ ":locally_built" ] + deps = [ "//third_party/instrumented_libraries/$instrumented_libraries_release:locally_built" ] } else if (use_prebuilt_instrumented_libraries) { assert(prebuilt_instrumented_libraries_available, "Prebuilt instrumented libraries are only available when " + @@ -61,861 +63,14 @@ if (prebuilt_instrumented_libraries_available) { } } -if (use_locally_built_instrumented_libraries) { - group("locally_built") { - visibility = [ ":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" ] - } - - config("locally_built_ldflags") { - ldflags = [ - # Add a relative RPATH entry to Chromium binaries. This puts instrumented - # DSOs before system-installed versions in library search path. - "-Wl,-R,\$ORIGIN/instrumented_libraries/lib", - "-Wl,-z,origin", - - # Add some padding to allow RPATHs to be modified later. - "-Wl,-R,________________________________________________________________PADDING________________________________________________________________", - ] - } - - 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_blacklist)) { - inputs += [ invoker.msan_blacklist ] - args += [ "--sanitizer-blacklist=${invoker.msan_blacklist}" ] - } - - 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_blacklist = "blacklists/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", +config("locally_built_ldflags") { + ldflags = [ + # Add a relative RPATH entry to Chromium binaries. This puts instrumented + # DSOs before system-installed versions in library search path. + "-Wl,-R,\$ORIGIN/instrumented_libraries/lib", + "-Wl,-z,origin", - "--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_blacklist = "blacklists/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" ] - } + # Add some padding to allow RPATHs to be modified later. + "-Wl,-R,________________________________________________________________PADDING________________________________________________________________", + ] } diff --git a/third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1 b/third_party/instrumented_libraries/binaries/msan-chained-origins.tgz.sha1 similarity index 100% rename from third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1 rename to third_party/instrumented_libraries/binaries/msan-chained-origins.tgz.sha1 diff --git a/third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1 b/third_party/instrumented_libraries/binaries/msan-no-origins.tgz.sha1 similarity index 100% rename from third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1 rename to third_party/instrumented_libraries/binaries/msan-no-origins.tgz.sha1 diff --git a/third_party/instrumented_libraries/scripts/build_and_package.py b/third_party/instrumented_libraries/scripts/build_and_package.py index 796835760fbba0..b9367f1b990141 100755 --- a/third_party/instrumented_libraries/scripts/build_and_package.py +++ b/third_party/instrumented_libraries/scripts/build_and_package.py @@ -23,14 +23,12 @@ ], } -SUPPORTED_RELEASE = 'xenial' - class Error(Exception): pass -class UnsupportedReleaseError(Error): +class IncorrectReleaseError(Error): pass @@ -45,8 +43,7 @@ def _tar_filter(tar_info): def build_libraries(build_type, ubuntu_release, jobs, use_goma): - archive_name = '%s-%s' % (build_type, ubuntu_release) - build_dir = 'out/Instrumented-%s' % archive_name + build_dir = 'out/Instrumented-%s' % build_type if not os.path.exists(build_dir): os.makedirs(build_dir) @@ -58,15 +55,20 @@ def build_libraries(build_type, ubuntu_release, jobs, use_goma): with open(os.path.join(build_dir, 'args.gn'), 'w') as f: f.write('\n'.join(gn_args) + '\n') subprocess.check_call(['gn', 'gen', build_dir, '--check']) - subprocess.check_call(['ninja', '-j%d' % jobs, '-C', build_dir, - 'third_party/instrumented_libraries:locally_built']) - with tarfile.open('%s.tgz' % archive_name, mode='w:gz') as f: - f.add('%s/instrumented_libraries/lib' % build_dir, - arcname='lib', - filter=_tar_filter) - f.add('%s/instrumented_libraries/sources' % build_dir, - arcname='sources', - filter=_tar_filter) + subprocess.check_call([ + 'ninja', + '-j%d' % jobs, '-C', build_dir, + 'third_party/instrumented_libraries/%s:locally_built' % ubuntu_release + ]) + with tarfile.open('%s.tgz' % build_type, mode='w:gz') as f: + f.add( + '%s/instrumented_libraries/lib' % build_dir, + arcname='lib', + filter=_tar_filter) + f.add( + '%s/instrumented_libraries/sources' % build_dir, + arcname='sources', + filter=_tar_filter) def main(): @@ -79,46 +81,52 @@ def main(): type=int, default=8, help='the default number of jobs to use when running ninja') - parser.add_argument('--parallel', - action='store_true', - default=False, - help='whether to run all instrumented builds in parallel') - parser.add_argument('--use_goma', - action='store_true', - default=False, - help='whether to use goma to compile') - parser.add_argument('build_type', - nargs='*', - default='all', - choices=BUILD_TYPES.keys() + ['all'], - help='the type of instrumented library to build') + parser.add_argument( + '--parallel', + action='store_true', + default=False, + help='whether to run all instrumented builds in parallel') + parser.add_argument( + '--use_goma', + action='store_true', + default=False, + help='whether to use goma to compile') + parser.add_argument( + 'build_type', + nargs='*', + default='all', + choices=BUILD_TYPES.keys() + ['all'], + help='the type of instrumented library to build') + parser.add_argument( + 'release', help='the name of the Ubuntu release to build with') args = parser.parse_args() if args.build_type == 'all' or 'all' in args.build_type: args.build_type = BUILD_TYPES.keys() - ubuntu_release = _get_release() - if ubuntu_release != SUPPORTED_RELEASE: - raise UnsupportedReleaseError('%s is not a supported release' % - _get_release()) + if args.release != _get_release(): + raise IncorrectReleaseError( + 'trying to build for %s but the current release is %s' % + (args.release, _get_release())) build_types = sorted(set(args.build_type)) if args.parallel: procs = [] for build_type in build_types: - proc = multiprocessing.Process(target=build_libraries, - args=(build_type, ubuntu_release, - args.jobs, args.use_goma)) + proc = multiprocessing.Process( + target=build_libraries, + args=(build_type, args.release, args.jobs, args.use_goma)) proc.start() procs.append(proc) for proc in procs: proc.join() else: for build_type in build_types: - build_libraries(build_type, ubuntu_release, args.jobs, args.use_goma) + build_libraries(build_type, args.release, args.jobs, args.use_goma) print 'To upload, run:' for build_type in build_types: - print('upload_to_google_storage.py -b ' - 'chromium-instrumented-libraries %s-%s.tgz' % - (build_type, ubuntu_release)) + print( + 'upload_to_google_storage.py -b ' + 'chromium-instrumented-libraries %s-%s.tgz' % + (build_type, args.release)) print 'You should then commit the resulting .sha1 files.' diff --git a/third_party/instrumented_libraries/scripts/unpack_binaries.py b/third_party/instrumented_libraries/scripts/unpack_binaries.py index 1fba5e4f90c383..e804810a272edd 100755 --- a/third_party/instrumented_libraries/scripts/unpack_binaries.py +++ b/third_party/instrumented_libraries/scripts/unpack_binaries.py @@ -12,8 +12,7 @@ def get_archive_name(archive_prefix): - release = 'xenial' - return '%s-%s.tgz' % (archive_prefix, release) + return archive_prefix + '.tgz' def main(archive_prefix, archive_dir, target_dir, stamp_dir=None): diff --git a/third_party/instrumented_libraries/xenial/BUILD.gn b/third_party/instrumented_libraries/xenial/BUILD.gn new file mode 100644 index 00000000000000..0602aed38a30a1 --- /dev/null +++ b/third_party/instrumented_libraries/xenial/BUILD.gn @@ -0,0 +1,852 @@ +# Copyright 2021 The Chromium Authors. All rights reserved. +# 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" ] +} diff --git a/third_party/instrumented_libraries/blacklists/msan/libglib2.0-0.txt b/third_party/instrumented_libraries/xenial/ignorelists/msan/libglib2.0-0.txt similarity index 100% rename from third_party/instrumented_libraries/blacklists/msan/libglib2.0-0.txt rename to third_party/instrumented_libraries/xenial/ignorelists/msan/libglib2.0-0.txt diff --git a/third_party/instrumented_libraries/blacklists/msan/libx11-6.txt b/third_party/instrumented_libraries/xenial/ignorelists/msan/libx11-6.txt similarity index 100% rename from third_party/instrumented_libraries/blacklists/msan/libx11-6.txt rename to third_party/instrumented_libraries/xenial/ignorelists/msan/libx11-6.txt diff --git a/third_party/instrumented_libraries/patches/libavahi-client3.diff b/third_party/instrumented_libraries/xenial/patches/libavahi-client3.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libavahi-client3.diff rename to third_party/instrumented_libraries/xenial/patches/libavahi-client3.diff diff --git a/third_party/instrumented_libraries/patches/libcups2.diff b/third_party/instrumented_libraries/xenial/patches/libcups2.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libcups2.diff rename to third_party/instrumented_libraries/xenial/patches/libcups2.diff diff --git a/third_party/instrumented_libraries/patches/libcurl3-gnutls.diff b/third_party/instrumented_libraries/xenial/patches/libcurl3-gnutls.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libcurl3-gnutls.diff rename to third_party/instrumented_libraries/xenial/patches/libcurl3-gnutls.diff diff --git a/third_party/instrumented_libraries/patches/libgnutls30.1.diff b/third_party/instrumented_libraries/xenial/patches/libgnutls30.1.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libgnutls30.1.diff rename to third_party/instrumented_libraries/xenial/patches/libgnutls30.1.diff diff --git a/third_party/instrumented_libraries/patches/libgnutls30.2.diff b/third_party/instrumented_libraries/xenial/patches/libgnutls30.2.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libgnutls30.2.diff rename to third_party/instrumented_libraries/xenial/patches/libgnutls30.2.diff diff --git a/third_party/instrumented_libraries/patches/libgtk-3-0.diff b/third_party/instrumented_libraries/xenial/patches/libgtk-3-0.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libgtk-3-0.diff rename to third_party/instrumented_libraries/xenial/patches/libgtk-3-0.diff diff --git a/third_party/instrumented_libraries/patches/libnih1.diff b/third_party/instrumented_libraries/xenial/patches/libnih1.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libnih1.diff rename to third_party/instrumented_libraries/xenial/patches/libnih1.diff diff --git a/third_party/instrumented_libraries/patches/libpixman-1-0.1.diff b/third_party/instrumented_libraries/xenial/patches/libpixman-1-0.1.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libpixman-1-0.1.diff rename to third_party/instrumented_libraries/xenial/patches/libpixman-1-0.1.diff diff --git a/third_party/instrumented_libraries/patches/libpixman-1-0.2.diff b/third_party/instrumented_libraries/xenial/patches/libpixman-1-0.2.diff similarity index 100% rename from third_party/instrumented_libraries/patches/libpixman-1-0.2.diff rename to third_party/instrumented_libraries/xenial/patches/libpixman-1-0.2.diff diff --git a/third_party/instrumented_libraries/patches/librtmp1.diff b/third_party/instrumented_libraries/xenial/patches/librtmp1.diff similarity index 100% rename from third_party/instrumented_libraries/patches/librtmp1.diff rename to third_party/instrumented_libraries/xenial/patches/librtmp1.diff diff --git a/third_party/instrumented_libraries/patches/nss.diff b/third_party/instrumented_libraries/xenial/patches/nss.diff similarity index 100% rename from third_party/instrumented_libraries/patches/nss.diff rename to third_party/instrumented_libraries/xenial/patches/nss.diff diff --git a/third_party/instrumented_libraries/patches/zlib1g.diff b/third_party/instrumented_libraries/xenial/patches/zlib1g.diff similarity index 100% rename from third_party/instrumented_libraries/patches/zlib1g.diff rename to third_party/instrumented_libraries/xenial/patches/zlib1g.diff diff --git a/third_party/instrumented_libraries/scripts/download_build_install.py b/third_party/instrumented_libraries/xenial/scripts/download_build_install.py similarity index 98% rename from third_party/instrumented_libraries/scripts/download_build_install.py rename to third_party/instrumented_libraries/xenial/scripts/download_build_install.py index 869e5780dda071..425d1c544d7cc8 100755 --- a/third_party/instrumented_libraries/scripts/download_build_install.py +++ b/third_party/instrumented_libraries/xenial/scripts/download_build_install.py @@ -69,9 +69,9 @@ def __init__(self, args, clobber): product_dir, 'instrumented_libraries', 'sources', self._package) self._cflags = unescape_flags(args.cflags) - if args.sanitizer_blacklist: - blacklist_file = real_path(args.sanitizer_blacklist) - self._cflags += ' -fsanitize-blacklist=%s' % blacklist_file + 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) @@ -496,7 +496,7 @@ def main(): # 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-blacklist', default='') + parser.add_argument('--sanitizer-ignorelist', default='') # The LIBDIR argument to configure/make. parser.add_argument('--libdir', default='lib') diff --git a/third_party/instrumented_libraries/scripts/fix_rpaths.sh b/third_party/instrumented_libraries/xenial/scripts/fix_rpaths.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/fix_rpaths.sh rename to third_party/instrumented_libraries/xenial/scripts/fix_rpaths.sh diff --git a/third_party/instrumented_libraries/scripts/install-build-deps.sh b/third_party/instrumented_libraries/xenial/scripts/install-build-deps.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/install-build-deps.sh rename to third_party/instrumented_libraries/xenial/scripts/install-build-deps.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/autogen.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/autogen.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/autogen.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/autogen.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/autoreconf.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/autoreconf.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/autoreconf.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/autoreconf.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/dh_autoreconf.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/dh_autoreconf.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/dh_autoreconf.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/dh_autoreconf.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/freetype.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/freetype.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/freetype.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/freetype.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libasound2.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libasound2.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libasound2.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libasound2.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libcups2.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libcups2.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libcups2.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libcups2.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libgdk-pixbuf2.0-0.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libgdk-pixbuf2.0-0.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libgdk-pixbuf2.0-0.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libgdk-pixbuf2.0-0.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libgtk-3-0.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libgtk-3-0.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libgtk-3-0.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libgtk-3-0.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libidn.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libidn.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libidn.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libidn.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libnih1.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libnih1.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libnih1.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libnih1.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libnspr4.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libnspr4.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libnspr4.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libnspr4.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libsasl2-2.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libsasl2-2.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libsasl2-2.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libsasl2-2.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/libva1.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/libva1.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/libva1.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/libva1.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/pulseaudio.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/pulseaudio.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/pulseaudio.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/pulseaudio.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/udev.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/udev.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/udev.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/udev.sh diff --git a/third_party/instrumented_libraries/scripts/pre-build/xkbcommon.sh b/third_party/instrumented_libraries/xenial/scripts/pre-build/xkbcommon.sh similarity index 100% rename from third_party/instrumented_libraries/scripts/pre-build/xkbcommon.sh rename to third_party/instrumented_libraries/xenial/scripts/pre-build/xkbcommon.sh