From 1b2077412c3040cfb4ce5f300d4ee4b7ca2a47df Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 31 Mar 2020 23:29:08 +0300 Subject: [PATCH] w/a combinations of incompatible clang++ args, try to avoid overlinkg --- libreoffice.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libreoffice.spec b/libreoffice.spec index 3ff4d7d..0017c72 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -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