diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | INSTALL | 17 | ||||
| -rw-r--r-- | configure.ac | 72 | ||||
| -rw-r--r-- | etc/ChangeLog | 5 | ||||
| -rw-r--r-- | etc/PROBLEMS | 14 |
5 files changed, 80 insertions, 33 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-05-13 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * configure.ac (--enable-link-time-optimization): Add clang support. | ||
| 4 | * INSTALL: Mention it. | ||
| 5 | |||
| 1 | 2014-05-12 Katsumi Yamaoka <yamaoka@jpl.org> | 6 | 2014-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. |
| @@ -331,12 +331,17 @@ and is useful with GNU-compatible compilers. On a recent GNU system | |||
| 331 | there should be no warnings; on older and on non-GNU systems the | 331 | there should be no warnings; on older and on non-GNU systems the |
| 332 | generated warnings may still be useful. | 332 | generated warnings may still be useful. |
| 333 | 333 | ||
| 334 | Use --enable-link-time-optimization to enable link-time optimizer, which | 334 | Use --enable-link-time-optimization to enable link-time optimizer. If |
| 335 | is available in GNU compiler since version 4.5.0. If your compiler is not | 335 | you're using GNU compiler, this feature is supported since version 4.5.0. |
| 336 | GNU or older than version 4.5.0, this option does nothing. If `configure' | 336 | If `configure' can determine number of online CPUS on your system, final |
| 337 | can determine number of online CPUS on your system, final link-time | 337 | link-time optimization and code generation is executed in parallel using |
| 338 | optimization and code generation is executed in parallel using one job | 338 | one job per each available online CPU. |
| 339 | per each available online CPU. | 339 | |
| 340 | This option is also supported for clang. You should have GNU binutils | ||
| 341 | with `gold' linker and plugin support, and clang with LLVMgold.so plugin. | ||
| 342 | Read http://llvm.org/docs/GoldPlugin.html for details. Also note that | ||
| 343 | this feature is still experimental, so prepare to build binutils and | ||
| 344 | clang from the corresponding source code repositories. | ||
| 340 | 345 | ||
| 341 | The `--prefix=PREFIXDIR' option specifies where the installation process | 346 | The `--prefix=PREFIXDIR' option specifies where the installation process |
| 342 | should put emacs and its data files. This defaults to `/usr/local'. | 347 | should 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 | ||
| 765 | AC_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.])], | ||
| 769 | if 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 | ||
| 789 | fi) | ||
| 790 | |||
| 791 | # clang is unduly picky about some things. | 765 | # clang is unduly picky about some things. |
| 792 | AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang], | 766 | AC_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 | 890 | AC_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])], | ||
| 895 | if 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 | ||
| 934 | fi) | ||
| 917 | 935 | ||
| 918 | dnl Some other nice autoconf tests. | 936 | dnl Some other nice autoconf tests. |
| 919 | dnl These are commented out, since gl_EARLY and/or Autoconf already does them. | 937 | dnl 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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-05-04 Leo Liu <sdl.web@gmail.com> | 6 | 2014-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 | |||
| 836 | by another key (e.g. C-\) by modifying ~/.fcitx/config, or be | 836 | by another key (e.g. C-\) by modifying ~/.fcitx/config, or be |
| 837 | accustomed to use C-@ for `set-mark-command'. | 837 | accustomed to use C-@ for `set-mark-command'. |
| 838 | 838 | ||
| 839 | *** Link-time optimization with clang doesn't work on Fedora 20. | ||
| 840 | |||
| 841 | As 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' | ||
| 843 | prints `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 | ||
| 848 | or directory | ||
| 849 | |||
| 850 | The only way to avoid this is to build your own clang from source code | ||
| 851 | repositories, 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 | ||
| 841 | See if your X server is set up to use this as a command | 855 | See if your X server is set up to use this as a command |