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.
This commit is contained in:
Mikhail Novosyolov 2021-02-06 17:17:58 +03:00
parent d9f0d84840
commit a06f6b0d20

View file

@ -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