public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bjoern dot m dot haase at web dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/25035] [4.1/4.2 regression] libssp causes a failure with cross compilers
Date: Mon, 15 May 2006 17:25:00 -0000	[thread overview]
Message-ID: <20060515172539.30520.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25035-283@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]



------- Comment #7 from bjoern dot m dot haase at web dot de  2006-05-15 17:25 -------
Subject: Re:  [4.1/4.2 regression] libssp causes a failure with cross compilers

mmitchel at gcc dot gnu dot org wrote on Montag, 15. Mai 2006 00:26 :
> ------- Comment #6 from mmitchel at gcc dot gnu dot org  2006-05-14 22:26
> ------- Where is the patch referenced in Comment #3?

Here it is. It seems that Bugzilla does not permit me to add more comments.

Bjoern.


PATCH: libssp, fix AVR bootstrap failure for gcc

From: 
Björn Haase <bjoern.m.haase@web.de>
To: 
gcc-patches@gcc.gnu.org
Date: 
30.12.2005 04:01


The code in 

/libssp/ssp.c

implicitly assumes that the define symbols O_RDONLY and O_WRONLY exist. For 
the AVR target those are not defined in the header files included by ssp.c. 
Also the code does not work as expected for embedded targets that do not have 
"files" with the usual meaning.

All of this causes a bootstrap failure for the AVR target.

The patch adds #ifdefs as guards that first check for existing definitions of 
O_RDONLY and O_WRONLY before actually using them.

After applying this change, bootstrap again succeeds.

Bjoern.


2005-12-30  Bjoern Haase  <bjoern.m.haase@web.de>

        * ssp.c: add "#ifdef" protections for symbols O_RDONLY and O_WRONLY


Index: ssp.c
===================================================================
--- ssp.c       (revision 109170)
+++ ssp.c       (working copy)
@@ -67,6 +67,8 @@
   if (__stack_chk_guard != 0)
     return;
 
+#ifdef O_RDONLY
+
   fd = open ("/dev/urandom", O_RDONLY);
   if (fd != -1)
     {
@@ -77,6 +79,8 @@
         return;
     }
 
+#endif
+
   /* If a random generator can't be used, the protector switches the guard
      to the "terminator canary".  */
   p = (unsigned char *) &__stack_chk_guard;
@@ -97,6 +101,8 @@
 
   /* Print error message directly to the tty.  This avoids Bad Things
      happening if stderr is redirected.  */
+
+#ifdef O_WRONLY
   fd = open (_PATH_TTY, O_WRONLY);
   if (fd != -1)
     {
@@ -124,6 +130,7 @@
         }
       close (fd);
     }
+#endif
 
 #ifdef HAVE_SYSLOG_H
   /* Only send the error to syslog if there was no tty available.  */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25035


  parent reply	other threads:[~2006-05-15 17:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-25 18:22 [Bug target/25035] New: Building an avr cross compiler fails berndtrog at yahoo dot com
2005-11-25 20:28 ` [Bug other/25035] " pinskia at gcc dot gnu dot org
2005-12-05 19:06 ` [Bug other/25035] [4.1/4.2 regression] Building an avr cross compiler fails (libssp) berndtrog at yahoo dot com
2006-01-03 15:33 ` bjoern dot m dot haase at web dot de
2006-01-19 16:22 ` eweddington at cso dot atmel dot com
2006-05-07  8:51 ` [Bug other/25035] [4.1/4.2 regression] libssp causes a failure with cross compilers pinskia at gcc dot gnu dot org
2006-05-14 22:26 ` mmitchel at gcc dot gnu dot org
2006-05-15 17:25 ` bjoern dot m dot haase at web dot de [this message]
2006-05-25  2:39 ` mmitchel at gcc dot gnu dot org
2006-06-23 12:28 ` info at yourkit dot com
2006-06-28 21:18 ` pinskia at gcc dot gnu dot org
2006-07-24  5:51 ` echristo at apple dot com
2006-07-24  5:54 ` pinskia at gcc dot gnu dot org
2006-08-05  3:36 ` dje at gcc dot gnu dot org
2006-08-18  4:19 ` pinskia at gcc dot gnu dot org
2006-08-29 15:30 ` amylaar at gcc dot gnu dot org
2006-08-30  3:32 ` [Bug other/25035] [4.1/4.2 regression] libssp causes a failure with cross compilers with unified trees pinskia at gcc dot gnu dot org
2006-08-30 21:13 ` eweddington at cso dot atmel dot com
2006-09-29 21:19 ` jsm28 at gcc dot gnu dot org
2006-09-29 21:27 ` jsm28 at gcc dot gnu dot org
2006-09-30  8:27 ` pinskia at gcc dot gnu dot org
2008-02-12 18:27 ` Rudolf dot Leitgeb at gmx dot at
2008-02-12 19:39 ` eric dot weddington at atmel dot com
2008-02-12 19:44 ` eric dot weddington at atmel dot com
2008-02-12 23:27 ` eric dot weddington at atmel dot com
2008-02-13  8:46 ` Rudolf dot Leitgeb at gmx dot at
2008-03-30 20:09 ` pinskia at gcc dot gnu dot org
2008-05-26 22:48 ` eric dot weddington at atmel dot com

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=20060515172539.30520.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).