2017-12-02 20:44:39 +00:00
|
|
|
---
|
|
|
|
config/gcc-plugin.m4 | 18 +++++++++++++-----
|
|
|
|
gcc/configure | 22 +++++++++++++++-------
|
|
|
|
libcc1/configure | 22 +++++++++++++++-------
|
|
|
|
3 files changed, 43 insertions(+), 19 deletions(-)
|
|
|
|
|
|
|
|
--- a/config/gcc-plugin.m4
|
|
|
|
+++ b/config/gcc-plugin.m4
|
2015-11-30 20:14:25 +00:00
|
|
|
@@ -20,6 +20,9 @@
|
|
|
|
|
|
|
|
pluginlibs=
|
|
|
|
|
|
|
|
+ PICFLAG="-fPIC"
|
|
|
|
+ UNDEFINEDPREAMBLE="extern int X;"
|
|
|
|
+ UNDEFINEDCODE="return X == 0;"
|
|
|
|
case "${host}" in
|
|
|
|
*-*-darwin*)
|
|
|
|
if test x$build = x$host; then
|
|
|
|
@@ -30,6 +33,11 @@
|
|
|
|
export_sym_check=
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
|
|
|
|
+ PICFLAG=""
|
|
|
|
+ UNDEFINEDPREAMBLE=""
|
|
|
|
+ UNDEFINEDCODE=""
|
|
|
|
+ ;;
|
|
|
|
*)
|
|
|
|
if test x$build = x$host; then
|
|
|
|
export_sym_check="objdump${exeext} -T"
|
|
|
|
@@ -81,17 +89,17 @@
|
|
|
|
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
|
2017-12-02 20:44:39 +00:00
|
|
|
--- a/gcc/configure
|
|
|
|
+++ b/gcc/configure
|
2018-11-08 07:46:35 +00:00
|
|
|
@@ -29238,6 +29238,9 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
|
|
|
|
pluginlibs=
|
|
|
|
|
|
|
|
+ PICFLAG="-fPIC"
|
|
|
|
+ UNDEFINEDPREAMBLE="extern int X;"
|
|
|
|
+ UNDEFINEDCODE="return X == 0;"
|
|
|
|
case "${host}" in
|
|
|
|
*-*-darwin*)
|
|
|
|
if test x$build = x$host; then
|
2018-11-08 07:46:35 +00:00
|
|
|
@@ -29248,6 +29251,11 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
export_sym_check=
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
|
|
|
|
+ PICFLAG=""
|
|
|
|
+ UNDEFINEDPREAMBLE=""
|
|
|
|
+ UNDEFINEDCODE=""
|
|
|
|
+ ;;
|
|
|
|
*)
|
|
|
|
if test x$build = x$host; then
|
|
|
|
export_sym_check="objdump${exeext} -T"
|
2018-11-08 07:46:35 +00:00
|
|
|
@@ -29360,23 +29368,23 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
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;
|
|
|
|
}
|
2017-12-02 20:44:39 +00:00
|
|
|
--- a/libcc1/configure
|
|
|
|
+++ b/libcc1/configure
|
|
|
|
@@ -14531,6 +14531,9 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
|
|
|
|
pluginlibs=
|
|
|
|
|
|
|
|
+ PICFLAG="-fPIC"
|
|
|
|
+ UNDEFINEDPREAMBLE="extern int X;"
|
|
|
|
+ UNDEFINEDCODE="return X == 0;"
|
|
|
|
case "${host}" in
|
|
|
|
*-*-darwin*)
|
|
|
|
if test x$build = x$host; then
|
2017-12-02 20:44:39 +00:00
|
|
|
@@ -14541,6 +14544,11 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
export_sym_check=
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
|
|
|
|
+ PICFLAG=""
|
|
|
|
+ UNDEFINEDPREAMBLE=""
|
|
|
|
+ UNDEFINEDCODE=""
|
|
|
|
+ ;;
|
|
|
|
*)
|
|
|
|
if test x$build = x$host; then
|
|
|
|
export_sym_check="objdump${exeext} -T"
|
2017-12-02 20:44:39 +00:00
|
|
|
@@ -14653,23 +14661,23 @@
|
2015-11-30 20:14:25 +00:00
|
|
|
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;
|
|
|
|
}
|