From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17289 invoked by alias); 13 Apr 2006 08:00:45 -0000 Received: (qmail 17278 invoked by uid 22791); 13 Apr 2006 08:00:43 -0000 X-Spam-Check-By: sourceware.org Received: from ex.2n.cz (HELO ex.2n.cz) (213.29.92.11) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Apr 2006 08:00:40 +0000 Received: from orphique ([192.168.2.154]) by ex.2n.cz with Microsoft SMTPSVC(5.0.2195.6713); Thu, 13 Apr 2006 10:00:36 +0200 Received: from ladis by orphique with local (Exim 3.36 #1 (Debian)) id 1FTwl9-0004h8-00; Thu, 13 Apr 2006 10:00:59 +0200 Date: Thu, 13 Apr 2006 19:48:00 -0000 From: Ladislav Michl To: Randolph Chung Cc: binutils@sources.redhat.com Subject: Re: Building for i586-pc-interix3 host Message-ID: <20060413080059.GA28697@orphique> References: <20060412151228.GA17847@orphique> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00180.txt.bz2 On Thu, Apr 13, 2006 at 01:17:26PM +0800, Randolph Chung wrote: > > I just built current CVS on i586-pc-interix3 host for ARM linux target. > > There are few problems I do not know how to fix correctly. > > _ALL_SOURCE has to be defined for prototypes of strcasecmp etc, > > and some gas source files are including at first place > > directly, so defining _ALL_SOURCE in config.h won't help in this case. > > > > How should this be fixed? Adding _ALL_SOURCE to config/mh-interix? > > > > $ uname -a > > Interix Nsfordev-XP 3.5 SP-8.0.1969.1 x86 Intel_x86_Family15_Model3_Stepping4 > > Please take a look at the list archives, I recently had to fix this for > hpux. > > http://sources.redhat.com/ml/gdb-patches/2006-03/msg00295.html Thanks for info, but this patch fixes only gdb. Does it mean that you can build gas without problems on hpux? Seems unlikely, I cannot find _XOPEN_SOURCE_EXTENDED definitions here... Anyway, to make _ALL_SOURCE definition in config.h work no C file should include system headers directly (before generated config.h). Following patch does so. Is it okay? 2006-04-13 Ladislav Michl * gas/atof-generic.c: Do not include system headers directly, let as.h handle it. * gas/expr.c: Likewise. * gas/input-file.c: Likewise. * gas/config/tc-arm.c: Likewise. * gas/input-file.c: Likewise. * gas/macro.c: Likewise. * gas/sb.c: Likewise. * gas/config/tc-arm.c: Likewise. * gas/config/tc-i860.c: Likewise. * gas/config/tc-mcore.c: Likewise. * gas/config/tc-msp430.c: Likewise. * gas/config/tc-xtensa.c: Likewise. Index: gas/atof-generic.c =================================================================== RCS file: /cvs/src/src/gas/atof-generic.c,v retrieving revision 1.11 diff -u -r1.11 atof-generic.c --- gas/atof-generic.c 5 May 2005 09:12:43 -0000 1.11 +++ gas/atof-generic.c 13 Apr 2006 07:37:52 -0000 @@ -19,8 +19,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" #include "safe-ctype.h" Index: gas/expr.c =================================================================== RCS file: /cvs/src/src/gas/expr.c,v retrieving revision 1.65 diff -u -r1.65 expr.c --- gas/expr.c 4 Apr 2006 08:04:57 -0000 1.65 +++ gas/expr.c 13 Apr 2006 07:37:53 -0000 @@ -25,7 +25,6 @@ (It also gives smaller files to re-compile.) Here, "operand"s are of expressions, not instructions. */ -#include #define min(a, b) ((a) < (b) ? (a) : (b)) #include "as.h" Index: gas/input-file.c =================================================================== RCS file: /cvs/src/src/gas/input-file.c,v retrieving revision 1.20 diff -u -r1.20 input-file.c --- gas/input-file.c 11 Aug 2005 01:25:20 -0000 1.20 +++ gas/input-file.c 13 Apr 2006 07:37:53 -0000 @@ -25,9 +25,6 @@ What we lose in "efficiency" we gain in modularity. Note we don't need to #include the "as.h" file. No common coupling! */ -#include -#include -#include #include "as.h" #include "input-file.h" #include "safe-ctype.h" Index: gas/macro.c =================================================================== RCS file: /cvs/src/src/gas/macro.c,v retrieving revision 1.42 diff -u -r1.42 macro.c --- gas/macro.c 28 Feb 2006 07:57:09 -0000 1.42 +++ gas/macro.c 13 Apr 2006 07:37:53 -0000 @@ -22,38 +22,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" - -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX -/* Indented so that pre-ansi C compilers will ignore it, rather than - choke on it. Some versions of AIX require this to be the first - thing in the file. */ - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# if !defined (__STDC__) && !defined (__hpux) -extern char *alloca (); -# else -extern void *alloca (); -# endif /* __STDC__, __hpux */ -# endif /* alloca */ -# endif /* _AIX */ -# endif /* HAVE_ALLOCA_H */ -#endif /* __GNUC__ */ - -#include -#ifdef HAVE_STRING_H -#include -#else -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif #include "as.h" #include "libiberty.h" #include "safe-ctype.h" Index: gas/sb.c =================================================================== RCS file: /cvs/src/src/gas/sb.c,v retrieving revision 1.12 diff -u -r1.12 sb.c --- gas/sb.c 18 May 2005 05:40:07 -0000 1.12 +++ gas/sb.c 13 Apr 2006 07:37:53 -0000 @@ -21,19 +21,9 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" -#include -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif +#include "as.h" #include "libiberty.h" #include "sb.h" -#include "as.h" /* These routines are about manipulating strings. Index: gas/config/tc-arm.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-arm.c,v retrieving revision 1.256 diff -u -r1.256 tc-arm.c --- gas/config/tc-arm.c 7 Apr 2006 15:11:19 -0000 1.256 +++ gas/config/tc-arm.c 13 Apr 2006 07:37:56 -0000 @@ -25,7 +25,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #define NO_RELOC 0 #include "as.h" #include "safe-ctype.h" Index: gas/config/tc-i860.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-i860.c,v retrieving revision 1.29 diff -u -r1.29 tc-i860.c --- gas/config/tc-i860.c 7 Jun 2005 17:54:16 -0000 1.29 +++ gas/config/tc-i860.c 13 Apr 2006 07:37:56 -0000 @@ -21,8 +21,6 @@ with GAS; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" Index: gas/config/tc-mcore.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-mcore.c,v retrieving revision 1.40 diff -u -r1.40 tc-mcore.c --- gas/config/tc-mcore.c 11 Aug 2005 01:25:27 -0000 1.40 +++ gas/config/tc-mcore.c 13 Apr 2006 07:37:56 -0000 @@ -19,14 +19,12 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "bfd.h" #include "subsegs.h" #define DEFINE_TABLE #include "../opcodes/mcore-opc.h" #include "safe-ctype.h" -#include #ifdef OBJ_ELF #include "elf/mcore.h" Index: gas/config/tc-msp430.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-msp430.c,v retrieving revision 1.22 diff -u -r1.22 tc-msp430.c --- gas/config/tc-msp430.c 9 Sep 2005 08:46:19 -0000 1.22 +++ gas/config/tc-msp430.c 13 Apr 2006 07:37:56 -0000 @@ -20,9 +20,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#include #include #define PUSH_1X_WORKAROUND Index: gas/config/tc-xtensa.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v retrieving revision 1.62 diff -u -r1.62 tc-xtensa.c --- gas/config/tc-xtensa.c 10 Apr 2006 19:00:31 -0000 1.62 +++ gas/config/tc-xtensa.c 13 Apr 2006 07:37:58 -0000 @@ -18,7 +18,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include #include "as.h" #include "sb.h"