This is the mail archive of the gcc-help@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]

Re: Mac OS X cross-compiler not finding system include files?


MarÃy Ãkos wrote:
> Kai,
> 
>> If '/opt/i686-apple-darwin9' is the configured $prefix, then the
>> installed 'cc1plus' should be in :
>>
>>   /opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1
>>
>> and you could simply try the :
>>
>>   ./cc1plus -v
>>
>> there. This should show the built-in search paths for the C++ and C
>> headers...
> 
> thanks for the tip. it seems that cc1plus looks at some bogus directories:
> 
> $ /opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1/cc1plus -v
> ignoring nonexistent directory
> "/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1"
> 
> ignoring nonexistent directory
> "/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1/i686-apple-darwin9"
> 
> ignoring nonexistent directory
> "/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1/backward"
> 
> ignoring nonexistent directory "/opt/i686-apple-darwin9/usr/local/include"
> ignoring nonexistent directory
> "/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/include"
> 
> ignoring nonexistent directory
> "/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/include"
> 
> ignoring duplicate directory "/opt/i686-apple-darwin9/Library/Frameworks"
> #include "..." search starts here:
> #include <...> search starts here:
>  /opt/i686-apple-darwin9/usr/include
>  /opt/i686-apple-darwin9/System/Library/Frameworks (framework directory)
> End of search list.
> 
> 
> (and, actually the program doesn't exit after this)
> 
> 
> it seems there's an extra $prefix in front of the search paths. I
> configured gcc compilation using the following command:
> 
> $ TARGET=i686-apple-darwin9
> $ CFLAGS="-m32" LDFLAGS="-m32" ../gcc-5493/configure
> --prefix=/opt/$TARGET --disable-checking
> --enable-languages=c,objc,c++,obj-c++
> --with-as=/opt/$TARGET/bin/${TARGET}-as
> --with-ld=/opt/$TARGET/bin/${TARGET}-ld --target=$TARGET
> --with-sysroot=/opt/$TARGET  --enable-static --enable-shared
> --disable-nls --disable-multilib
> 
> 
> did I do something wrong?

With this, your prefix is going to the same as your sysroot.  I can't imagine
that this is what you really want.  The prefix is supposed to be where your cross-
toolchain gets installed, the sysroot, is where you put the target headers and
libraries.

Andrew.


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