Skip to content

sasquatch: pass -fcommon to fix build on -fno-common toolchains#147627

Closed
trofi wants to merge 1 commit intoNixOS:masterfrom
trofi:fix-sasquatch-for-fno-common
Closed

sasquatch: pass -fcommon to fix build on -fno-common toolchains#147627
trofi wants to merge 1 commit intoNixOS:masterfrom
trofi:fix-sasquatch-for-fno-common

Conversation

@trofi
Copy link
Copy Markdown
Contributor

@trofi trofi commented 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 upstream fixes it by fixing verbose variable declaration at:
devttys0/sasquatch#44
and fork rebases let's set -fcommon explicitly.

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.
@ofborg ofborg bot requested a review from Pamplemousse November 27, 2021 22:51
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 27, 2021
Comment on lines -48 to +51
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'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fetch the patch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not directly. nixpkgs's sasquatch if a fork by @cole-h with a very invasive devttys0/sasquatch#40 applied (changes every hunk offset).

The repository format is already storing a patch (and not just the source) which makes any (even trivial) changes to it effectively non-composable.

@trofi
Copy link
Copy Markdown
Contributor Author

trofi commented Feb 7, 2022

Does not seem to happen.

@trofi trofi closed this Feb 7, 2022
@trofi trofi deleted the fix-sasquatch-for-fno-common branch February 7, 2022 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants