gpc-20030507 and cross-cygwin
Hello, I am trying to build cross linux -> cygwin compiler with pascal language enabled. I am able to build complete gcc-3.3.1 with c,c++,objc,ada,f77,java and pascal-20030507 (the three patches to get gpc-20030507 working with gcc-3.3 applied) languages enabled. The cross compiler fails under rts : .... cd ../../gcc-3.3.1/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.3.1" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR="i686-pc-cygwin-ar" AR_FLAGS="rc" RANLIB="i686-pc-cygwin-ranlib" RANLIB_TEST="[ -f i686-pc-cygwin-ranlib ] || ( [ "i686-pc-linux-gnu" = "i686-pc-cygwin" ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )" RTSFLAGS="" DESTDIR="../.." generated-files make[2]: Entering directory `/home/dave/cygwin/gcc-3.3.1/gcc/p/rts' make[2]: Nothing to be done for `generated-files'. make[2]: Leaving directory `/home/dave/cygwin/gcc-3.3.1/gcc/p/rts' cd ../../gcc-3.3.1/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.3.1" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR="i686-pc-cygwin-ar" AR_FLAGS="rc" RANLIB="i686-pc-cygwin-ranlib" RANLIB_TEST="[ -f i686-pc-cygwin-ranlib ] || ( [ "i686-pc-linux-gnu" = "i686-pc-cygwin" ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )" RTSFLAGS="" DESTDIR="../.." generated-files make[2]: Entering directory `/home/dave/cygwin/gcc-3.3.1/gcc/p/rts' make[2]: Nothing to be done for `generated-files'. make[2]: Leaving directory `/home/dave/cygwin/gcc-3.3.1/gcc/p/rts' ../../gcc-3.3.1/gcc/p/script/mkdir-p p/rts src=`cd ../../gcc-3.3.1/gcc && pwd` && \ cd ./p/rts && \ CC="`echo /home/dave/cygwin/gcc-3.3.1-build/gcc/xgcc -B/home/dave/cygwin/gcc-3.3.1-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/include' ' | sed -e 's,\(-[BI]\)\([^/][^:]\),\1../../\2,g;s,^\([^/][^:]*/\),../../\1,'`" PC="`echo ./xgpc -B./' ' | sed -e 's,\(-[BI]\)\([^/][^:]\),\1../../\2,g;s,^\([^/][^:]*/\),../../\1,'`" CONFIG_SITE=nonexisting-file \ $src/p/rts/configure --silent > /dev/null --srcdir=$src/p/rts \ `if [ x@with_shared@ = xyes ]; then echo '--with-shared'; fi` cd ./p/rts && make CC="`echo /home/dave/cygwin/gcc-3.3.1-build/gcc/xgcc -B/home/dave/cygwin/gcc-3.3.1-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/include' ' | sed -e 's,\(-[BI]\)\([^/][^:]\),\1../../\2,g;s,^\([^/][^:]*/\),../../\1,'`" PC="`echo ./xgpc -B./' ' | sed -e 's,\(-[BI]\)\([^/][^:]\),\1../../\2,g;s,^\([^/][^:]*/\),../../\1,'`" GCC_VERSION="3.3.1" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR="i686-pc-cygwin-ar" AR_FLAGS="rc" RANLIB="i686-pc-cygwin-ranlib" RANLIB_TEST="[ -f i686-pc-cygwin-ranlib ] || ( [ "i686-pc-linux-gnu" = "i686-pc-cygwin" ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )" RTSFLAGS="" DESTDIR="../.." all make[2]: Entering directory `/home/dave/cygwin/gcc-3.3.1-build/gcc/p/rts' echo '{ rts-config.inc. Generated automatically from rts-config.h. }'
rts-config.inc sed -e 's,/\*,{,g;s,\*/,},g;s,^[ \t]*#\(.*\),{$\1},' rts-config.h >> rts-config.inc ../.././xgpc -B../.././ -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 --unit-path=/home/dave/cygwin/gcc-3.3.1/gcc/p/rts --automake --print-needed-options "/home/dave/cygwin/gcc-3.3.1/gcc/p/rts/endian.pas" 2> "needed-options" || true if grep -v '^--' "needed-options" > /dev/null; then echo "needed-options: `cat "needed-options"`" >&2; rm -f "needed-options"; false; else true; fi /home/dave/cygwin/gcc-3.3.1-build/gcc/xgcc -B/home/dave/cygwin/gcc-3.3.1-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:633: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:633: warning: its scope is only this definition or declaration, which is probably not what you want /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:636: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:639: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c: In function `_p_UnixTimeToTime': /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:1001: error: wrong type argument to unary minus make[2]: *** [rts.o] Error 1 make[2]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc/p/rts' make[1]: *** [pascal.rts] Error 2 make[1]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc' make: *** [all-gcc] Error 2
Gcc v. 3.3.1 is used as compiler : gcc -v Reading specs from /usr/local/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs Configured with: ../gcc-3.3.1/configure --prefix=/usr/local/gcc-3.3.1 --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java,pascal --with-system-zlib Thread model: posix gcc version 3.3.1 I am using binutils-2.14, cygwin-1.3.22-1 and w32api-2.3-1. Configure for binutils : ../binutils-2.14/configure --prefix=/home/dave/xcygwin-gcc-3.3.1-bin-2.14 --target=i686-pc-cygwin Configure for gcc : ../gcc-3.3.1/configure --prefix=/home/dave/xcygwin-gcc-3.3.1-bin-2.14 --with-gnu-as --with-gnu-ld --with-newlib --disable-nls --enable-sljl-exceptions --enable-languages=c,c++,objc,f77,pascal --with-headers=/home/dave/xcygwin-gcc-3.3.1-bin-2.14/include --target=i686-pc-cygwin Any suggestions ? Thanks, David
Hello,
I am trying to build cross linux -> cygwin compiler with pascal language enabled.
I am able to build complete gcc-3.3.1 with c,c++,objc,ada,f77,java and pascal-20030507 (the three patches to get gpc-20030507 working with gcc-3.3 applied) languages enabled.
The cross compiler fails under rts :
<snip>
/home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:1001: error: wrong type argument to unary minus
The error appears becouse `timezone' is at that point is either undefined or have strange definition. If you just want to finish compilation then putting the following to lines before the function containing error should help: #undef timezone extern long timezone; For proper fix one should check why configure made wrong choice -- it seems that `configure' defined symbols _GNU_SOURCE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS and that those symbols are not defined during build. For me it looks like `configure' bug. -- Waldek Hebisch hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl
Hello, there is from line nr. 247 : #ifdef HAVE_TZNAME #if !defined (tzname) && !defined (TZNAME_DECLARED) extern char *tzname [2]; #endif #else static char *tzname [2] = { NULL, NULL }; #endif #ifdef HAVE_TIMEZONE #if !defined (timezone) && !defined (TIMEZONE_DECLARED) extern long int timezone; #endif #else #define timezone 0 #endif in rts.c file. I am unable to get it working. If add line #undef timezone before line 247, compiler said : make[2]: Entering directory `/home/dave/cygwin/gcc-build/gcc/p/rts' /home/dave/cygwin/gcc-build/gcc/xgcc -B/home/dave/cygwin/gcc-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:239: error: `timezone' redeclared as different kind of symbol /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include/time.h:117: error: previous declaration of `timezone' /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:636: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:636: warning: its scope is only this definition or declaration, which is probably not what you want /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:639: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:642: warning: `struct stat64' declared inside parameter list make[2]: *** [rts.o] Error 1 make[2]: Leaving directory `/home/dave/cygwin/gcc-build/gcc/p/rts' make[1]: *** [pascal.rts] Error 2 make[1]: Leaving directory `/home/dave/cygwin/gcc-build/gcc' make: *** [all-gcc] Error 2 Regards, David Waldek Hebisch napsal(a):
Hello,
I am trying to build cross linux -> cygwin compiler with pascal language enabled.
I am able to build complete gcc-3.3.1 with c,c++,objc,ada,f77,java and pascal-20030507 (the three patches to get gpc-20030507 working with gcc-3.3 applied) languages enabled.
The cross compiler fails under rts :
<snip>
/home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:1001: error: wrong type argument to unary minus
The error appears becouse `timezone' is at that point is either undefined or have strange definition. If you just want to finish compilation then putting the following to lines before the function containing error should help:
#undef timezone extern long timezone;
For proper fix one should check why configure made wrong choice -- it seems that `configure' defined symbols _GNU_SOURCE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS
and that those symbols are not defined during build. For me it looks like `configure' bug.
Hello,
<snip>
If add line #undef timezone before line 247, compiler said :
make[2]: Entering directory `/home/dave/cygwin/gcc-build/gcc/p/rts' /home/dave/cygwin/gcc-build/gcc/xgcc -B/home/dave/cygwin/gcc-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:239: error: `timezone' redeclared as different kind of symbol /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include/time.h:117: error: previous declaration of `timezone'
I looked into time.h coming from cygwin. In line 107 it defines timezone as a function. However it has variable `_timezone'. I changed line 1001 in `rts.c' replacing `timezone' by `_timezone'. Then I was able to build gpc for cygwin. I have build only pascal and c and the failed later since I used older version of native gpc, but that change should get you past the error. -- Waldek Hebisch hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl
On 18 Aug 2003 at 3:40, Waldek Hebisch wrote: [...]
make[2]: Entering directory `/home/dave/cygwin/gcc-build/gcc/p/rts' /home/dave/cygwin/gcc-build/gcc/xgcc -B/home/dave/cygwin/gcc-build/gcc/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/bin/ -B/home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/lib/ -isystem /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:239: error: `timezone' redeclared as different kind of symbol /home/dave/xcygwin-gcc-3.3.1-bin-2.14-pascal/i686-pc-cygwin/include/ti me.h:117: error: previous declaration of `timezone'
I looked into time.h coming from cygwin. In line 107 it defines timezone as a function. However it has variable `_timezone'. I changed line 1001 in `rts.c' replacing `timezone' by `_timezone'. Then I was able to build gpc for cygwin. I have build only pascal and c and the failed later since I used older version of native gpc, but that change should get you past the error. [....]
This is the patch that I used ... *** gcc/p/rts/rts.c.orig Wed Apr 16 02:58:46 2003 --- gcc/p/rts/rts.c Mon Aug 18 01:38:16 2003 *************** *** 191,196 **** --- 191,201 ---- #include <os-hacks.h> #endif + #ifdef __CYGWIN__ + #undef timezone + #define timezone ((long int) _timezone) + #endif + #if defined (HAVE_ERRNO) && !defined (errno) && !defined (ERRNO_DECLARED) extern int errno; #endif Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
Hello, thanks for your patch. I downloaded os-hacks.h from your site. Now rts.c fails thisways : /home/dave/cygwin/gcc-3.3.1-build/gcc/xgcc -B/home/dave/cygwin/gcc-3.3.1-build/gcc/ -B/home/dave/local/xcygwin/i686-pc-cygwin/bin/ -B/home/dave/local/xcygwin/i686-pc-cygwin/lib/ -isystem /home/dave/local/xcygwin/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:192:2: #endif without #if /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:638: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:638: warning: its scope is only this definition or declaration, which is probably not what you want /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:641: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:644: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c: In function `_p_CStringRealPath': /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:1558: warning: implicit declaration of function `cygwin_conv_to_full_win32_path' make[2]: *** [rts.o] Error 1 make[2]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc/p/rts' make[1]: *** [pascal.rts] Error 2 make[1]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc' make: *** [all-gcc] Error 2 David Prof A Olowofoyeku (The African Chief) napsal(a):
[....]
This is the patch that I used ...
*** gcc/p/rts/rts.c.orig Wed Apr 16 02:58:46 2003 --- gcc/p/rts/rts.c Mon Aug 18 01:38:16 2003 *************** *** 191,196 **** --- 191,201 ---- #include <os-hacks.h> #endif
+ #ifdef __CYGWIN__ + #undef timezone + #define timezone ((long int) _timezone) + #endif + #if defined (HAVE_ERRNO) && !defined (errno) && !defined (ERRNO_DECLARED) extern int errno; #endif
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
On 18 Aug 2003 at 23:41, David Kredba wrote:
Hello,
thanks for your patch.
I downloaded os-hacks.h from your site.
Now rts.c fails thisways :
/home/dave/cygwin/gcc-3.3.1-build/gcc/xgcc -B/home/dave/cygwin/gcc-3.3.1-build/gcc/ -B/home/dave/local/xcygwin/i686-pc-cygwin/bin/ -B/home/dave/local/xcygwin/i686-pc-cygwin/lib/ -isystem /home/dave/local/xcygwin/i686-pc-cygwin/include -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:192:2: #endif without #if /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:638: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:638: warning: its scope is only this definition or declaration, which is probably not what you want /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:641: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:644: warning: `struct stat64' declared inside parameter list /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c: In function `_p_CStringRealPath': /home/dave/cygwin/gcc-3.3.1/gcc/p/rts/rts.c:1558: warning: implicit declaration of function `cygwin_conv_to_full_win32_path' make[2]: *** [rts.o] Error 1 make[2]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc/p/rts' make[1]: *** [pascal.rts] Error 2 make[1]: Leaving directory `/home/dave/cygwin/gcc-3.3.1-build/gcc' make: *** [all-gcc] Error 2 [...]
I don't get this problem. Perhaps it is because you are building gpc based on on gcc-3.3.x. Mine is based on gcc-3.2.3. Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
Waldek Hebisch wrote:
it seems that `configure' defined symbols _GNU_SOURCE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS
and that those symbols are not defined during build.
They're defined in rts/rts.h which is included in rts/*.c, isn't it? Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
Frank Heckenbach wrote:
Waldek Hebisch wrote:
it seems that `configure' defined symbols _GNU_SOURCE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS
and that those symbols are not defined during build.
They're defined in rts/rts.h which is included in rts/*.c, isn't it?
Right. I see were the problem is: Cygwin defines `timezone' as a function. Configure uses the following test: #include "confdefs.h" #define _GNU_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include <time.h> volatile long int tmp; int main() { tmp = timezone; ; return 0; } Appearently, the test succeeds (only gives warning) if `timezone' is a function (maybe use '-timezone' in integer tests)?. -- Waldek Hebisch hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl
Waldek Hebisch wrote:
Frank Heckenbach wrote:
Waldek Hebisch wrote:
it seems that `configure' defined symbols _GNU_SOURCE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS
and that those symbols are not defined during build.
They're defined in rts/rts.h which is included in rts/*.c, isn't it?
Right. I see were the problem is: Cygwin defines `timezone' as a function. Configure uses the following test:
#include "confdefs.h"
#define _GNU_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include <time.h> volatile long int tmp; int main() { tmp = timezone; ; return 0; }
Appearently, the test succeeds (only gives warning) if `timezone' is a function (maybe use '-timezone' in integer tests)?.
Have you tried it and does it work? If so, I'll change it. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (4)
-
David Kredba -
Frank Heckenbach -
Prof A Olowofoyeku (The African Chief) -
Waldek Hebisch