accelerator icon indicating copy to clipboard operation
accelerator copied to clipboard

Overhaul Accelerator repository

Open Kenzzer opened this issue 1 year ago • 8 comments

Added ~~protobuf and~~ breakpad as submodule

It's no secret that google's tools to fetch their repositories are absolutely horrendous to use, not counting that they're also outdated in regard to python's version. Fortunately for us, google had the decency to make public mirrors of their repository over to github, let's take advantage of that and link to these repositories.

Edit : It seems cloning protobuf is completly unnecessary to compile breakpad

~~Updated breakpad.sh to compile breakpad for both 32bits and 64bits~~

~~Just like the title implies, I've updated the script to compile breakpad for each architecture. I've also revised some of the patches, so they work with the breakpad submodule I decided to set the hash to. One of these patches also became unnecessary, as its change became official.~~

Edit : This is now part of the ambuild scripts

Overhauled AMBuild scripts

Those were some very old, and confusing to look at build scripts. I brought them up to modern ambuild syntax.

Updated the extension code

I modified a few lines of the extension, so that it may compile with the newest breakpad code. As well as the definition of GetSpew function, which was invalid for 64 bits.

Update Gamedata

TF2 x64 bits is out, gamedata needs a little update

Added a CI

CI(s) are cool ! It compiles the extension for latest ubuntu and windows, and also on an older version of both OSes.

Kenzzer avatar Jan 28 '24 00:01 Kenzzer

I've tried to use the Linux artifacts on L4D2 under Debian bookworm (same base as Ubuntu 22.04). I managed to make it work, but I have some comments:

  1. zlib is now a dependency - this is different from the latest HEAD, and probably should be documented somewhere. I only had to install zlib1g:i386 and this stopped being an issue.
  2. The libstdc++ which is bundled with L4D2 seems to be quite old and results in this issue:
[SM] Unable to load extension "accelerator.ext": bin/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/steam/srcds/left4dead2/addons/sourcemod/extensions/accelerator.ext.so)

Since the libraries in the server bin folder have priority, whatever I installed on the host did not really matter. I fixed this by statically linking libgcc and libstdc++. This is a blatant copy paste from SourceMod, so maybe there are side effects or it could simply be shorter (specifically I don't think -lm is needed).

adriansmares avatar Apr 22 '24 10:04 adriansmares

  1. zlib is now a dependency - this is different from the latest HEAD, and probably should be documented somewhere. I only had to install zlib1g:i386 and this stopped being an issue.

ZLib will allow breakpad greater symbol coverage, which in turn should benefit the generated minidumps. Extensions dependencies are usually not documented (wrongly so). I will let @asherkin decide whether or not it should be listed somewhere, or if we should swap to static linkage or take it out entirely.

I fixed this by statically linking libgcc and libstdc++.

Thank you valve. I will address this at the same time as the zlib issue in order to avoid two more commits. As the excessive amount was the reason this branch was asked to be rebased and squashed by Asherkin.

Kenzzer avatar Apr 25 '24 14:04 Kenzzer

On TF2 x64 the SourcePawn JIT binary is unavailable (there is no x64 JIT):

[CRASH] WARNING: Failed to load SourcePawn library /home/steam/srcds/tf/addons/sourcemod/bin/x64/sourcepawn.jit.x86.so: /home/steam/srcds/tf/addons/sourcemod/bin/x64/sourcepawn.jit.x86.so: cannot open shared object file: No such file or directory

It seems that the VM binary however exposes the same interface, and accelerator seems to load well if that binary is used.

adriansmares avatar Apr 26 '24 15:04 adriansmares

ZLib will allow breakpad greater symbol coverage, which in turn should benefit the generated minidumps.

This is for compressed DWARF symbols, right?

Statically linking all 3 feels correct.

asherkin avatar Apr 27 '24 14:04 asherkin

@Kenzzer lmk when i should review this 👀

sapphonie avatar Apr 27 '24 19:04 sapphonie

Sorry for the long delay @adriansmares other x64 fixes took priority (namely sourcehook & dhooks). This should be enough for accelerator to work again on l4d2.

@asherkin Zlib had to be added as a submodule because statically linking against the one provided by linux apt packages will result in compilation error. /usr/bin/ld: /lib/x86_64-linux-gnu/libz.a(zutil.o): relocation R_X86_64_PC32 against symbol 'z_errmsg' can not be used when making a shared object; recompile with -fPIC

As such we have to recompile zlib ourselves with -fPIC

Kenzzer avatar Oct 04 '24 10:10 Kenzzer

Unknown if this fixes #20 because actions aren't set up, can those be enabled on PR please 👍

sapphonie avatar Oct 11 '24 01:10 sapphonie

#20 fixed by #22, actions are now being built on overhaul branch which i merged to this repo ( #21 )

sapphonie avatar Oct 11 '24 14:10 sapphonie