]> mj.ucw.cz Git - libucw.git/commitdiff
Configure: Experimental CONFIG_LTO
authorMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2015 15:13:15 +0000 (16:13 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2015 15:13:15 +0000 (16:13 +0100)
default.cfg
ucw/perl/UCW/Configure/C.pm

index 9a43ab604455fd65795d87a9cacc45bb739951d6..4788b156e1b772c0416a5deacb14f2f2dd43923f 100644 (file)
@@ -10,6 +10,9 @@ Set("CONFIG_DEBUG");
 # We want the public API
 Set("CONFIG_INSTALL_API");
 
+# Enable GCC link-time optimizations (experimental)
+UnSet("CONFIG_LTO");
+
 # LibUCW should support files >2GB and threading
 Set("CONFIG_UCW_LARGE_FILES");
 Set("CONFIG_UCW_THREADS" => 1);
index 95644b4504e0f00f36037aeecdb7e1d7cffc2874..7cd3da9e8e352a5ec45931663c1d6b47095ab54b 100644 (file)
@@ -170,6 +170,16 @@ if (IsSet("CONFIG_DEBUG")) {
        Append("LOPT" => "-s");
 }
 
+# Link-time optimization (experimental)
+# This is currently very inefficient, because we do not attempt to disable
+# optimizations when compiling individual modules. Therefore, we optimize
+# each shared library module twice: when compiling and when linking.
+# Doing it properly would require hacking makefiles.
+if (IsSet("CONFIG_LTO")) {
+       Append("LOPT", "-flto");
+       Append("COPT", "-flto");
+}
+
 if (IsSet("CONFIG_DARWIN")) {
        # gcc-4.0 on Darwin doesn't set this in the gnu99 mode
        Append("CLANG" => "-fnested-functions");