-
Notifications
You must be signed in to change notification settings - Fork 96
/
0031-make-gcc-plugins-work-for-the-sdk.patch
80 lines (74 loc) · 2.4 KB
/
0031-make-gcc-plugins-work-for-the-sdk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From a426b2c12053304035854184976637a665d3396a Mon Sep 17 00:00:00 2001
From: Lionel VITTE <lionel.vitte@st.com>
Date: Wed, 1 Feb 2023 15:29:23 +0100
Subject: [PATCH] make gcc-plugins work for the sdk
Upstream-Status: Pending
---
config/gcc-plugin.m4 | 11 ++++++++++-
gcc/configure | 12 +++++++++++-
gcc/plugin.c | 5 +++++
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index 8f2787191..966d4c14e 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -77,7 +77,16 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
AC_MSG_RESULT([$plugin_rdynamic])
fi
else
- AC_MSG_RESULT([unable to check])
+ case "${host}" in
+ *-*-linux*)
+ AC_MSG_RESULT([unable to check, guessing -rdynamic is needed])
+ plugin_rdynamic=yes
+ pluginlibs="-rdynamic"
+ ;;
+ *)
+ AC_MSG_RESULT([unable to check])
+ ;;
+ esac
fi
# Check -ldl
diff --git a/gcc/configure b/gcc/configure
index 27ca7dfa4..a731fbbdc 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32137,8 +32137,18 @@ $as_echo_n "checking for -rdynamic... " >&6; }
$as_echo "$plugin_rdynamic" >&6; }
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to check" >&5
+ case "${host}" in
+ *-*-linux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to check, guessing -rdynamic is needed" >&5
+$as_echo "unable to check, guessing -rdynamic is needed" >&6; }
+ plugin_rdynamic=yes
+ pluginlibs="-rdynamic"
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to check" >&5
$as_echo "unable to check" >&6; }
+ ;;
+ esac
fi
# Check -ldl
diff --git a/gcc/plugin.c b/gcc/plugin.c
index d47fa512a..21a98c223 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -980,9 +980,14 @@ plugin_default_version_check (struct plugin_gcc_version *gcc_version,
return false;
if (strcmp (gcc_version->revision, plugin_version->revision))
return false;
+#if 0
+ /* In case of a cross compiler, this compares the cross config with the native
+ config, which will always fail, at least for OE. Disable it. */
if (strcmp (gcc_version->configuration_arguments,
plugin_version->configuration_arguments))
return false;
+#endif
+
return true;
}
--
2.17.1