From c9fc0a3ffa9480d3387c4f3622f4d7796212179f Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Tue, 4 Jan 2022 16:16:46 +0800 Subject: [PATCH] bash: mcshl: preload gcompat on musl 1.18+ libjemalloc.so bundled native needs gcompat on executables, gcompat is loaded by interpreter stub, but minecraft here is dlopen-ing it, thus preloading is needed --- .bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 38b9e54..2e7c8e2 100644 --- a/.bashrc +++ b/.bashrc @@ -13,6 +13,7 @@ set +H export -n PS1 # arch set PROMPT_COMMAND for terminal title unset PROMPT_COMMAND +unset _GCOMPAT_PRELOAD export XDG_CACHE_HOME="$HOME/.cache" export XDG_CONFIG_HOME="$HOME/.config" @@ -24,6 +25,8 @@ PATH="$HOME/.local/bin:$XDG_DATA_HOME/npm/bin/:$XDG_CONFIG_HOME/composer/vendor/ if [ "$OSTYPE" = msys ]; then export LC_ALL=zh_TW.UTF-8 PATH="/usr/bin:/bin:/mingw64/bin:$PATH" +elif [ "$OSTYPE" = "linux-musl" ]; then + _GCOMPAT_PRELOAD="LD_PRELOAD=/lib/libgcompat.so.0" fi # XDG workarounds @@ -73,7 +76,7 @@ alias sftp='sftp -p -o Compression=no' [ -f /usr/bin/vimpager ] && alias less=vimpager alias sway="env LC_ALL=zh_TW.utf8 sway" -alias mcshl="env ALSOFT_DRIVERS=alsa _JAVA_OPTIONS=\"-Dawt.useSystemAAFontSettings=lcd -Xmn512m -Xms2G -Xmx2G -XX:+UseTransparentHugePages -XX:MaxGCPauseMillis=50 -XX:+UseZGC $_JAVA_OPTIONS\" mcshl" +alias mcshl="env ALSOFT_DRIVERS=alsa $_GCOMPAT_PRELOAD _JAVA_OPTIONS=\"-Dawt.useSystemAAFontSettings=lcd -Xmn512m -Xms2G -Xmx2G -XX:+UseTransparentHugePages -XX:MaxGCPauseMillis=50 -XX:+UseZGC $_JAVA_OPTIONS\" mcshl" alias tstoggle="swaymsg input 1267:9454:ELAN24EE:00_04F3:24EE events toggle" alias laravelphpcs="phpcs --standard=PSR2 app routes config tests" -- 2.45.2