summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorRemko van der Vossen2015-05-30 04:55:09 +0900
committerRemko van der Vossen2015-05-30 04:55:09 +0900
commitfc8f5e989e3176b1266614f579de4ea74a4af5db (patch)
tree25aee06358238d01eb88c8e626806ea239fef35a /gnu
parent7456d20a72ff551d70f201421b1f353976613b70 (diff)
gcc: find C++ spells based on ELF DT_NEEDED entries
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gcc/HISTORY4
-rwxr-xr-xgnu/gcc/UP_TRIGGERS21
2 files changed, 21 insertions, 4 deletions
diff --git a/gnu/gcc/HISTORY b/gnu/gcc/HISTORY
index 686d8be844..57788d2216 100644
--- a/gnu/gcc/HISTORY
+++ b/gnu/gcc/HISTORY
@@ -1,3 +1,7 @@
+2015-05-29 Remko van der Vossen <wich@sourcemage.org>
+ * UP_TRIGGERS: find C++ ELF objects based on ELF DT_NEEDED entries
+ Probably more successful at finding all C++ ELF objects
+
2015-05-25 Thomas Orgis <sobukus@sourcemage.org>
* DETAILS: There is no ecj-5.1, trying ecj-4.9.
I can compile a hello world example at least.
diff --git a/gnu/gcc/UP_TRIGGERS b/gnu/gcc/UP_TRIGGERS
index a3ef25a0bb..9d126eea11 100755
--- a/gnu/gcc/UP_TRIGGERS
+++ b/gnu/gcc/UP_TRIGGERS
@@ -1,3 +1,6 @@
+LC_ALL=C
+LC_CTYPE=C
+LANG=C
local OLD_SPELL_VERSION=""
spell_ok $SPELL && OLD_SPELL_VERSION="$(installed_version $SPELL)"
if [ "$VERSION" != "$OLD_SPELL_VERSION" ]; then
@@ -10,10 +13,20 @@ if [ "$VERSION" != "$OLD_SPELL_VERSION" ]; then
done &&
# for C++ ABI change in 5.1 and, probably, for each major version change too
- if [[ ${OLD_SPELL_VERSION%%.*} != ${VERSION%%.*} ]]; then
- for each in $(grep "gcc:CXX" "$SUB_DEPENDS_STATUS" | cut -f1 -d:); do
- if spell_ok $each; then
- up_trigger $each cast_self
+ if list_find "$GCC_COMPILER" c++ \
+ && [[ ${OLD_SPELL_VERSION%%.*} != ${VERSION%%.*} ]]; then
+ message "This is an ABI incompatible update of g++..."
+ message "Determining which spells need to be recast, this may take a while."
+
+ for other_spell in $(gaze installed | cut -d: -f1); do
+ [[ $SPELL != $other_spell ]] || continue
+ if gaze install $other_spell \
+ | xargs file -e apptype -e ascii -e compress -e tar \
+ | grep '\<ELF\>.*\<dynamically linked\>' \
+ | cut -d: -f1 \
+ | xargs readelf -d 2> /dev/null \
+ | grep -q 'NEEDED)[[:space:]]*Shared library: \[libstdc++'; then
+ up_trigger $other_spell cast_self
fi
done
fi