aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--INSTALL17
-rw-r--r--configure.ac72
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/PROBLEMS14
5 files changed, 80 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index c66f6b726f5..c4ee59eb844 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12014-05-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * configure.ac (--enable-link-time-optimization): Add clang support.
4 * INSTALL: Mention it.
5
12014-05-12 Katsumi Yamaoka <yamaoka@jpl.org> 62014-05-12 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * configure.ac (EMACS_CHECK_MODULES): Fix typo in previous change. 8 * configure.ac (EMACS_CHECK_MODULES): Fix typo in previous change.
diff --git a/INSTALL b/INSTALL
index 496c6c8c376..3502631cbcf 100644
--- a/INSTALL
+++ b/INSTALL
@@ -331,12 +331,17 @@ and is useful with GNU-compatible compilers. On a recent GNU system
331there should be no warnings; on older and on non-GNU systems the 331there should be no warnings; on older and on non-GNU systems the
332generated warnings may still be useful. 332generated warnings may still be useful.
333 333
334Use --enable-link-time-optimization to enable link-time optimizer, which 334Use --enable-link-time-optimization to enable link-time optimizer. If
335is available in GNU compiler since version 4.5.0. If your compiler is not 335you're using GNU compiler, this feature is supported since version 4.5.0.
336GNU or older than version 4.5.0, this option does nothing. If `configure' 336If `configure' can determine number of online CPUS on your system, final
337can determine number of online CPUS on your system, final link-time 337link-time optimization and code generation is executed in parallel using
338optimization and code generation is executed in parallel using one job 338one job per each available online CPU.
339per each available online CPU. 339
340This option is also supported for clang. You should have GNU binutils
341with `gold' linker and plugin support, and clang with LLVMgold.so plugin.
342Read http://llvm.org/docs/GoldPlugin.html for details. Also note that
343this feature is still experimental, so prepare to build binutils and
344clang from the corresponding source code repositories.
340 345
341The `--prefix=PREFIXDIR' option specifies where the installation process 346The `--prefix=PREFIXDIR' option specifies where the installation process
342should put emacs and its data files. This defaults to `/usr/local'. 347should put emacs and its data files. This defaults to `/usr/local'.
diff --git a/configure.ac b/configure.ac
index a0d6abc4b1a..b2ce64adeb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -762,32 +762,6 @@ AC_ARG_ENABLE([gcc-warnings],
762 [gl_gcc_warnings=no] 762 [gl_gcc_warnings=no]
763) 763)
764 764
765AC_ARG_ENABLE(link-time-optimization,
766[AS_HELP_STRING([--enable-link-time-optimization],
767 [build emacs with link-time optimization.
768 This is supported only for GCC since 4.5.0.])],
769if test "${enableval}" != "no"; then
770 AC_MSG_CHECKING([whether link-time optimization is supported])
771 ac_lto_supported=no
772 if test x$GCC = xyes; then
773 CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
774 if test x$CPUS != x; then
775 LTO="-flto=$CPUS"
776 else
777 LTO="-flto"
778 fi
779 old_CFLAGS=$CFLAGS
780 CFLAGS="$CFLAGS $LTO"
781 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
782 [ac_lto_supported=yes], [ac_lto_supported=no])
783 CFLAGS="$old_CFLAGS"
784 fi
785 AC_MSG_RESULT([$ac_lto_supported])
786 if test "$ac_lto_supported" = "yes"; then
787 CFLAGS="$CFLAGS $LTO"
788 fi
789fi)
790
791# clang is unduly picky about some things. 765# clang is unduly picky about some things.
792AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang], 766AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
793 [AC_COMPILE_IFELSE( 767 [AC_COMPILE_IFELSE(
@@ -913,7 +887,51 @@ edit_cflags="
913 s/^ // 887 s/^ //
914" 888"
915 889
916 890AC_ARG_ENABLE(link-time-optimization,
891[AS_HELP_STRING([--enable-link-time-optimization],
892 [build emacs with link-time optimization.
893 This is supported for gcc since 4.5.0 and clang.
894 Note that clang support is experimental - see INSTALL])],
895if test "${enableval}" != "no"; then
896 ac_lto_supported=no
897 if test $emacs_cv_clang = yes; then
898 AC_MSG_CHECKING([whether link-time optimization is supported by clang])
899 GOLD_PLUGIN=`$CC -print-file-name=LLVMgold.so 2>/dev/null`
900 if test -x "$GOLD_PLUGIN"; then
901 LTO="-flto"
902 fi
903 elif test x$GCC = xyes; then
904 AC_MSG_CHECKING([whether link-time optimization is supported by gcc])
905 CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
906 if test x$CPUS != x; then
907 LTO="-flto=$CPUS"
908 else
909 LTO="-flto"
910 fi
911 else
912 AC_MSG_ERROR([Link-time optimization is not supported with your compiler.])
913 fi
914 if test -z "$LTO"; then
915 ac_lto_supported=no
916 else
917 old_CFLAGS=$CFLAGS
918 CFLAGS="$CFLAGS $LTO"
919 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
920 [ac_lto_supported=yes], [ac_lto_supported=no])
921 CFLAGS="$old_CFLAGS"
922 fi
923 AC_MSG_RESULT([$ac_lto_supported])
924 if test "$ac_lto_supported" = "yes"; then
925 CFLAGS="$CFLAGS $LTO"
926 if test x$emacs_cv_clang = xyes; then
927 AC_MSG_WARN([Please read INSTALL before using link-time optimization with clang])
928 # WARNING: 'ar --plugin ...' doesn't work without
929 # command, so plugin name is appended to ARFLAGS.
930 ARFLAGS="cru --plugin $GOLD_PLUGIN"
931 RANLIB="$RANLIB --plugin $GOLD_PLUGIN"
932 fi
933 fi
934fi)
917 935
918dnl Some other nice autoconf tests. 936dnl Some other nice autoconf tests.
919dnl These are commented out, since gl_EARLY and/or Autoconf already does them. 937dnl These are commented out, since gl_EARLY and/or Autoconf already does them.
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 3eb1c564fad..ea0db240725 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12014-05-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * PROBLEMS: Mention potential problems with
4 --enable-link-time-optimization and clang on Fedora 20.
5
12014-05-04 Leo Liu <sdl.web@gmail.com> 62014-05-04 Leo Liu <sdl.web@gmail.com>
2 7
3 * NEWS: Mention support for Chinese dates in calendar and diary. 8 * NEWS: Mention support for Chinese dates in calendar and diary.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index cf025ce4b9e..6ea699384f1 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -836,6 +836,20 @@ you want to use fcitx with Emacs, you have two choices. Toggle fcitx
836by another key (e.g. C-\) by modifying ~/.fcitx/config, or be 836by another key (e.g. C-\) by modifying ~/.fcitx/config, or be
837accustomed to use C-@ for `set-mark-command'. 837accustomed to use C-@ for `set-mark-command'.
838 838
839*** Link-time optimization with clang doesn't work on Fedora 20.
840
841As of May 2014, Fedora 20 has broken LLVMgold.so plugin support in clang
842(tested with clang-3.4-6.fc20) - `clang --print-file-name=LLVMgold.so'
843prints `LLVMgold.so' instead of full path to plugin shared library, and
844`clang -flto' is unable to find the plugin with the following error:
845
846/bin/ld: error: /usr/bin/../lib/LLVMgold.so: could not load plugin library:
847/usr/bin/../lib/LLVMgold.so: cannot open shared object file: No such file
848or directory
849
850The only way to avoid this is to build your own clang from source code
851repositories, as described at http://clang.llvm.org/get_started.html.
852
839*** M-SPC seems to be ignored as input. 853*** M-SPC seems to be ignored as input.
840 854
841See if your X server is set up to use this as a command 855See if your X server is set up to use this as a command