From 75980382cb50e957951ed84ff7e7e8d9a30fdc85 Mon Sep 17 00:00:00 2001 From: Eloston Date: Tue, 13 Mar 2018 10:06:51 +0000 Subject: [PATCH] Add fix-building-with-custom-libcxx.patch This patch fixes building with Clang versions < 6, since they don't have support for the argument -nostdlib++ --- .../debian_stretch/patch_order.list | 1 + .../linux_portable/patch_order.list | 1 + .../ubuntu_artful/patch_order.list | 1 + .../fix-building-with-custom-libcxx.patch | 40 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 resources/patches/ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch diff --git a/resources/config_bundles/debian_stretch/patch_order.list b/resources/config_bundles/debian_stretch/patch_order.list index 102989ae..01739986 100644 --- a/resources/config_bundles/debian_stretch/patch_order.list +++ b/resources/config_bundles/debian_stretch/patch_order.list @@ -1 +1,2 @@ ungoogled-chromium/linux/manpage.patch +ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch diff --git a/resources/config_bundles/linux_portable/patch_order.list b/resources/config_bundles/linux_portable/patch_order.list index bb6bcc31..5ccd4cc7 100644 --- a/resources/config_bundles/linux_portable/patch_order.list +++ b/resources/config_bundles/linux_portable/patch_order.list @@ -1,3 +1,4 @@ ubuntu/no-new-ninja-flag.patch ubuntu/relax-ninja-version-requirement.patch ungoogled-chromium/linux/manpage.patch +ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch diff --git a/resources/config_bundles/ubuntu_artful/patch_order.list b/resources/config_bundles/ubuntu_artful/patch_order.list index 102989ae..01739986 100644 --- a/resources/config_bundles/ubuntu_artful/patch_order.list +++ b/resources/config_bundles/ubuntu_artful/patch_order.list @@ -1 +1,2 @@ ungoogled-chromium/linux/manpage.patch +ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch diff --git a/resources/patches/ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch b/resources/patches/ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch new file mode 100644 index 00000000..412447e7 --- /dev/null +++ b/resources/patches/ungoogled-chromium/linux/fix-building-with-custom-libcxx.patch @@ -0,0 +1,40 @@ +# Fix building with use_custom_libcxx=true +# Currently, it removes the use of -nostdlib++, which isn't available in +# clang versions < 6 + +--- a/build/config/posix/BUILD.gn ++++ b/build/config/posix/BUILD.gn +@@ -58,22 +58,18 @@ config("runtime_library") { + } + + # Make sure we don't link against libc++ or libstdc++. +- if (is_clang) { +- ldflags += [ "-nostdlib++" ] +- } else { +- ldflags += [ "-nodefaultlibs" ] ++ ldflags += [ "-nodefaultlibs" ] + +- # Unfortunately, there's no way to disable linking against just libc++ +- # (gcc doesn't have -notstdlib++: +- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83931); -nodefaultlibs +- # removes all of the default libraries, so add back the ones that we need. +- libs += [ +- "c", +- "gcc_s", +- "m", +- "rt", +- ] +- } ++ # Unfortunately, there's no way to disable linking against just libc++ ++ # (gcc doesn't have -notstdlib++: ++ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83931); -nodefaultlibs ++ # removes all of the default libraries, so add back the ones that we need. ++ libs += [ ++ "c", ++ "gcc_s", ++ "m", ++ "rt", ++ ] + } + + if (!is_mac && !is_ios && sysroot != "") {