This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]