Skip to content

Conversation

@trofi
Copy link

@trofi trofi commented Nov 27, 2021

On gcc-10 (and gcc-9 -fno-common) sasquatch build fails as:

c++   ./LZMA/lzmalt/*.o unsquashfs.o ... -o sasquatch
ld: unsquash-1.o:squashfs-tools/error.h:34:
  multiple definition of `verbose'; unsquashfs.o:squashfs-tools/error.h:34: first defined here

gcc-10 will changed the default from -fcommon to fno-common:
https://gcc.gnu.org/PR85678.

The change splits declaration and definition.

On gcc-10 (and gcc-9 -fno-common) sasquatch build fails as:

    c++   ./LZMA/lzmalt/*.o unsquashfs.o ... -o sasquatch
    ld: unsquash-1.o:squashfs-tools/error.h:34:
      multiple definition of `verbose'; unsquashfs.o:squashfs-tools/error.h:34: first defined here

gcc-10 will changed the default from -fcommon to fno-common:
  https://gcc.gnu.org/PR85678.

The change splits declaration and definition.
trofi added a commit to trofi/nixpkgs that referenced this pull request Nov 27, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant