Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patches/patch0.txt: fix build on -fno-common toolchains #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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