From 1312ec35a03a4fda4fe17a79820756830efae053 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sat, 4 Apr 2020 14:42:04 +0300 Subject: [PATCH] Don't use %%clang_gcc_wrapper because it fails to deal with complex quotation like -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT' --- libreoffice.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libreoffice.spec b/libreoffice.spec index 2222217..c8d3218 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -2951,13 +2951,23 @@ export CCACHE_DIR=%{ccachedir} %setup_compile_flags %if %{with clang} +# not using %%clang_gcc_wrapper here because it fails +# to deal with complex quotation like +# -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT' +for i in %noclang_optflags ; do + export CFLAGS="$(echo "$CFLAGS" | sed -e "s,${i},,g")" + export CXXFLAGS="$(echo "$CXXFLAGS" | sed -e "s,${i},,g")" +done +mkdir -p local_bin +install -m0755 %{SOURCE80} "local_bin/clang++" +export PATH="${PWD}/local_bin:${PATH}" +export CC=clang +export CXX=clang++ +export CPP=clang-cpp # libstdc++ from gcc5 is too old, use newer version of libstdc++ export CPPFLAGS="$CPPFLAGS -I%{_includedir}/libstdc++-gcc10 -I%{_includedir}/libstdc++-gcc10/%{_host}" export CXXFLAGS="$CXXFLAGS -nostdinc++ $CPPFLAGS -Wno-unused-command-line-argument" -%clang_gcc_wrapper export LIBCCX_LIBS="-lstdc++-gcc10" -install -m0755 %{SOURCE80} "local_bin/clang++wr" -sed -i -e "s,/usr/bin/clang++,${PWD}/local_bin/clang++wr,g" "local_bin/clang++" %endif echo "Configure start at: "`date` >> ooobuildtime.log