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

[Patch] sparc-sun-solaris2.8 (cross) missing PATH_MAX


When compiling a sparc-sun-solaris2.8 cross compiler (on
i686-pc-linux-gnu), I encountered the following:

/hosts/bubbles/spencer/devel/gcc340/gcc-3.4.0/sparc-sun-solaris2.8/build-gcc/gcc/xgcc
-B/hosts/bubbles/spencer/devel/gcc340/gcc-3.4.0/sparc-sun-solaris2.8/build-gcc/gcc/
-B/opt/gcc-3.4.0-cross/sparc-sun-solaris2.8/sparc-sun-solaris2.8/bin/
-B/opt/gcc-3.4.0-cross/sparc-sun-solaris2.8/sparc-sun-solaris2.8/lib/
-isystem
/opt/gcc-3.4.0-cross/sparc-sun-solaris2.8/sparc-sun-solaris2.8/include
-isystem
/opt/gcc-3.4.0-cross/sparc-sun-solaris2.8/sparc-sun-solaris2.8/sys-include
-DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -I. -I. -I../../../gcc-3.4.0/gcc
-I../../../gcc-3.4.0/gcc/. -I../../../gcc-3.4.0/gcc/../include   \
 -c ../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c -o gmon.o
../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c: In function
`_mcleanup':
../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:183: error: `PATH_MAX'
undeclared (first use in this function)
../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:183: error: (Each
undeclared identifier is reported only once
../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:183: error: for each
function it appears in.)
../../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:183: warning: unused
variable `buf'
make[1]: *** [gmon.o] Error 1
make[1]: Leaving directory
`/hosts/bubbles/spencer/devel/gcc340/gcc-3.4.0/sparc-sun-solaris2.8/build-gcc/gcc'

I vaguely remember seeing this before, and I may have forgotten to
work up a patch.  If you look in <limits.h> on sparc-sun-solaris2.8,
the (only) definition of PATH_MAX is wrapped with the following guard,
which is not active when compiling gmon-sol2.c.

#if defined(__EXTENSIONS__) || __STDC__ - 0 == 0 || \
        defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)

Rather than risk turning one of those on and affect the result of the
build somehow, I elected to put a "fallback definition" inside
gmon-sol2.c.  A patch is attached.
        
-- 
------------------------------------------------------------------
Brad Spencer - spencer@infointeractive.com - "It's quite nice..."
Systems Architect | InfoInterActive Corp. | A Canadian AOL Company

Attachment: gcc-3.4.0-sparc-PATH_MAX.patch
Description: Text document


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