I have a shell script which is run as root (with sudo) that contains the following line (split here for readability): $STTOOLPATH/sh4-linux-gcc -O2 $EXTRA_PREPROCESSOR_DEFINE $RELEASE_DEFINE \ -I../../../../Components/Messaging -I../AvRouting/AVRD/Main -I../IPC/common_files \ -I../OSAbstraction -I../IPC/LPMLib -I../../Drivers/LPM -I../../Drivers/AVRDriver \ -I../../Drivers/Diagnostics -I../../../LPM/share -I../../../LPM/LPMcode \ -I$KERNELSOURCES/include ../IPC/LPMLib/*.c ./xxxx_init.c ./init_frame_buffer.c \ ./init_v4l.c -o $FILESYSTEM_TARGET/sbin/xxxx_init || cleanup 1 Recently, we moved some header files from ../../../LPM/LPMcode to ../../../LPM/share, both of which are listed with -I in the compile line above. When the driver tries to compile the init_frame_buffer.c file, it complains that it cannot find a particular include file that was moved from LPMcode to share. Here is the strange part: when I add -save-temps to the above line, the resulting init_frame_buffer.i file clearly shows the contents of the missing include file. If I cut and past the above line in the script, pre-pend "echo" and remove the trailing "|| cleanup 1" so I can capture the command line, and then cut & paste that command line into my xterm window, it works just fine. If I copy the troublesome include file from share to LPMcode it also works. I've tried messing with the order of things on the gcc command line to no avail. How can I debug this further? Why is gcc getting confused? In case it matters, here is the compiler version, which I am stuck with since it's delivered by our chip vendor: sh4-linux-gcc (GCC) 4.2.4 (snapshot) (STMicroelectronics/Linux Base 4.2.4-54) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. And for completeness' sake, here is the actual command line from the echo command and (truncated) compiler output of the error: /opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-gcc -save-temps -O2 \ -I../../../../Components/Messaging -I../AvRouting/AVRD/Main -I../IPC/common_files \ -I../OSAbstraction -I../IPC/LPMLib -I../../Drivers/LPM -I../../Drivers/AVRDriver \ -I../../Drivers/Diagnostics -I../../../LPM/share -I../../../LPM/LPMcode \ -I/opt/STM/STLinux-2.3/devkit/sources/kernel/havana-linux-sh4/include ../IPC/LPMLib/*.c \ ./xxxx_init.c ./init_frame_buffer.c ./init_v4l.c -o /dev/shm/usb_update.10255/filesystem/sbin/xxxx_init ./init_frame_buffer.c:27:25: error: ipc_defines.h: No such file or directory ./init_frame_buffer.c: In function ‘init_frame_buffer’: