Skip to content

Commit

Permalink
sasquatch: pass -fcommon to fix build on -fno-common toolchains
Browse files Browse the repository at this point in the history
Without the change build on clang-12 or upstream gcc-12 fails as:

    $ nix build --impure --expr 'with import ./. {}; sasquatch.override { stdenv = clang12Stdenv; }' -L
    ...
    c++   ./LZMA/lzmalt/*.o ... -o sasquatch
    ld: squashfs-tools/./error.h:34: multiple definition of `verbose'; unsquashfs.o:error.h:34: first defined here

Until upstrea fixes it by fixing `verbose` variable declaration at:
  devttys0/sasquatch#44
and fork rebases let's set `-fcommon` explicitly.
  • Loading branch information
trofi committed Nov 27, 2021
1 parent 29ba030 commit 7af3fcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/tools/filesystems/sasquatch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ stdenv.mkDerivation rec {
postPatch = ''
# Drop blanket -Werror to avoid build failure on fresh toolchains
# like gcc-11.
substituteInPlace squashfs-tools/Makefile --replace ' -Werror' ' '
# Add -fcommon as a woarkaround for compiler that default to -fno-common
# like upstream gcc-10 or clang-11. Will be fixed upstream at:
# https://github.com/devttys0/sasquatch/pull/44
substituteInPlace squashfs-tools/Makefile --replace ' -Werror' ' -fcommon'
cd squashfs-tools
'';

Expand Down

0 comments on commit 7af3fcd

Please sign in to comment.