From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16857 invoked by alias); 14 Feb 2011 21:40:32 -0000 Received: (qmail 16841 invoked by uid 22791); 14 Feb 2011 21:40:31 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Feb 2011 21:40:26 +0000 From: "richard_sharman at mitel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/47739] New: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: richard_sharman at mitel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 14 Feb 2011 21:52:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg01736.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47739 Summary: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: minor Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: richard_sharman@mitel.com When building a cross compiler for powerpc-wrs-vxworks some files failed to compile. The config used was ../configure \ --target=powerpc-wrs-vxworks \ --disable-multilib --with-endian=big \ --enable-languages="c,c++" \ -with-headers=$WIND_BASE/target/h \ --disable-multilib \ --enable-threads=vxworks There were 3 problems: * the vxworks include files for `open' require 3 parameters. * there is no `access' functions in vxworks's unistd.h * the vxworks mkdir only accepts 1 parameter. I made the following changes to make the files compile. For the changes to open I didn't know what to #ifdef the code on so I just added an extra parameter of 0. The changes for acesss/mkdir were easier because F_OK is not defined in the vxworks header. Here is the context diff: === patch starts here *** ./libssp/ssp.c.orig Thu Apr 9 19:23:07 2009 --- ./libssp/ssp.c Wed Feb 9 11:14:08 2011 *************** *** 72,78 **** if (__stack_chk_guard != 0) return; ! fd = open ("/dev/urandom", O_RDONLY); if (fd != -1) { ssize_t size = read (fd, &__stack_chk_guard, --- 72,78 ---- if (__stack_chk_guard != 0) return; ! fd = open ("/dev/urandom", O_RDONLY, 0); if (fd != -1) { ssize_t size = read (fd, &__stack_chk_guard, *************** *** 102,108 **** /* Print error message directly to the tty. This avoids Bad Things happening if stderr is redirected. */ ! fd = open (_PATH_TTY, O_WRONLY); if (fd != -1) { static const char msg2[] = " terminated\n"; --- 102,108 ---- /* Print error message directly to the tty. This avoids Bad Things happening if stderr is redirected. */ ! fd = open (_PATH_TTY, O_WRONLY, 0); if (fd != -1) { static const char msg2[] = " terminated\n"; *** ./gcc/libgcov.c.orig Thu Apr 9 19:23:07 2009 --- ./gcc/libgcov.c Wed Feb 9 11:12:17 2011 *************** *** 104,111 **** *s = '\0'; /* Try to make directory if it doesn't already exist. */ ! if (access (filename, F_OK) == -1 && mkdir (filename, 0755) == -1 /* The directory might have been made by another process. */ && errno != EEXIST) { --- 104,116 ---- *s = '\0'; /* Try to make directory if it doesn't already exist. */ ! if ( ! #ifdef F_OK ! access (filename, F_OK) == -1 && mkdir (filename, 0755) == -1 + #else + mkdir (filename) + #endif /* The directory might have been made by another process. */ && errno != EEXIST) { *** ./gcc/gcov-io.c.orig Wed Jun 25 20:25:08 2008 --- ./gcc/gcov-io.c Wed Feb 9 11:11:06 2011 *************** *** 83,89 **** #endif #if GCOV_LOCKED if (mode > 0) ! fd = open (name, O_RDWR); else fd = open (name, O_RDWR | O_CREAT, 0666); if (fd < 0) --- 83,89 ---- #endif #if GCOV_LOCKED if (mode > 0) ! fd = open (name, O_RDWR, 0); else fd = open (name, O_RDWR | O_CREAT, 0666); if (fd < 0) === patch ends here Richard