|
Author: eliot
Date: 2011-11-28 15:53:52 -0800 (Mon, 28 Nov 2011)
New Revision: 2518
Modified:
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
branches/Cog/platforms/unix/config/bin.squeak.sh.in
branches/Cog/platforms/unix/config/squeak.sh.in
Log:
Cope with old linuxes use of /lib/tls hack for an optional thread-local-storage
version of libc/libpthread. The launch scripts add /lib/tls:/usr/lib/tls: to
LD_LIBRARY_PATH instead of /lib:/usr/lib: if the VM is linked to /lib/tls/libc.
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Mon Nov 28 11:03:00 PST 2011
+ Mon Nov 28 15:51:11 PST 2011
Modified: branches/Cog/platforms/unix/config/bin.squeak.sh.in
===================================================================
--- branches/Cog/platforms/unix/config/bin.squeak.sh.in 2011-11-28 19:07:44 UTC (rev 2517)
+++ branches/Cog/platforms/unix/config/bin.squeak.sh.in 2011-11-28 23:53:52 UTC (rev 2518)
@@ -10,7 +10,15 @@
/*) PLUGINS="$BIN";;
*) PLUGINS="`pwd`/$BIN"
esac
+# On some old linuxes there is a /lib/tls thread-local-storage version of the C
+# library which the VM may use and if so should take precedence over /lib libc.
+case `/usr/bin/ldd "$BIN/squeak" | /bin/fgrep /libc. | sed 's/^.*=> //'` in
+/lib/tls/libc*) SVMLLP="/lib/tls:/lib:/usr/lib/tls:/usr/lib";;
+/lib/libc*) SVMLLP="/lib:/usr/lib";;
+*) echo "can't infer base LD_LIBRARY_PATH. Aborting." 1>&2;
+ exit 1
+esac
# prepending is less flexible but safer because it ensures we find the plugins
# in the same directory as the VM. We must include at least /lib and /usr/lib
# if libraries there-in are to be found. These directories are not implicit.
-LD_LIBRARY_PATH=$PLUGINS:${LD_LIBRARY_PATH:-/lib:/usr/lib} exec "$BIN/squeak" "$@"
+LD_LIBRARY_PATH=$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH} exec "$BIN/squeak" "$@"
Modified: branches/Cog/platforms/unix/config/squeak.sh.in
===================================================================
--- branches/Cog/platforms/unix/config/squeak.sh.in 2011-11-28 19:07:44 UTC (rev 2517)
+++ branches/Cog/platforms/unix/config/squeak.sh.in 2011-11-28 23:53:52 UTC (rev 2518)
@@ -10,7 +10,15 @@
/*) PLUGINS="$BIN";;
*) PLUGINS="`pwd`/$BIN"
esac
+# On some old linuxes there is a /lib/tls thread-local-storage version of the C
+# library which the VM may use and if so should take precedence over /lib libc.
+case `/usr/bin/ldd "$BIN/squeak" | /bin/fgrep /libc. | sed 's/^.*=> //'` in
+/lib/tls/libc*) SVMLLP="/lib/tls:/lib:/usr/lib/tls:/usr/lib";;
+/lib/libc*) SVMLLP="/lib:/usr/lib";;
+*) echo "can't infer base LD_LIBRARY_PATH. Aborting." 1>&2;
+ exit 1
+esac
# prepending is less flexible but safer because it ensures we find the plugins
# in the same directory as the VM. We must include at least /lib and /usr/lib
# if libraries there-in are to be found. These directories are not implicit.
-LD_LIBRARY_PATH=$PLUGINS:${LD_LIBRARY_PATH:-/lib:/usr/lib} exec "$BIN/squeak" "$@"
+LD_LIBRARY_PATH=$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH} exec "$BIN/squeak" "$@"
|