0 Replies Latest reply: May 17, 2012 9:23 PM by 938146 RSS

    configure errors on AIX using GCC

    938146
      While attempting to run env CC=gcc ../dist/configure I get the following error

      configure:5309: checking whether the C compiler works
      configure:5331: gcc -O2 -qalias=noansi -D_THREAD_SAFE -Wl,-brtl conftest.c >&5
      gcc: error: unrecognized command line option '-qalias=noansi'
      configure:5335: $? = 1
      configure:5373: result: no
      configure: failed program was:
      | /* confdefs.h */
      | #define PACKAGE_NAME "Berkeley DB"
      | #define PACKAGE_TARNAME "db-5.3.15"
      | #define PACKAGE_VERSION "5.3.15"
      | #define PACKAGE_STRING "Berkeley DB 5.3.15"
      | #define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
      | #define PACKAGE_URL ""
      | #define HAVE_ATOMICFILEREAD 1
      | #define HAVE_UPGRADE_SUPPORT 1
      | /* end confdefs.h. */
      |
      | int
      | main ()
      | {
      |
      | ;
      | return 0;
      | }
      configure:5378: error: in `/stage/source/bdb/db-5.3.15/build_unix':
      configure:5380: error: C compiler cannot create executables
      See `config.log' for more details


      I created the following patch which seems to make it work.

      --- dist/configure.orig 2012-05-17 20:28:06 -0500
      +++ dist/configure 2012-05-17 20:29:45 -0500
      @@ -5103,7 +5103,15 @@
      # when ordinary optimization is enabled because they make strong
      # assumptions about the types held at each memory location, and some
      # Berkeley DB code violates those assumptions. [#16141]
      - extra_cflags=" -qalias=noansi"
      +
      + # ADDED beacuse -qalias=noansi is an invalid option for gcc
      + case "$CC" in
      + gcc)
      + extra_cflags="";;
      + *)
      + extra_cflags=" -qalias=noansi";;
      + esac
      +
      optimize_flag="-O2"
      CC=${CC-"xlc_r"}
      CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"


      Let me know if anyone thinks this will cause an issue or if it submitted as a bug. It appears to have been introduced sometime after 4.8.30 which was the last version I know of that compiled cleanly without this change. The -qalias=noansi seems to be a specific option if using the IBM C compiler.

      Thanks,

      Josh