unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Doug Lewan <dougl@shubertticketing.com>
Cc: 14258-done@debbugs.gnu.org
Subject: bug#14258: Can't compile 24.3 on AIX 6.1
Date: Fri, 26 Apr 2013 12:35:07 -0700	[thread overview]
Message-ID: <517AD6EB.4030708@cs.ucla.edu> (raw)
In-Reply-To: <155DEC68569B714B86C2C7075F5EDA9828F0E37D@DAKIYA1.pegasus.local>

On 04/26/2013 08:05 AM, Doug Lewan wrote:

> 'xlc -O' worked!

Thanks for checking.  I installed the following patch to the trunk
to try to make this go a bit easier in the next release, and I'm
marking the bug as done.

=== modified file 'ChangeLog'
--- ChangeLog	2013-04-22 05:08:36 +0000
+++ ChangeLog	2013-04-26 19:31:09 +0000
@@ -1,3 +1,10 @@
+2013-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Port better to AIX (Bug#14258).
+	* configure.ac (CFLAGS): Append -O if the user did not specify CFLAGS,
+	we did not already infer an optimization option, and -O works.
+	AIX xlc needs -O, otherwise garbage collection doesn't work.
+
 2013-04-22  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* make-dist: Do not distribute admin/unidata/Makefile.

=== modified file 'configure.ac'
--- configure.ac	2013-04-18 17:12:21 +0000
+++ configure.ac	2013-04-26 19:31:09 +0000
@@ -613,10 +613,10 @@
 dnl Amongst other things, this sets AR and ARFLAGS.
 gl_EARLY
 
-# It's helpful to have C macros available to GDB, so prefer -g3 to -g
-# if -g3 works and the user does not specify CFLAGS.
-# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
 if test "$ac_test_CFLAGS" != set; then
+  # It's helpful to have C macros available to GDB, so prefer -g3 to -g
+  # if -g3 works and the user does not specify CFLAGS.
+  # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
   case $CFLAGS in
     '-g')
       emacs_g3_CFLAGS='-g3';;
@@ -632,13 +632,29 @@
       [emacs_cv_prog_cc_g3],
       [AC_LINK_IFELSE([AC_LANG_PROGRAM()],
 	 [emacs_cv_prog_cc_g3=yes],
-         [emacs_cv_prog_cc_g3=no])])
-    if test $emacs_cv_prog_cc_g3 = yes; then
-      CFLAGS=$emacs_g3_CFLAGS
-    else
+	 [emacs_cv_prog_cc_g3=no])])
+    if test $emacs_cv_prog_cc_g3 != yes; then
       CFLAGS=$emacs_save_CFLAGS
     fi
   fi
+
+  case $CFLAGS in
+    *-O*) ;;
+    *)
+      # No optimization flag was inferred for this non-GCC compiler.
+      # Try -O.  This is needed for xlc on AIX; see Bug#14258.
+      emacs_save_CFLAGS=$CFLAGS
+      test -z "$CFLAGS" || CFLAGS="$CFLAGS "
+      CFLAGS=${CFLAGS}-O
+      AC_CACHE_CHECK([whether $CC accepts -O],
+        [emacs_cv_prog_cc_o],
+	[AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+	   [emacs_cv_prog_cc_o=yes],
+	   [emacs_cv_prog_cc_o=no])])
+      if test $emacs_cv_prog_cc_o != yes; then
+	CFLAGS=$emacs_save_CFLAGS
+      fi ;;
+  esac
 fi
 
 AC_ARG_ENABLE([gcc-warnings],

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2013-04-24 15:09:49 +0000
+++ src/ChangeLog	2013-04-26 19:31:09 +0000
@@ -1,3 +1,9 @@
+2013-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Port better to AIX (Bug#14258).
+	* lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
+	to pacify AIX xlc.
+
 2013-04-24  Kenichi Handa  <handa@gnu.org>
 
 	* coding.c (decode_coding_iso_2022): When an invalid escape

=== modified file 'src/lisp.h'
--- src/lisp.h	2013-04-07 04:41:19 +0000
+++ src/lisp.h	2013-04-26 19:31:09 +0000
@@ -231,9 +231,9 @@
 #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1
 #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0)
 
-/* Stolen from GDB.  The only known compiler that doesn't support
-   enums in bitfields is MSVC.  */
-#ifdef _MSC_VER
+/* Idea stolen from GDB.  MSVC doesn't support enums in bitfields,
+   and xlc complains vociferously about them.  */
+#if defined _MSC_VER || defined __IBMC__
 #define ENUM_BF(TYPE) unsigned int
 #else
 #define ENUM_BF(TYPE) enum TYPE







      reply	other threads:[~2013-04-26 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 13:51 bug#14258: Can't compile 24.3 on AIX 6.1 Doug Lewan
2013-04-24 19:39 ` Erik Charlebois
2013-04-26  7:53 ` Paul Eggert
2013-04-26 15:05   ` Doug Lewan
2013-04-26 19:35     ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517AD6EB.4030708@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=14258-done@debbugs.gnu.org \
    --cc=dougl@shubertticketing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).