Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original patch by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
- Loading branch information
Showing
2 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
patches/gcc/4.8.5/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
104 changes: 104 additions & 0 deletions
104
patches/gcc/4.9.4/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |