I've been having fantastic success building gcc. I have got it
to iterate through the entire build (as far as I can tell) now.
Then finally I ran into an internal compiler error which I haven't seen
before. One of the gcc options must have triggered something off.
Perhaps it was -Wwrite-strings, or maybe the -O2 (I normally use
-Os for a completely unrelated reason). Either way, I need to find
out how to switch off those flags. I'll also try to fix the compiler
internal error in i370.md.
This problem was due to the build being done with 64-bit
long long enabled - something i370.md can't cope with.
I forced it off with these two things:
configure:
main ()
{
! long long int i;
;
return 0;
}
--- 3196,3202 ----
int
main ()
{
! zlong long int i;
hwint.h:
#if !defined HAVE_LONG_LONG
! # if GCC_VERSION >= 3000 && !PUREISO && defined(WANT64)
# define HAVE_LONG_LONG 1
# define SIZEOF_LONG_LONG 8
Now at the end of the build, I can save the output, and do a
grep "^i370-mvspdp-gcc" to get all the source files that need to be
compiled. I could attempt to use the .o files (that are really .s)
directly, but that's not something I really need.
The auto-host.h looks fine, plus I have the generated files.
I still need to clean up the scripts further (the below is a work in
progress), and I need to write the programs that will generate the
compile JCL and then try it out!
Part of the cleanup will hopefully get around the multiple make failures ...
+ make
+ cp gcc/config/i370/dummy_config.h gcc/config.h
+ make
+ cp gcc/config/i370/i370-mvspdp-gcc2 ../mvscross/bin/i370-mvspdp-gcc
+ make
:-)
BFN. Paul.
Index: gccnew/gcc/configure
diff -c gccnew/gcc/configure:1.1.1.1 gccnew/gcc/configure:1.12
*** gccnew/gcc/configure:1.1.1.1 Thu Jul 9 10:25:05 2009
--- gccnew/gcc/configure Fri Oct 30 12:34:44 2009
***************
*** 2463,2470 ****
--- 2463,2472 ----
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/stat.h>
+ #endif
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
***************
*** 3194,3200 ****
int
main ()
{
! long long int i;
;
return 0;
}
--- 3196,3202 ----
int
main ()
{
! zlong long int i;
;
return 0;
}
***************
*** 3377,3383 ****
--- 3379,3387 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 3448,3454 ****
--- 3452,3460 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 3519,3525 ****
--- 3525,3533 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 3590,3596 ****
--- 3598,3606 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 3662,3668 ****
--- 3672,3680 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 3735,3741 ****
--- 3747,3755 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
int
***************
*** 5656,5662 ****
--- 5670,5678 ----
if test $ac_cv_header_time = yes; then
cat >>confdefs.h <<\_ACEOF
+ #if !defined(__MVS__)
#define TIME_WITH_SYS_TIME 1
+ #endif
_ACEOF
fi
***************
*** 6150,6157 ****
--- 6166,6180 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/param.h>
+ #endif
+ #if defined(__MVS__)
+ #define BIG_ENDIAN 1
+ #define LITTLE_ENDIAN 2
+ #define BYTE_ORDER 1
+ #endif
int
main ()
{
***************
*** 6192,6199 ****
--- 6215,6229 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/param.h>
+ #endif
+ #if defined(__MVS__)
+ #define BIG_ENDIAN 1
+ #define LITTLE_ENDIAN 2
+ #define BYTE_ORDER 1
+ #endif
int
main ()
{
***************
*** 6731,6738 ****
--- 6761,6770 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <inttypes.h>
+ #endif
int
main ()
{
***************
*** 6851,6857 ****
--- 6883,6891 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 7051,7057 ****
--- 7085,7093 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
***************
*** 7093,7099 ****
--- 7129,7137 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Thanks to Mike Rendell for this test. */
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
#define NGID 256
#undef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
***************
*** 7303,7311 ****
--- 7341,7351 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
+ #endif
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
***************
*** 7570,7576 ****
--- 7610,7618 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 7644,7650 ****
--- 7686,7694 ----
else
cat >conftest.$ac_ext <<_ACEOF
/* By Ruediger Kuhlmann. */
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
***************
*** 7717,7725 ****
--- 7761,7771 ----
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
#include <stdlib.h>
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
+ #endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
***************
*** 8998,9004 ****
--- 9044,9052 ----
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
Index: gccnew/gcc/hwint.h
diff -c gccnew/gcc/hwint.h:1.1.1.2 gccnew/gcc/hwint.h:1.3
*** gccnew/gcc/hwint.h:1.1.1.2 Thu Jul 9 10:27:21 2009
--- gccnew/gcc/hwint.h Mon Nov 2 20:50:44 2009
***************
*** 22,28 ****
but they're all cross-compile-only.) Just in case, force a
constraint violation if that assumption is incorrect. */
#if !defined HAVE_LONG_LONG
! # if GCC_VERSION >= 3000 && !PUREISO
# define HAVE_LONG_LONG 1
# define SIZEOF_LONG_LONG 8
extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
--- 22,28 ----
but they're all cross-compile-only.) Just in case, force a
constraint violation if that assumption is incorrect. */
#if !defined HAVE_LONG_LONG
! # if GCC_VERSION >= 3000 && !PUREISO && defined(WANT64)
# define HAVE_LONG_LONG 1
# define SIZEOF_LONG_LONG 8
extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
Index: gccnew/gcc/config/i370/build1
diff -c /dev/null gccnew/gcc/config/i370/build1:1.2
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/build1 Tue Nov 3 00:43:52 2009
***************
*** 0 ****
--- 1,6 ----
+
./configure --target=i370-mvspdp --prefix=/devel/mvscross --with-sysroot=/devel/mvshead
--enable-languages=c
+ make
+ make install
+ mv ../mvscross/bin/i370-mvspdp-gcc ../mvscross/bin/i370-mvspdp-xxx
+ cp gcc/config/i370/i370-mvspdp-gcc1 ../mvscross/bin/i370-mvspdp-gcc
+ cp gcc/config/i370/i370-mvspdp-ar ../mvscross/bin
Index: gccnew/gcc/config/i370/build2
diff -c /dev/null gccnew/gcc/config/i370/build2:1.2
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/build2 Mon Nov 2 23:11:38 2009
***************
*** 0 ****
--- 1,7 ----
+
./configure --build=i686-linux --host=i370-mvspdp --target=i370-mvspdp --prefix=/devel/mvshost
--enable-languages=c --disable-nls
+
+ make
+ cp gcc/config/i370/dummy_config.h gcc/config.h
+ make
+ cp gcc/config/i370/i370-mvspdp-gcc2 ../mvscross/bin/i370-mvspdp-gcc
+ make
Index: gccnew/gcc/config/i370/dummy_config.h
diff -c /dev/null gccnew/gcc/config/i370/dummy_config.h:1.1
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/dummy_config.h Mon Nov 2 23:11:29 2009
***************
*** 0 ****
--- 1,12 ----
+ #ifndef GCC_CONFIG_H
+ #define GCC_CONFIG_H
+ #ifndef POSIX
+ # define POSIX
+ #endif
+ #include "unixio.h"
+ #include "config/i370/mvspdp.h"
+ #include "auto-host.h"
+ #ifdef IN_GCC
+ # include "ansidecl.h"
+ #endif
+ #endif /* GCC_CONFIG_H */
Index: gccnew/gcc/config/i370/i370-mvspdp-ar
diff -c /dev/null gccnew/gcc/config/i370/i370-mvspdp-ar:1.1
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/i370-mvspdp-ar Tue Nov 3 00:42:23 2009
***************
*** 0 ****
--- 1,2 ----
+ echo ar $*
+ touch $2
Index: gccnew/gcc/config/i370/i370-mvspdp-gcc1
diff -c /dev/null gccnew/gcc/config/i370/i370-mvspdp-gcc1:1.1
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/i370-mvspdp-gcc1 Mon Nov 2 23:08:46 2009
***************
*** 0 ****
--- 1,2 ----
+ i370-mvspdp-xxx -Werror-implicit-function-declaration -DPUREISO -S -I
/devel/mvshead/usr/include $*
+ #i370-mvspdp-xxx -DPUREISO -S -I /devel/mvshead/usr/include $*
Index: gccnew/gcc/config/i370/i370-mvspdp-gcc2
diff -c /dev/null gccnew/gcc/config/i370/i370-mvspdp-gcc2:1.1
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/i370-mvspdp-gcc2 Mon Nov 2 23:08:46 2009
***************
*** 0 ****
--- 1,2 ----
+ #i370-mvspdp-xxx -Werror-implicit-function-declaration -DPUREISO -S -I
/devel/mvshead/usr/include $*
+ i370-mvspdp-xxx -DPUREISO -S -I /devel/mvshead/usr/include $*
Index: gccnew/gcc/config/i370/masterbuild
diff -c /dev/null gccnew/gcc/config/i370/masterbuild:1.1
*** /dev/null Tue Nov 3 00:56:29 2009
--- gccnew/gcc/config/i370/masterbuild Mon Nov 2 23:13:48 2009
***************
*** 0 ****
--- 1,11 ----
+ rm -fr gccnew
+ cvs get gccnew
+ cd gccnew
+ gcc/config/i370/build1
+ cd ..
+
+ rm -fr gccnew
+ cvs get gccnew
+ cd gccnew
+ gcc/config/i370/build2
+ cd ..
Index: gccnew/libiberty/configure
diff -c gccnew/libiberty/configure:1.1.1.1 gccnew/libiberty/configure:1.16
*** gccnew/libiberty/configure:1.1.1.1 Thu Jul 9 10:25:05 2009
--- gccnew/libiberty/configure Sat Oct 24 10:00:20 2009
***************
*** 274,279 ****
--- 274,284 ----
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+ #include <string.h>
+ #include <signal.h>
+ #include <stdarg.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
***************
*** 3110,3117 ****
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
! #include <sys/types.h>
! #include <sys/param.h>
int
main ()
{
--- 3115,3125 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
! /*#include <sys/types.h>
! #include <sys/param.h>*/
! #define BIG_ENDIAN 1
! #define LITTLE_ENDIAN 2
! #define BYTE_ORDER 1
int
main ()
{
***************
*** 3143,3150 ****
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
! #include <sys/types.h>
! #include <sys/param.h>
int
main ()
{
--- 3151,3161 ----
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
! /*#include <sys/types.h>
! #include <sys/param.h>*/
! #define BIG_ENDIAN 1
! #define LITTLE_ENDIAN 2
! #define BYTE_ORDER 1
int
main ()
{
***************
*** 4163,4169 ****
--- 4174,4189 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #else
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+ #include <string.h>
+ #include <signal.h>
+ #include <stdarg.h>
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 4424,4429 ****
--- 4444,4457 ----
libiberty_cv_var_sys_errlist=yes
;;
+ *-*-mvs*)
+ # MVS has no extensions
+ ac_cv_func_vfork_works=no
+ libiberty_cv_var_sys_nerr=no
+ libiberty_cv_var_sys_errlist=no
+ libiberty_cv_var_sys_siglist=no
+ ;;
+
*-*-*vms*)
# Under VMS, vfork works very different than on Unix. The standard
test
# won't work, and it isn't easily adaptable. It makes more sense to
***************
*** 4590,4596 ****
--- 4618,4633 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #else
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+ #include <string.h>
+ #include <signal.h>
+ #include <stdarg.h>
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 4926,4932 ****
--- 4963,4971 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 5256,5262 ****
--- 5295,5303 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
***************
*** 5555,5561 ****
--- 5596,5611 ----
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+ #if !defined(__MVS__)
char $ac_func ();
+ #else
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+ #include <string.h>
+ #include <signal.h>
+ #include <stdarg.h>
+ #endif
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */