public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Tobler <andreast-list@fgznet.ch>
To: sellcey@imgtec.com, Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch] fix bootstrap on FreeBSD i386/arm
Date: Sat, 30 May 2015 11:44:00 -0000	[thread overview]
Message-ID: <5569828A.9080304@fgznet.ch> (raw)
In-Reply-To: <1432919888.20199.42.camel@ubuntu-sellcey>

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

Hi Steve,

On 29.05.15 19:18, Steve Ellcey wrote:
> On Thu, 2015-05-28 at 23:54 +0200, Eric Botcazou wrote:
>>> This patch restores bootstrap on i386-*-freebsd*.
>>> The build was failing after the introduction of -std=c++98
>>> configure/build flag. The -std=c++98 enables strict_ansi and on FreeBSD
>>> the libc function atoll is not defined for this.
>>
>> Solaris (x86 and SPARC) is also broken in various ways: for example, the "sun"
>> preprocessor macro is no more defined.  Why do we need strict ANSI exactly?
>
> Andreas,
>
> This patch (or the earlier one) is also breaking a build of my MIPS
> cross compiler.  On CentOS 5.11 (yes I know that is old) I can build a
> cross compiler where the executables are x86_64 objects but not when
> they are i386 objects (i.e. when using -m32 to build GCC).  The error
> is duplicate atoll definitions (one in read-rtl.c and one in stdlib.h).
>
> I may be mistaken but think when you moved the atoll check from
> AC_CHECK_FUNCS to gcc_AC_CHECK_DECLS you needed to change config.in and
> read-rtl.c because gcc_AC_CHECK_DECLS sets HAVE_DECL_ATOLL instead of
> HAVE_ATOLL.

I'm sorry. I totally forgot about autoheader...

I'm testing this one now. Would you mind giving it a try?

Thanks,
Andreas


[-- Attachment #2: fbsd_atoll_2.diff --]
[-- Type: text/plain, Size: 1955 bytes --]

Index: config.in
===================================================================
--- config.in	(revision 223885)
+++ config.in	(working copy)
@@ -624,12 +624,6 @@
 #endif
 
 
-/* Define to 1 if you have the `atoll' function. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_ATOLL
-#endif
-
-
 /* Define to 1 if you have the `atoq' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_ATOQ
@@ -686,9 +680,16 @@
 #endif
 
 
-/* Define to 1 if we found a declaration for 'basename', otherwise define to
-   0. */
+/* Define to 1 if we found a declaration for 'atoll', otherwise define to 0.
+   */
 #ifndef USED_FOR_TARGET
+#undef HAVE_DECL_ATOLL
+#endif
+
+
+/* Define to 1 if you have the declaration of `basename(const char*)', and to
+   0 if you don't. */
+#ifndef USED_FOR_TARGET
 #undef HAVE_DECL_BASENAME
 #endif
 
@@ -963,8 +964,8 @@
 #endif
 
 
-/* Define to 1 if we found a declaration for 'strstr', otherwise define to 0.
-   */
+/* Define to 1 if you have the declaration of `strstr(const char*,const
+   char*)', and to 0 if you don't. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_DECL_STRSTR
 #endif
Index: read-rtl.c
===================================================================
--- read-rtl.c	(revision 223885)
+++ read-rtl.c	(working copy)
@@ -704,7 +704,7 @@
 \f
 /* Provide a version of a function to read a long long if the system does
    not provide one.  */
-#if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_LONG && !defined(HAVE_ATOLL) && !defined(HAVE_ATOQ)
+#if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_LONG && !HAVE_DECL_ATOLL && !defined(HAVE_ATOQ)
 HOST_WIDE_INT atoll (const char *);
 
 HOST_WIDE_INT
@@ -1328,7 +1328,7 @@
 #else
 	/* Prefer atoll over atoq, since the former is in the ISO C99 standard.
 	   But prefer not to use our hand-rolled function above either.  */
-#if defined(HAVE_ATOLL) || !defined(HAVE_ATOQ)
+#if HAVE_DECL_ATOLL || !defined(HAVE_ATOQ)
 	tmp_wide = atoll (name.string);
 #else
 	tmp_wide = atoq (name.string);

  reply	other threads:[~2015-05-30  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 18:47 Andreas Tobler
2015-05-28 20:45 ` Jason Merrill
2015-05-28 23:02 ` Eric Botcazou
2015-05-29 10:17   ` Rainer Orth
2015-05-29 10:26     ` Eric Botcazou
2015-05-29 10:39       ` Rainer Orth
2015-05-29 17:28   ` Steve Ellcey
2015-05-30 11:44     ` Andreas Tobler [this message]
2015-05-31 21:33       ` Andreas Tobler
2015-05-31 21:36         ` Jason Merrill
2015-06-01 14:45       ` Steve Ellcey
2015-06-01 15:08         ` Andreas Tobler
2015-06-01 15:20           ` Steve Ellcey
2015-05-31 20:38   ` Andreas Tobler
2015-05-31 22:43     ` Eric Botcazou

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

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

  git send-email \
    --in-reply-to=5569828A.9080304@fgznet.ch \
    --to=andreast-list@fgznet.ch \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sellcey@imgtec.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.
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).