From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21907 invoked by alias); 6 Dec 2011 14:07:29 -0000 Received: (qmail 21894 invoked by uid 22791); 6 Dec 2011 14:07:28 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from smtp153.iad.emailsrvr.com (HELO smtp153.iad.emailsrvr.com) (207.97.245.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Dec 2011 14:07:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp25.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 5568B3004AE for ; Tue, 6 Dec 2011 09:07:13 -0500 (EST) Received: by smtp25.relay.iad1a.emailsrvr.com (Authenticated sender: alfred-AT-von-campe.com) with ESMTPSA id 1F0C43004A0 for ; Tue, 6 Dec 2011 09:07:13 -0500 (EST) From: Alfred von Campe Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Strange gcc #include behavior when compiling multiple source files at once Date: Tue, 06 Dec 2011 14:07:00 -0000 Message-Id: <60FF0E09-345D-4F3D-956A-25A851ED7D7F@von-campe.com> To: gcc-help@gcc.gnu.org Mime-Version: 1.0 (Apple Message framework v1084) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg00039.txt.bz2 I have a shell script which is run as root (with sudo) that contains the fo= llowing line (split here for readability): $STTOOLPATH/sh4-linux-gcc -O2 $EXTRA_PREPROCESSOR_DEFINE $RELEASE_DEFIN= E \ -I../../../../Components/Messaging -I../AvRouting/AVRD/Main -I../IPC/co= mmon_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 drive= r tries to compile the init_frame_buffer.c file, it complains that it cannot find a pa= rticular include file that was moved from LPMcode to share. Here is the strange par= t: 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 abov= e 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 wind= ow, 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 a= vail. 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 chi= p 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 PURP= OSE. And for completeness' sake, here is the actual command line from the echo c= ommand 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/co= mmon_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 dire= ctory ./init_frame_buffer.c: In function =91init_frame_buffer=92: