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: unassig...@gcc.gnu.org ReportedBy: richard_shar...@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