From a06f6b0d20f00e6e1f20bd255064b4db785b253a Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sat, 6 Feb 2021 17:17:58 +0300 Subject: [PATCH] Fix building gn on rosa2016.1 Commit d9f0d84840 ("Build with llvm11") removed "-stdlib=libc++". Building of the gn utility which is used to build Chromium (and is not packaged) requires a newer libstdc++ than the one in rosa2016.1. Fix building it by using libstdc++-gcc10. This is a better solution than the one removed by that commit because compiler flags will not influence the build of Chromium itlsef. --- chromium-browser-stable.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chromium-browser-stable.spec b/chromium-browser-stable.spec index 444f519..6e15ed6 100644 --- a/chromium-browser-stable.spec +++ b/chromium-browser-stable.spec @@ -154,6 +154,8 @@ BuildRequires: libcxx-devel BuildRequires: libcxxabi-devel BuildRequires: lld %endif +# for gn, not chromium itself +BuildRequires: stdc++-gcc10-devel # gn needs these BuildRequires: flex %if %{with bundled_llvm} @@ -576,6 +578,16 @@ CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-v %endif export PYTHON=%{__python} +# libstdc++ in rosa2016.1 is too old to build gn, there are 2 ways to solve this: +# 1) run bootstrap.py with --use-custom-libcxx, it will build and use bundled libc++ +# 2) use libstdc++-gcc10 (https://forum.rosalinux.ru/viewtopic.php?t=10047&p=104560) +# Let's choose option 2. +LDFLAGS="-lstdc++-gcc10" \ +CXXFLAGS="-nostdinc++ \ + -Wno-unused-command-line-argument \ + -I%{_includedir}/libstdc++-gcc10 \ + -I%{_includedir}/libstdc++-gcc10/%{_host} \ + " \ %{__python} tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}' out/Release/gn gen --script-executable=%{__python} --args='%{gn_config}' out/Release