summaryrefslogblamecommitdiffstats
path: root/gnu/gcc/UP_TRIGGERS
blob: 2babc48f5e5364c5b6668e5d2784223f775d133a (plain) (tree)
1
2
3
4
5
6
7
8
9
10


          


                                                                  
                                                                           


                                                                 

                                


                                                                              

                                                             
                    
                                            











                                                                                
        
        
           
    
  
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
  # recast the split compiler spells on a gcc version update, see bug #9813
  # this includes g77 for the upgrade from 3.4.x to 4.x compilers
  for each in ada fortran g++ g77 gcj objc; do
    if  spell_ok  $each; then
      up_trigger $each cast_self
    fi
  done &&

  # for C++ ABI change in 5.1 and, probably, for each major version change too
  if   list_find "$GCC_COMPILER" c++ \
    && [[ ${OLD_SPELL_VERSION%%.*} != ${VERSION%%.*} ]]; then
# gcc-5.x,y seems ok
if [[ ${OLD_SPELL_VERSION%%.*} < "5" ]];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 # not v5
  fi
fi