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

[Bug target/12351] New: Builiding cross gcc-3.3.1 for sparc-sun-solaris2.7 on cygwin fails


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12351

           Summary: Builiding cross gcc-3.3.1 for sparc-sun-solaris2.7 on
                    cygwin fails
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikeu1969 at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: sparc-sun-solaris2.7

This might be related to #11967, #11890.
It stops compiling in the same file gmon-sol2.c, with the following output:

/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc/xgcc 
	-B/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc/ 
	-B/usr/local/sparc-sun-solaris2.7/bin/ 
	-B/usr/local/sparc-sun-solaris2.7/lib/ 
	-isystem /usr/local/sparc-sun-solaris2.7/include 
	-DIN_GCC -DCROSS_COMPILE   
	-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
	-isystem ./include  
	-I. 
	-I. 
	-I/usr/src/gcc-3.3.1-1/gcc 
	-I/usr/src/gcc-3.3.1-1/gcc/. 
	-I/usr/src/gcc-3.3.1-1/gcc/config 
	-I/usr/src/gcc-3.3.1-1/gcc/../include  \
    -c /usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c -o gmon.o

/usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c: In function `_mcleanup':
/usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c:181: error: `PATH_MAX' undecla
red (first use in this function)
/usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c:181: error: (Each undeclared i
dentifier is reported only once
/usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c:181: error: for each function
it appears in.)
/usr/src/gcc-3.3.1-1/gcc/config/sparc/gmon-sol2.c:181: warning: unused variable
`buf'
make[1]: *** [gmon.o] Error 1
make[1]: Leaving directory `/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc'

make: *** [all-gcc] Error 2

-------------------------------------------------------------------------------
Additional details:
I have a clean installation of cygwin, and the binutils and gcc packages are 
from within the cygwin setup.

I have created the folder /usr/local/sparc-sun-solaris2.7/ and copied the 
include and lib directories from a Sun server.

The build directories are 
/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/
/usr/src_build/sparc-sun-solaris2.7/binutils-20030901-1/

and the source directories are 
/usr/src/sparc-sun-solaris2.7/gcc-3.3.1-1/
/usr/src/sparc-sun-solaris2.7/binutils-20030901-1/

I haven't specified a prefix directory since my /usr/local was all clean. So 
the config flags were as following:

[configure binutils]
cd /usr/src_build/sparc-sun-solaris2.7/binutils-20030901-1
/usr/src/binutils-20030901-1/configure 
	--target=sparc-sun-solaris2.7 
	-v 
	--disable-multilib 
	--enable-threads=solaris

[configure gcc]
cd /usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1
/usr/src/gcc-3.3.1-1/configure 
	--target=sparc-sun-solaris2.7 
	-v 
	--disable-multilib 
	--enable-threads=solaris 
	--with-gnu-ld 
	--with-gnu-as 
	--enable-languages=c,c++

-------------------------------------------------------------------------------
Further digging:
It looks to me that xgcc doesn't get the right compiler or the right include 
directory.

The initial error is undefined symbol PATH_MAX, which is defined in <limits.h> 
for Sun, but not defined in cygwin.

I tried to see which flags affect the include stuff. I created a file 
testincl.cpp in cd /usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc
with this content,

#include <limits.h>

#ifndef PATH_MAX
#error aaaaaaaaaaaaaaaaaaaaaaaaa
#endif

and compiled with the same flags.

/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc/xgcc \
	-B/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc/ \
	-B/usr/local/sparc-sun-solaris2.7/bin/ \
	-B/usr/local/sparc-sun-solaris2.7/lib/ \
	-isystem /usr/local/sparc-sun-solaris2.7/include \
	-DIN_GCC -DCROSS_COMPILE \
	-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
	-isystem ./include \
	-I. \
	-I. \
	-I/usr/src/gcc-3.3.1-1/gcc \
	-I/usr/src/gcc-3.3.1-1/gcc/. \
	-I/usr/src/gcc-3.3.1-1/gcc/config \
	-I/usr/src/gcc-3.3.1-1/gcc/../include \
	-c testincl.cpp -o testincl.o

It does give the error because it takes the <limits.h> from /usr/include 
instead of /usr/local/sparc-sun-solaris2.7/include specified with the -isystem 
flag.

Now if I remove the first flag, 
-B/usr/src_build/sparc-sun-solaris2.7/gcc-3.3.1-1/gcc/
it will compile, and it correctly takes <limits.h> from Sun.

Somehow a compiler called by xgcc in the local directory doesn't use the 
specified include settings for target (here I'm not familiar with wath xgcc 
calls or if its a compiler on its own).

-------------------------------------------------------------------------------
Can someone enlighten me on how to locally solve this in a clean manner? I can 
define a PATH_MAX thing, but still, I don't want to compile Sun libs with 
cygwin headers.

Thanks,
Mike


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