This is the mail archive of the
mailing list for the GCC project.
[PATCH] Tweak HAVE_DECL_LDGETNAME configure test for AIX
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Nov 2004 07:32:08 -0700 (MST)
- Subject: [PATCH] Tweak HAVE_DECL_LDGETNAME configure test for AIX
The following patch is a minor tweak to the gcc subdirectory's
configure test for HAVE_DECL_LDGETNAME. Unfortunately on AIX,
the <ldfcn.h> system header conflicts with <fcntl.h> as both
define the macros FREAD and FWRITE. This then leads to a spurious
failure of the configure test, which in turn leads to compile-time
warnings (or bootstrap errors) building collect2.c.
The following patch has been tested on powerpc-ibm-aix184.108.40.206 with
a top-level "make".
Ok for mainline? Are such hacks ever obvious?
2004-11-24 Roger Sayle <firstname.lastname@example.org>
* configure.ac: Tweak test for HAVE_DECL_LDGETNAME to avoid a
system header conflict on AIX 5.2.
* configure: Regenerate.
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.84
diff -c -3 -p -r2.84 configure.ac
*** configure.ac 22 Nov 2004 22:26:06 -0000 2.84
--- configure.ac 24 Nov 2004 15:32:59 -0000
*** 1053,1062 ****
--- 1053,1068 ----
],[rlim_t l = 0;],,[AC_DEFINE([rlim_t],[long],
[Define to \`long' if <sys/resource.h> doesn't define.])])
+ # On AIX 5.2, <ldfcn.h> conflicts with <fcntl.h>, as both define incompatible
+ # FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname
+ # in collect2.c, <fcntl.h> isn't visible, but the configure test below needs
+ # to undef these macros to get the correct value for HAVE_DECL_LDGETNAME.
gcc_AC_CHECK_DECLS(ldgetname, , ,[
+ #undef FREAD
+ #undef FWRITE
Roger Sayle, E-mail: email@example.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833