w/a combinations of incompatible clang++ args, try to avoid overlinkg

This commit is contained in:
Mikhail Novosyolov 2020-03-31 23:29:08 +03:00
parent 235b2b6468
commit 1b2077412c

View file

@ -49,7 +49,7 @@ Summary: Office suite
Name: libreoffice
Epoch: 1
Version: 6.3.5
Release: 5
Release: 6
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic
Group: Office
Url: http://www.libreoffice.org
@ -2962,9 +2962,15 @@ export CCACHE_DIR=%{ccachedir}
%endif
%if %{with clang}
%global optflags $(echo %{optflags} | sed -e 's/-fvar-tracking-assignments//g' -e 's/-frecord-gcc-switches//g' -e 's/-ffat-lto-objects//g')
%global optflags %{optflags} -stdlib=libc++ -nostdinc++ -I/usr/include/c++/v1
%global ldflags %{ldflags} -stdlib=libc++ -nostdinc++ -lc++ -lc++abi
%setup_compile_flags
# libstdc++ from gcc5 is too old, use LLVM libc++
# https://libcxx.llvm.org/docs/UsingLibcxx.html
# clang -c -stdlib=libc++ ->
# -> "argument unused during compilation: '-stdlib=libc++'" ->
# -> -Wno-unused-command-line-argument
export CXXFLAGS="$CXXFLAGS -stdlib=libc++ -nostdinc++ -I/usr/include/c++/v1 -Wno-unused-command-line-argument"
# Try to avoid overlinkg C code with libc++ by adjusting CXXFLAGS instead of LDFLAGS
export CXXFLAGS="$CXXFLAGS -Xlinker -lc++ -Xlinker -lc++abi"
%clang_gcc_wrapper
export CPP=""
%else