This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
trouble with fixincl in gcc 3.3 as cross-compiler
- From: "Bob Frazier" <bobf at mrp3 dot com>
- To: <gcc at gnu dot org>
- Date: Wed, 11 Aug 2004 22:15:17 -0700
- Subject: trouble with fixincl in gcc 3.3 as cross-compiler
I have been having a lot of trouble trying to get fixincl to work properly
when trying to build a cross-compiler on Interix 3.5 (Windows XP Pro).
'fixincl' would fail in the version check, complaining about a shell syntax
error involving 'null'.
After some careful troubleshooting, I narrowed the cause of the problem to
the 'server_setup()' function in server.c . This function makes a call to
'getcwd' as follows:
p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1);
after this call, 'p_cur_dir' is still NULL. This causes a cascading error
which surfaces itself as a syntax error in the 'cd' shell command generated
by 'run_shell()'.
I was able to prevent the error by changing this line of code as follows:
p_cur_dir = getcwd ((char *)xmalloc(MAXPATHLEN + 1), MAXPATHLEN + 1);
the call to 'xmalloc' provides a usable buffer which is then returned by
'p_cur_dir'. If the problem lies in the 'getcwd' function itself, then this
is a workaround to get past this stage of the build process.