# Rebuild Psion's totem with gcc 3.4 and debug symbols. # # The copy in the image was built with the chroot's default gcc 4.1. It links # libstdc++.so.6 and passed the symbol gate, but the card carries 6.0.3, which # is gcc 3.4's runtime -- a 4.1-compiled C++ binary against a 3.4 libstdc++ can # resolve every symbol and still fall over at run time. It segfaults in its own # main loop shortly after the window appears, which fits. # # Unstripped and -O0 so a backtrace is readable if it still crashes. set -x rm -rf /build/out; mkdir -p /build/out/bin export PKG_CONFIG_PATH=/usr/lib/pkgconfig export LC_ALL=C export CC=gcc-3.4 export CXX=g++-3.4 cd /build/totem-0.99.15.1 # combo_device_changed() calls get_drive() and then dereferences the result # without checking it. get_drive() returns NULL when the machine has no # optical drive, which is the case here -- the netBook Pro has none, and # scan_for_cdroms() comes back empty, which is also why totem warns that it # "couldn't read /proc/sys/dev/cdrom/info". The combo emits its changed signal # during construction, so totem segfaults a moment after its window appears. grep -q "if (drive == NULL)" src/bacon-cd-selection.c \ && echo "NULL guard present" || echo "WARNING: NULL guard MISSING" make clean > /dev/null 2>&1 ./configure --prefix=/usr --disable-schemas-install --disable-nautilus \ --disable-mozilla --disable-vanity --enable-gstreamer \ --x-includes=/usr/include --x-libraries=/usr/lib \ CFLAGS="-g -O0" > /build/out/conf.log 2>&1 echo "RC_conf=$?" tail -6 /build/out/conf.log make > /build/out/make.log 2>&1 echo "RC_make=$?" if [ -f src/totem ]; then cp src/totem /build/out/bin/totem echo GOT_totem else echo MISSING_totem grep -E 'error:|Error [0-9]' /build/out/make.log | tail -8 fi ls -l /build/out/bin