3 # this is a DF launcher, replacing the one that ships with DF.
4 # it's purpose is to launch DF through musl's libc.so, because the DF
5 # binary has GLIBC's dynlinker hardcoded as interpreter.
6 # additionally it launches DF through launch-without-heap-randomization.elf.
7 # it turned out that the way musl's malloc work, DF will crash pretty rapidly
8 # if heap randomization is enabled (linux default).
9 # launch-without-heap-randomization.elf will turn that off.
10 # you can compile it from launch-without-heap-randomization.c:
11 # gcc launch-without-heap-randomization.c -o launch-without-heap-randomization.elf
13 DF_DIR
=$
(dirname "$0")
15 export SDL_DISABLE_LOCK_KEYS
=1 # Work around for bug in Debian/Ubuntu SDL patch.
16 #export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
18 if [ $
(uname
-m) = "x86_64" ] ; then
19 [ -e "libs/libc.so" ] && [ -z "$LIB32DIR" ] && LIB32DIR
=.
/libs
20 [ -z "$LIB32DIR" ] && LIB32DIR
=/lib32
21 INTERPRETER
="$LIB32DIR"/libc.so
22 if [ ! -e "$INTERPRETER" ] ; then
24 error: the interpreter $INTERPRETER was not found
25 put the required 32bit libraries into $LIB32DIR or change
26 the environment variable LIB32DIR to point there.
34 libSDL-1.2.so.0 (must be compiled with sabotage's pthread stacksize patch)
35 libstdc++.so.6 (supplied)
36 libgcc_s.so.1 (supplied)
38 optional for sound support:
42 those 2 depend on other libs themselfes:
43 libvorbis, libogg, alsa-lib and possibly more.
49 INTERPRETER
=/lib
/libc.so
51 [ -n "$LIB32DIR" ] && export LD_LIBRARY_PATH
="$LIB32DIR"
52 .
/launch-without-heap-randomization.elf
$INTERPRETER .
/libs
/Dwarf_Fortress $
* # Go, go, go! :)