[Libreoffice-commits] core.git: config_host.mk.in configure.ac external/skia solenv/gbuild

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 30 14:47:35 UTC 2020


 config_host.mk.in                       |    6 +++---
 configure.ac                            |   30 +++++++++++++++---------------
 external/skia/Library_skia.mk           |    2 +-
 solenv/gbuild/platform/com_GCC_class.mk |    4 ++--
 4 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 528ca2cec5b3e2a6f0c0d8719a4ad81d90920c9a
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Sep 30 11:31:55 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Sep 30 16:46:49 2020 +0200

    use -fpch-codegen rather than -fmodules-codegen
    
    The -fmodules-codegen flag has been in Clang for quite a while, but it
    officially works with PCHs only with Clang11+, and even there's
    it's better to use the properly named -fpch-codegen. This also
    fixes a problem with Clang9 having only -fmodules-codegen but
    not the -fno-* variant, causing the build to break.
    
    Change-Id: I9a8c979426f95e8c1f77cbeab1df64390d7243b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103677
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 41a3f76c2b44..6fff52b8a74c 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -470,9 +470,9 @@ export LIBO_PATH_SEPARATOR=@P_SEP@
 export PAGEMAKER_CFLAGS=$(gb_SPACE)@PAGEMAKER_CFLAGS@
 export PAGEMAKER_LIBS=$(gb_SPACE)@PAGEMAKER_LIBS@
 export PCH_INSTANTIATE_TEMPLATES=@PCH_INSTANTIATE_TEMPLATES@
-export PCH_MODULES_CODEGEN=@PCH_MODULES_CODEGEN@
-export PCH_MODULES_DEBUGINFO=@PCH_MODULES_DEBUGINFO@
-export PCH_NO_MODULES_CODEGEN=@PCH_NO_MODULES_CODEGEN@
+export PCH_CODEGEN=@PCH_CODEGEN@
+export PCH_DEBUGINFO=@PCH_DEBUGINFO@
+export PCH_NO_CODEGEN=@PCH_NO_CODEGEN@
 export PERL=@PERL@
 export PKGFORMAT=@PKGFORMAT@
 export PKGMK=@PKGMK@
diff --git a/configure.ac b/configure.ac
index 7aeb5ef1588e..e235dabcc8b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5516,42 +5516,42 @@ if test -n "$ENABLE_PCH"; then
 fi
 AC_SUBST(BUILDING_PCH_WITH_OBJ)
 
-PCH_MODULES_CODEGEN=
-PCH_NO_MODULES_CODEGEN=
+PCH_CODEGEN=
+PCH_NO_CODEGEN=
 if test -n "$BUILDING_PCH_WITH_OBJ"; then
-    AC_MSG_CHECKING([whether $CC supports -Xclang -fmodules-codegen])
+    AC_MSG_CHECKING([whether $CC supports -fpch-codegen])
     save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -Xclang -fmodules-codegen"
+    CFLAGS="$CFLAGS -Werror -fpch-codegen"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
         [
-        PCH_MODULES_CODEGEN="-Xclang -fmodules-codegen"
-        PCH_NO_MODULES_CODEGEN="-Xclang -fno-modules-codegen"
+        PCH_CODEGEN="-fpch-codegen"
+        PCH_NO_CODEGEN="-fno-pch-codegen"
         ],[])
     CFLAGS=$save_CFLAGS
-    if test -n "$PCH_MODULES_CODEGEN"; then
+    if test -n "$PCH_CODEGEN"; then
         AC_MSG_RESULT(yes)
     else
         AC_MSG_RESULT(no)
     fi
     CFLAGS=$save_CFLAGS
 fi
-AC_SUBST(PCH_MODULES_CODEGEN)
-AC_SUBST(PCH_NO_MODULES_CODEGEN)
-PCH_MODULES_DEBUGINFO=
+AC_SUBST(PCH_CODEGEN)
+AC_SUBST(PCH_NO_CODEGEN)
+PCH_DEBUGINFO=
 if test -n "$BUILDING_PCH_WITH_OBJ"; then
-    AC_MSG_CHECKING([whether $CC supports -Xclang -fmodules-debuginfo])
+    AC_MSG_CHECKING([whether $CC supports -fpch-debuginfo])
     save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -Xclang -fmodules-debuginfo"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_MODULES_DEBUGINFO="-Xclang -fmodules-debuginfo" ],[])
+    CFLAGS="$CFLAGS -Werror -fpch-debuginfo"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_DEBUGINFO="-fpch-debuginfo" ],[])
     CFLAGS=$save_CFLAGS
-    if test -n "$PCH_MODULES_DEBUGINFO"; then
+    if test -n "$PCH_DEBUGINFO"; then
         AC_MSG_RESULT(yes)
     else
         AC_MSG_RESULT(no)
     fi
     CFLAGS=$save_CFLAGS
 fi
-AC_SUBST(PCH_MODULES_DEBUGINFO)
+AC_SUBST(PCH_DEBUGINFO)
 
 TAB=`printf '\t'`
 
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index feda0793b566..7712c6be9e77 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -29,7 +29,7 @@ $(eval $(call gb_Library_add_defs,skia,\
 ifeq ($(ENABLE_SKIA_DEBUG),)
 $(eval $(call gb_Library_add_cxxflags,skia, \
     $(gb_COMPILEROPTFLAGS) \
-    $(PCH_NO_MODULES_CODEGEN) \
+    $(PCH_NO_CODEGEN) \
 ))
 endif
 
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 4d3003923433..c29e2a979fd9 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -114,11 +114,11 @@ ifneq ($(BUILDING_PCH_WITH_OBJ),)
 gb_LinkTarget_LDFLAGS += $(LD_GC_SECTIONS)
 gb_PrecompiledHeader_pch_with_obj += -ffunction-sections -fdata-sections
 # Enable generating more shared code and debuginfo in the PCH object file.
-gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_MODULES_DEBUGINFO)
+gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_DEBUGINFO)
 ifeq ($(ENABLE_OPTIMIZED),)
 # -fmodules-codegen appears to be worth it only if not optimizing, otherwise optimizing all the functions emitted
 # in the PCH object file may take way too long, especially given that many of those may get thrown away
-gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_MODULES_CODEGEN)
+gb_PrecompiledHeader_extra_pch_cxxflags += $(PCH_CODEGEN)
 endif
 endif
 


More information about the Libreoffice-commits mailing list