dist: trusty sudo: required language: cpp os: linux compiler: gcc addons: apt: sources: ubuntu-toolchain-r-test packages: - linux-libc-dev:i386 - g++-8 - g++-8-multilib - cmake - freebsd-buildutils before_install: eval "CC=gcc-8 && CXX=g++-8" script: # Why do we need -fno-gnu-unique? # These params disable "global unique objects" generated for currently compiled code # # -fuse-ld=gold -Wl,--no-gnu-unique # These params disable "global unique objects" for already compiled object files, so there will be no UNIQUE in result binary # You need to use these params if you're exporting symbols from object files not compiled with -fno-gnu-unique # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60348#c5 # BTW -fuse-ld=gold always (sure?) produce binary with SVR4 brand, but we can change it by brandelf anyway # Also idk what also the gold linker affects in result binary, there is about 5KB diff # # TODO: -flto & its issues with hiding symbols # If static library is compiled with -flto, its exported symbols may be exported even if you have version script file # There is a command for linker fixes that issue, but I forgot it # # Also looks like I'm having some issues with -ldl importing, hmm... (IDA doesn't display required glibc version for imported functions) - ${CXX} Main.cpp -m32 -O3 -shared -std=c++14 -s -static-libgcc -static-libstdc++ -fvisibility=hidden -fpermissive -Ihlsdk/common -Ihlsdk/dlls -Ihlsdk/engine -Ihlsdk/pm_shared -Imetamod -ldl -o SafeNameAndChat.so -fdata-sections -ffunction-sections -Wl,--version-script=version_script.lds -Wl,--gc-sections -fno-gnu-unique - brandelf SafeNameAndChat.so -t SVR4 deploy: provider: releases file: SafeNameAndChat.so skip_cleanup: true overwrite: true api_key: '$GITHUB_API_KEY' on: tags: true