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