m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.5k stars 257 forks source link

more compiletime/runtime security; add to brotli .pc files #2525

Closed hydra3333 closed 9 months ago

hydra3333 commented 9 months ago
  1. Update environment FLAGS with -fstack-protector-strong -D_FORTIFY_SOURCE=2 to be consistent across the flags.

Reasoning: There are a large number of very complex 3rd party dependencies maintained by 3rd parties which, whilst notionally safe at first glance, may introduce security issues. Nowadays especially, that's the last thing anyone needs. Let's bake a tiny bit of checking into the build ... if people don't like it then they can always change it themselves.

  1. fix the brotli brotlicommon not found during linking issue if brotlicommon not already added, then add it to the brotli .pc files
hydra3333 commented 9 months ago

Oh no, to be more like deadsix27, the pull should probably instead contain

grep_and_sed 'private' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlidec.pc \
        '|private|d' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlidec.pc
grep_and_sed 'private' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlienc.pc \
        '|private|d' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlienc.pc
grep_or_sed '-lbrotlidec -lbrotlicommon' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlidec.pc \
        's|-lbrotlidec|-lbrotlidec -lbrotlicommon|g' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlidec.pc 
grep_or_sed '-lbrotlienc -lbrotlicommon' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlienc.pc \
        's|-lbrotlienc|-lbrotlienc -lbrotlicommon|g' "$MINGW_PREFIX"/lib/pkgconfig/libbrotlienc.pc