Small fixes to the libretro build process

This commit is contained in:
刘皓 2025-01-30 11:51:42 -05:00
parent b6993d7f37
commit 1f13a834d1
No known key found for this signature in database
GPG key ID: 7901753DB465B711
3 changed files with 7 additions and 16 deletions

View file

@ -563,14 +563,9 @@ jobs:
- name: Build core - name: Build core
run: | run: |
echo '#!/bin/sh'$'\n''exec clang --target=${{ matrix.arch_llvm }} -fuse-ld=lld --sysroot=${{ steps.sysroot.outputs.root-path }} "$@"' > ${{ runner.temp }}/cc
echo '#!/bin/sh'$'\n''exec clang++ --target=${{ matrix.arch_llvm }} -fuse-ld=lld --sysroot=${{ steps.sysroot.outputs.root-path }} "$@"' > ${{ runner.temp }}/c++
chmod +x ${{ runner.temp }}/cc
chmod +x ${{ runner.temp }}/c++
echo "[binaries]" | tee -a ${{ runner.temp }}/cross.ini echo "[binaries]" | tee -a ${{ runner.temp }}/cross.ini
echo "c = '${{ runner.temp }}/cc'" | tee -a ${{ runner.temp }}/cross.ini echo "c = ['clang', '--target=${{ matrix.arch_llvm }}', '-fuse-ld=lld', '--sysroot=${{ steps.sysroot.outputs.root-path }}']" | tee -a ${{ runner.temp }}/cross.ini
echo "cpp = '${{ runner.temp }}/c++'" | tee -a ${{ runner.temp }}/cross.ini echo "cpp = ['clang++', '--target=${{ matrix.arch_llvm }}', '-fuse-ld=lld', '--sysroot=${{ steps.sysroot.outputs.root-path }}']" | tee -a ${{ runner.temp }}/cross.ini
echo "ar = 'llvm-ar'" | tee -a ${{ runner.temp }}/cross.ini echo "ar = 'llvm-ar'" | tee -a ${{ runner.temp }}/cross.ini
echo "strip = 'llvm-strip'" | tee -a ${{ runner.temp }}/cross.ini echo "strip = 'llvm-strip'" | tee -a ${{ runner.temp }}/cross.ini
echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini
@ -719,14 +714,9 @@ jobs:
- name: Build core - name: Build core
run: | run: |
echo '#!/bin/sh'$'\n''exec clang --target=${{ matrix.arch_llvm }} "$@"' > ${{ runner.temp }}/cc
echo '#!/bin/sh'$'\n''exec clang++ --target=${{ matrix.arch_llvm }} "$@"' > ${{ runner.temp }}/c++
chmod +x ${{ runner.temp }}/cc
chmod +x ${{ runner.temp }}/c++
echo "[binaries]" | tee -a ${{ runner.temp }}/cross.ini echo "[binaries]" | tee -a ${{ runner.temp }}/cross.ini
echo "c = '${{ runner.temp }}/cc'" | tee -a ${{ runner.temp }}/cross.ini echo "c = ['clang', '--target=${{ matrix.arch_llvm }}']" | tee -a ${{ runner.temp }}/cross.ini
echo "cpp = '${{ runner.temp }}/c++'" | tee -a ${{ runner.temp }}/cross.ini echo "cpp = ['clang++', '--target=${{ matrix.arch_llvm }}']" | tee -a ${{ runner.temp }}/cross.ini
echo "ar = 'ar'" | tee -a ${{ runner.temp }}/cross.ini echo "ar = 'ar'" | tee -a ${{ runner.temp }}/cross.ini
echo "strip = 'strip'" | tee -a ${{ runner.temp }}/cross.ini echo "strip = 'strip'" | tee -a ${{ runner.temp }}/cross.ini
echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini
@ -782,6 +772,7 @@ jobs:
echo "c = 'emcc'" | tee -a ${{ runner.temp }}/cross.ini echo "c = 'emcc'" | tee -a ${{ runner.temp }}/cross.ini
echo "cpp = 'em++'" | tee -a ${{ runner.temp }}/cross.ini echo "cpp = 'em++'" | tee -a ${{ runner.temp }}/cross.ini
echo "ar = 'emar'" | tee -a ${{ runner.temp }}/cross.ini echo "ar = 'emar'" | tee -a ${{ runner.temp }}/cross.ini
echo "cmake = ['emcmake', 'cmake']" | tee -a ${{ runner.temp }}/cross.ini
echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini echo "[host_machine]" | tee -a ${{ runner.temp }}/cross.ini
echo "system = 'emscripten'" | tee -a ${{ runner.temp }}/cross.ini echo "system = 'emscripten'" | tee -a ${{ runner.temp }}/cross.ini
echo "cpu_family = 'wasm32'" | tee -a ${{ runner.temp }}/cross.ini echo "cpu_family = 'wasm32'" | tee -a ${{ runner.temp }}/cross.ini

View file

@ -103,7 +103,7 @@ $(OUTDIR)/mkxp-retro-ruby/mkxp-retro-ruby.h $(OUTDIR)/mkxp-retro-ruby/mkxp-retro
# note: (so you should pass 'int' not 'wasm_rt_type_t' to 'va_arg') # note: (so you should pass 'int' not 'wasm_rt_type_t' to 'va_arg')
# note: if this code is reached, the program will abort # note: if this code is reached, the program will abort
# The code will still compile, but like it says, the compiler will sprinkle trap instructions everywhere, so when you run the code it'll crash. Scary! Let's make sure that doesn't happen. # The code will still compile, but like it says, the compiler will sprinkle trap instructions everywhere, so when you run the code it'll crash. Scary! Let's make sure that doesn't happen.
if ! for i in $(seq 0 7); do $(SED) -i 's/va_arg(\([a-z_][A-Za-z0-9_]*\), *wasm_rt_type_t)/va_arg(\1, int)/g' $(OUTDIR)/mkxp-retro-ruby/mkxp-retro-ruby_$$i.c; done; then rm -rf $(OUTDIR)/mkxp-retro-ruby; exit 1; fi if ! for i in $$(seq 0 7); do $(SED) -i 's/va_arg(\([a-z_][A-Za-z0-9_]*\), *wasm_rt_type_t)/va_arg(\1, int)/g' $(OUTDIR)/mkxp-retro-ruby/mkxp-retro-ruby_$$i.c; done; then rm -rf $(OUTDIR)/mkxp-retro-ruby; exit 1; fi
$(OUTDIR)/mkxp-retro-dist.zip.c: $(LIBDIR)/mkxp-retro-dist.zip $(OUTDIR)/mkxp-retro-dist.zip.c: $(LIBDIR)/mkxp-retro-dist.zip
mkdir -p $(OUTDIR) mkdir -p $(OUTDIR)

View file

@ -395,13 +395,13 @@ void ALStream::checkStopped()
* the AL source */ * the AL source */
if (!streamInited) if (!streamInited)
return; return;
#endif // MKXPZ_RETRO
/* If alSrc isn't playing, but we haven't /* If alSrc isn't playing, but we haven't
* exhausted the data source yet, we're just * exhausted the data source yet, we're just
* having a buffer underrun */ * having a buffer underrun */
if (!sourceExhausted) if (!sourceExhausted)
return; return;
#endif // MKXPZ_RETRO
if (AL::Source::getState(alSrc) == AL_PLAYING) if (AL::Source::getState(alSrc) == AL_PLAYING)
return; return;