This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

readdir_r-problem on Solaris 2.5.1


Hi!
I tried building libjava (gcc-3.2 release) on a Solaris 2.5.1 box.
Here is the error:
/data/titan_3/kahlert/Ultra/OBJ/gcc/xgcc -shared-libgcc -B/data/titan_3/kahlert/Ultra/OBJ/gcc/ -nostdinc++ -L/data/titan_3/kahlert/Ultra/OBJ/sparc-sun-solaris2.5.1/libstdc++-v3/src -L/data/titan_3/kahlert/Ultra/OBJ/sparc-sun-solaris2.5.1/libstdc++-v3/src/.libs -B/home/software/GCC3.2/ULTRA/sparc-sun-solaris2.5.1/bin/ -B/home/software/GCC3.2/ULTRA/sparc-sun-solaris2.5.1/lib/ -isystem /home/software/GCC3.2/ULTRA/sparc-sun-solaris2.5.1/include -DHAVE_CONFIG_H -I. -I../../../gcc-3.2/libjava -I./include -I./gcj -I../../../gcc-3.2/libjava -Iinclude -I../../../gcc-3.2/libjava/include -I../../../gcc-3.2/libjava/../boehm-gc/include -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -I../../../gcc-3.2/libjava/libltdl -I../../../gcc-3.2/libjava/libltdl -I../../../gcc-3.2/libjava/.././libjava/../gcc -I../../../gcc-3.2/libjava/../zlib -I../../../gcc-3.2/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -I/server/local/X11R5Sol2/include -W -Wall -D_GNU_SOURCE -DPREFIX=\"/home/software/GCC3.2\" -g -O2 -MD -MT java/io/natFile.lo -MF java/io/natFile.pp -c java/io/natFile.cc  -fPIC -DPIC -o java/io/natFile.o
/usr/include/dirent.h: In member function `JArray<java::lang::Object*>*
   java::io::File::performList(java::io::FilenameFilter*,
   java::io::FileFilter*, java::lang::Class*)':
/usr/include/dirent.h:109: too many arguments to function `dirent*
   readdir_r(DIR*, dirent*)'
java/io/natFile.cc:151: at this point in file
gmake[3]: *** [java/io/natFile.lo] Error 1
gmake[3]: Leaving directory `/data/titan_3/kahlert/Ultra/OBJ/sparc-sun-solaris2.5.1/libjava'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/data/titan_3/kahlert/Ultra/OBJ/sparc-sun-solaris2.5.1/libjava'
gmake[1]: *** [all-target-libjava] Error 2
gmake[1]: Leaving directory `/data/titan_3/kahlert/Ultra/OBJ'
gmake: *** [bootstrap] Error 2

Around line 109 /usr/include/dirent.h reads
107: #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
108:
109: extern struct dirent *readdir_r(DIR *__dp, struct dirent *__ent);
110:
110: #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */

Could the problem be that _POSIX_C_SOURCE is undefined?

I used this test:

#include <dirent.h>

TEST: _POSIX_C_SOURCE

On the machine gcc -v prints
Reading specs from /sw/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/specs
gcc version 2.95.3 20010315 (release)

and gcc -E spits out
.... a lot of lines deleted
# 1 "h.c" 2


TEST: _POSIX_C_SOURCE
and gcc -E | grep readdir gives
extern struct dirent    *readdir(DIR *);
(strange: no readdir_r at all)

I configured using
CONFIG_SHELL=/usr/bin/ksh
export CONFIG_SHELL
../gcc-3.2/configure --prefix=${prefix} --exec-prefix=${prefix}/SOLARIS \
           --enable-languages=c++,f77,java \
           --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld \
           --disable-threads --disable-shared

Any idea?

Thanks in advance
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


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