0001-squashfs-tools-fix-build-failure-against-gcc-10.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From e1cdcfd94172a0b1ba4c9df70f4d69a41c687404 Mon Sep 17 00:00:00 2001
  2. From: Sergei Trofimovich <slyfox@gentoo.org>
  3. Date: Sun, 26 Jan 2020 18:35:13 +0000
  4. Subject: [PATCH] squashfs-tools: fix build failure against gcc-10
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. On gcc-10 (and gcc-9 -fno-common) build fails as:
  9. ```
  10. cc ... -o mksquashfs
  11. ld: read_fs.o:(.bss+0x0):
  12. multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
  13. ld: read_fs.o:(.bss+0x8):
  14. multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
  15. ```
  16. gcc-10 will change the default from -fcommon to fno-common:
  17. https://gcc.gnu.org/PR85678.
  18. The error also happens if CFLAGS=-fno-common passed explicitly.
  19. Reported-by: Toralf Förster
  20. Bug: https://bugs.gentoo.org/706456
  21. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  22. [Upstream: https://github.com/plougher/squashfs-tools/commit/fe2f5da4b0f8994169c53e84b7cb8a0feefc97b5.patch]
  23. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  24. ---
  25. squashfs-tools/mksquashfs.h | 2 +-
  26. 1 file changed, 1 insertion(+), 1 deletion(-)
  27. diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
  28. index 1beefef..b650306 100644
  29. --- a/squashfs-tools/mksquashfs.h
  30. +++ b/squashfs-tools/mksquashfs.h
  31. @@ -143,7 +143,7 @@ struct append_file {
  32. #endif
  33. extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
  34. -struct cache *bwriter_buffer, *fwriter_buffer;
  35. +extern struct cache *bwriter_buffer, *fwriter_buffer;
  36. extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
  37. *to_frag, *locked_fragment, *to_process_frag;
  38. extern struct append_file **file_mapping;
  39. --
  40. 2.26.2