You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

  1. From fe2f5da4b0f8994169c53e84b7cb8a0feefc97b5 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. ---
  23. squashfs-tools/mksquashfs.h | 2 +-
  24. 1 file changed, 1 insertion(+), 1 deletion(-)
  25. --- a/squashfs-tools/mksquashfs.h
  26. +++ b/squashfs-tools/mksquashfs.h
  27. @@ -143,7 +143,7 @@ struct append_file {
  28. #endif
  29. extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
  30. -struct cache *bwriter_buffer, *fwriter_buffer;
  31. +extern struct cache *bwriter_buffer, *fwriter_buffer;
  32. extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
  33. *to_frag, *locked_fragment, *to_process_frag;
  34. extern struct append_file **file_mapping;