diff options
| author | Paul Eggert | 2015-04-03 13:05:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-04-03 13:06:02 -0700 |
| commit | 95ef69e7468e598d6f4ae875f683b3996ecc02eb (patch) | |
| tree | 5b0dc6be8b01deabc2f4dfa591eaafa3065e51b6 | |
| parent | 8596eb1282c4d5bdb22b20c155183b39fdc8eb00 (diff) | |
| download | emacs-95ef69e7468e598d6f4ae875f683b3996ecc02eb.tar.gz emacs-95ef69e7468e598d6f4ae875f683b3996ecc02eb.zip | |
Port 'configure' to clang 3.5
* configure.ac: Add -Wno-unknown-attributes if clang; otherwise
clang 3.5.0 (Fedora 21 x86-64) complains
"/usr/include/glib-2.0/glib/gmem.h: ... warning: unknown attribute
'__alloc_size__' ignored". Use -Werror when checking for -nopie;
otherwise clang warns about -nopie instead of failing, and then
later it warns everytime the build uses -nopie.
| -rw-r--r-- | ChangeLog | 10 | ||||
| -rw-r--r-- | configure.ac | 23 |
2 files changed, 25 insertions, 8 deletions
| @@ -1,3 +1,13 @@ | |||
| 1 | 2015-04-03 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Port 'configure' to clang 3.5 | ||
| 4 | * configure.ac: Add -Wno-unknown-attributes if clang; otherwise | ||
| 5 | clang 3.5.0 (Fedora 21 x86-64) complains | ||
| 6 | "/usr/include/glib-2.0/glib/gmem.h: ... warning: unknown attribute | ||
| 7 | '__alloc_size__' ignored". Use -Werror when checking for -nopie; | ||
| 8 | otherwise clang warns about -nopie instead of failing, and then | ||
| 9 | later it warns everytime the build uses -nopie. | ||
| 10 | |||
| 1 | 2015-04-03 Ulrich Müller <ulm@gentoo.org> | 11 | 2015-04-03 Ulrich Müller <ulm@gentoo.org> |
| 2 | 12 | ||
| 3 | * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it | 13 | * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it |
diff --git a/configure.ac b/configure.ac index d2a9b375e40..c504ed436cc 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -883,6 +883,7 @@ if test "$gl_gcc_warnings" != yes; then | |||
| 883 | gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) | 883 | gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) |
| 884 | gl_WARN_ADD([-Wno-pointer-sign]) | 884 | gl_WARN_ADD([-Wno-pointer-sign]) |
| 885 | gl_WARN_ADD([-Wno-string-plus-int]) | 885 | gl_WARN_ADD([-Wno-string-plus-int]) |
| 886 | gl_WARN_ADD([-Wno-unknown-attributes]) | ||
| 886 | fi | 887 | fi |
| 887 | else | 888 | else |
| 888 | isystem='-isystem ' | 889 | isystem='-isystem ' |
| @@ -5030,16 +5031,22 @@ case "$opsys" in | |||
| 5030 | *) LD_SWITCH_SYSTEM_TEMACS= ;; | 5031 | *) LD_SWITCH_SYSTEM_TEMACS= ;; |
| 5031 | esac | 5032 | esac |
| 5032 | 5033 | ||
| 5033 | AC_CACHE_CHECK([whether the linker accepts -nopie], | 5034 | # -nopie fixes a temacs segfault on Gentoo for some reason (Bug#18784). |
| 5035 | # We don't know why -nopie works, but not segfaulting is better than | ||
| 5036 | # segfaulting. Use -Werror when trying -nopie, otherwise clang keeps | ||
| 5037 | # warning that it does not understand -nopie. | ||
| 5038 | AC_CACHE_CHECK([whether $CC accepts -nopie], | ||
| 5034 | [emacs_cv_prog_cc_nopie], | 5039 | [emacs_cv_prog_cc_nopie], |
| 5035 | [emacs_save_LDFLAGS=$LDFLAGS | 5040 | [emacs_save_CFLAGS=$CFLAGS |
| 5036 | LDFLAGS="$LDFLAGS -nopie" | 5041 | emacs_save_LDFLAGS=$LDFLAGS |
| 5037 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], | 5042 | CFLAGS="$CFLAGS -Werror" |
| 5038 | [emacs_cv_prog_cc_nopie=yes], | 5043 | LDFLAGS="$LDFLAGS -nopie" |
| 5039 | [emacs_cv_prog_cc_nopie=no]) | 5044 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
| 5040 | LDFLAGS=$emacs_save_LDFLAGS]) | 5045 | [emacs_cv_prog_cc_nopie=yes], |
| 5046 | [emacs_cv_prog_cc_nopie=no]) | ||
| 5047 | CFLAGS=$emacs_save_CFLAGS | ||
| 5048 | LDFLAGS=$emacs_save_LDFLAGS]) | ||
| 5041 | if test "$emacs_cv_prog_cc_nopie" = yes; then | 5049 | if test "$emacs_cv_prog_cc_nopie" = yes; then |
| 5042 | # Disable PIE to avoid segfaults in temacs (bug#18784) | ||
| 5043 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" | 5050 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" |
| 5044 | fi | 5051 | fi |
| 5045 | 5052 | ||