summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-02-12 19:19:18 (GMT)
committerGitHub <noreply@github.com>2017-02-12 19:19:18 (GMT)
commit5676c72d521cea0c67ec3624028b89fdfac1d291 (patch)
tree0b107911447878113dd9329f3a5fa00e20945827
parent57e1e7e7429aa44ae5406409fad0d9341b86243c (diff)
parent7b86176b771e988b6c282275927188a2e6fdf710 (diff)
Merge pull request #590 from stilor/cygwin-old-gcc-glibc
Fix Cygwin build of old gcc and glibc
-rw-r--r--patches/gcc/4.8.5/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch104
-rw-r--r--patches/gcc/4.8.5/950-cygwin64.patch11
-rw-r--r--patches/gcc/4.9.4/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch104
-rw-r--r--patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch13
-rw-r--r--patches/linux/3.10.104/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/3.12.67/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/3.16.38/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/3.18.44/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/3.2.83/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/3.4.113/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/4.1.35/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/4.4.32/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/4.7.10/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--patches/linux/4.8.8/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch16
-rw-r--r--scripts/build/kernel/linux.sh11
26 files changed, 386 insertions, 160 deletions
diff --git a/patches/gcc/4.8.5/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/4.8.5/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
new file mode 100644
index 0000000..3cf66b2
--- /dev/null
+++ b/patches/gcc/4.8.5/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -0,0 +1,104 @@
+diff -urpN '--exclude=autom4te.cache' gcc-4.8.5.orig/gcc/configure gcc-4.8.5/gcc/configure
+--- gcc-4.8.5.orig/gcc/configure 2014-12-08 03:29:43.000000000 -0800
++++ gcc-4.8.5/gcc/configure 2017-02-11 16:57:27.424807994 -0800
+@@ -27364,6 +27364,9 @@ fi
+
+
+ pluginlibs=
++PICFLAG="-fPIC"
++UNDEFINEDPREAMBLE="extern int X;"
++UNDEFINEDCODE="return X == 0;"
+
+ case "${host}" in
+ *-*-darwin*)
+@@ -27375,6 +27378,11 @@ case "${host}" in
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -27487,23 +27495,23 @@ fi
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
+diff -urpN '--exclude=autom4te.cache' gcc-4.8.5.orig/gcc/configure.ac gcc-4.8.5/gcc/configure.ac
+--- gcc-4.8.5.orig/gcc/configure.ac 2014-12-08 03:29:43.000000000 -0800
++++ gcc-4.8.5/gcc/configure.ac 2017-02-11 16:57:27.424807994 -0800
+@@ -5243,6 +5243,9 @@ enable_plugin=$enableval,
+ enable_plugin=yes; default_plugin=yes)
+
+ pluginlibs=
++PICFLAG="-fPIC"
++UNDEFINEDPREAMBLE="extern int X;"
++UNDEFINEDCODE="return X == 0;"
+
+ case "${host}" in
+ *-*-darwin*)
+@@ -5254,6 +5257,11 @@ case "${host}" in
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -5305,17 +5313,17 @@ if test x"$enable_plugin" = x"yes"; then
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- AC_MSG_CHECKING([for -fPIC -shared])
++ AC_MSG_CHECKING([for ${PICFLAG} -shared])
+ AC_TRY_LINK(
+- [extern int X;],[return X == 0;],
++ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
diff --git a/patches/gcc/4.8.5/950-cygwin64.patch b/patches/gcc/4.8.5/950-cygwin64.patch
new file mode 100644
index 0000000..67182ee
--- /dev/null
+++ b/patches/gcc/4.8.5/950-cygwin64.patch
@@ -0,0 +1,11 @@
+--- gcc-4.8.5/gcc/config.host.orig 2017-02-10 20:45:10.425515700 -0800
++++ gcc-4.8.5/gcc/config.host 2017-02-10 20:47:33.935525500 -0800
+@@ -214,7 +214,7 @@
+ ;;
+ esac
+ ;;
+- i[34567]86-*-cygwin*)
++ i[34567]86-*-cygwin* | x86_64-*-cygwin*)
+ host_xm_file=i386/xm-cygwin.h
+ out_host_hook_obj=host-cygwin.o
+ host_xmake_file="${host_xmake_file} i386/x-cygwin"
diff --git a/patches/gcc/4.9.4/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/4.9.4/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
new file mode 100644
index 0000000..c3bab15
--- /dev/null
+++ b/patches/gcc/4.9.4/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -0,0 +1,104 @@
+diff -urpN '--exclude=autom4te.cache' gcc-4.9.4.orig/gcc/configure gcc-4.9.4/gcc/configure
+--- gcc-4.9.4.orig/gcc/configure 2016-05-22 01:53:32.000000000 -0700
++++ gcc-4.9.4/gcc/configure 2017-02-11 16:54:52.879474293 -0800
+@@ -28058,6 +28058,9 @@ fi
+
+
+ pluginlibs=
++PICFLAG="-fPIC"
++UNDEFINEDPREAMBLE="extern int X;"
++UNDEFINEDCODE="return X == 0;"
+
+ case "${host}" in
+ *-*-darwin*)
+@@ -28069,6 +28072,11 @@ case "${host}" in
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -28181,23 +28189,23 @@ fi
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
+diff -urpN '--exclude=autom4te.cache' gcc-4.9.4.orig/gcc/configure.ac gcc-4.9.4/gcc/configure.ac
+--- gcc-4.9.4.orig/gcc/configure.ac 2016-05-22 01:53:32.000000000 -0700
++++ gcc-4.9.4/gcc/configure.ac 2017-02-11 16:49:59.820965424 -0800
+@@ -5583,6 +5583,9 @@ enable_plugin=$enableval,
+ enable_plugin=yes; default_plugin=yes)
+
+ pluginlibs=
++PICFLAG="-fPIC"
++UNDEFINEDPREAMBLE="extern int X;"
++UNDEFINEDCODE="return X == 0;"
+
+ case "${host}" in
+ *-*-darwin*)
+@@ -5594,6 +5597,11 @@ case "${host}" in
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -5645,17 +5653,17 @@ if test x"$enable_plugin" = x"yes"; then
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- AC_MSG_CHECKING([for -fPIC -shared])
++ AC_MSG_CHECKING([for ${PICFLAG} -shared])
+ AC_TRY_LINK(
+- [extern int X;],[return X == 0;],
++ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
diff --git a/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.12.1/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.12.2/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.13/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.14.1/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.14/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.15/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.16.0/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.17/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.18/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.19/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.20/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch b/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch
new file mode 100644
index 0000000..9097628
--- /dev/null
+++ b/patches/glibc/2.21/110-Cygwin-doesnt-have-stat64.patch
@@ -0,0 +1,13 @@
+--- glibc-2.22/sunrpc/rpc_main.c.orig 2015-08-05 07:42:21.000000000 +0100
++++ glibc-2.22/sunrpc/rpc_main.c 2015-10-21 23:37:31.071268800 +0100
+@@ -51,6 +51,10 @@
+ #include "rpc_scan.h"
+ #include "proto.h"
+
++#if defined(__CYGWIN__)
++#define stat64 stat
++#endif
++
+ #include "../version.h"
+ #define PACKAGE _libc_intl_domainname
+
diff --git a/patches/linux/3.10.104/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.10.104/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.10.104/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/3.12.67/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.12.67/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.12.67/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/3.16.38/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.16.38/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.16.38/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/3.18.44/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.18.44/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.18.44/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/3.2.83/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.2.83/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.2.83/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/3.4.113/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/3.4.113/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/3.4.113/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/4.1.35/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/4.1.35/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/4.1.35/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/4.4.32/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/4.4.32/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/4.4.32/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/4.7.10/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/4.7.10/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/4.7.10/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/patches/linux/4.8.8/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch b/patches/linux/4.8.8/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
deleted file mode 100644
index 7b6ee5a..0000000
--- a/patches/linux/4.8.8/100-Define-R_X86_64_JUMP_SLOT-for-Cygwin.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- linux-4.2/arch/x86/tools/relocs.c.orig 2015-10-20 22:36:03.075546600 +0100
-+++ linux-4.2/arch/x86/tools/relocs.c 2015-10-20 22:36:04.934950000 +0100
-@@ -187,6 +187,13 @@
- return name;
- }
-
-+/* Hack for Cygwin */
-+#if ELF_BITS == 64
-+#if !defined(R_X86_64_JUMP_SLOT) && defined(R_X86_64_JMP_SLOT)
-+#define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT
-+#endif
-+#endif
-+
- static const char *rel_type(unsigned type)
- {
- static const char *type_name[] = {
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index 064631b..9cfc433 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -71,6 +71,17 @@ do_kernel_extract() {
return 0
fi
CT_Patch "linux" "${CT_KERNEL_VERSION}"
+
+ # Disable building relocs application - it needs <linux/types.h>
+ # on the host, which may not be present on Cygwin or MacOS; it
+ # needs <elf.h>, which again is not present on MacOS; and most
+ # important, we don't need it to install the headers.
+ # This is not done as a patch, since it varies from Linux version
+ # to version - patching each particular Linux version would be
+ # too cumbersome.
+ CT_Pushd "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}"
+ sed -i -r 's/(\$\(MAKE\) .* relocs)$/:/' arch/*/Makefile
+ CT_Popd
}
# Install kernel headers using headers_install from kernel sources.