public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/47739] New: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile
@ 2011-02-14 21:52 richard_sharman at mitel dot com
2011-06-08 12:50 ` [Bug target/47739] " jan.smets@alcatel-lucent.com
2013-11-10 5:38 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: richard_sharman at mitel dot com @ 2011-02-14 21:52 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/47739] gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile
2011-02-14 21:52 [Bug target/47739] New: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile richard_sharman at mitel dot com
@ 2011-06-08 12:50 ` jan.smets@alcatel-lucent.com
2013-11-10 5:38 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jan.smets@alcatel-lucent.com @ 2011-06-08 12:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47739
Jan Smets <jan.smets@alcatel-lucent.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.smets@alcatel-lucent.co
| |m
--- Comment #1 from Jan Smets <jan.smets@alcatel-lucent.com> 2011-06-08 12:49:26 UTC ---
I have this issue as well.
My source (4.6) has #ifdef TARGET_POSIX_IO in libgcov.c to pick the correct
mkdir (when TARGET_POSIX_IO is undefined). My target is i686-wrs-vxworks (and
--with-headers=..) and TARGET_POSIX_IO is defined somehow.
I tried disabling gcov with --disable-coverage or --enable-coverage=no , but it
did not prevent the compile problems.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/47739] gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile
2011-02-14 21:52 [Bug target/47739] New: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile richard_sharman at mitel dot com
2011-06-08 12:50 ` [Bug target/47739] " jan.smets@alcatel-lucent.com
@ 2013-11-10 5:38 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-11-10 5:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47739
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |build
Target| |*-vxworks
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/* Both kernels and RTPs have the facilities required by this macro. */
#define TARGET_POSIX_IO
That is the comment from vxworks.h. I bet this is due to vxworks support not
being maintained at all.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-10 5:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 21:52 [Bug target/47739] New: gcc 4.4.5 with target powerpc-wrs-vxworks fails to compile richard_sharman at mitel dot com
2011-06-08 12:50 ` [Bug target/47739] " jan.smets@alcatel-lucent.com
2013-11-10 5:38 ` pinskia at gcc dot gnu.org
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).