0001-fix-build-with-gcc-10.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. fix build with gcc 10
  2. Define curr_state as extern in nanocom.h to avoid the following build
  3. failure with gcc 10 (which defaults to -fno-common):
  4. /home/buildroot/autobuild/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /tmp/ccLQeiek.o:(.bss+0x7c): multiple definition of `curr_state'; /tmp/ccse155z.o:(.bss+0x0): first defined here
  5. Fixes:
  6. - http://autobuild.buildroot.org/results/4af4710cb9bbb1bc770b9824339dd7dbf8a80b05
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. diff -Naurp nanocom-1.0.orig/nanocom.c nanocom-1.0/nanocom.c
  9. --- nanocom-1.0.orig/nanocom.c 2020-09-04 14:50:15.973320870 +0200
  10. +++ nanocom-1.0/nanocom.c 2020-09-04 14:53:49.429325087 +0200
  11. @@ -20,6 +20,8 @@ Based upon microcom by Anca and Lucian J
  12. #include "nanocom.h"
  13. +state curr_state;
  14. +
  15. int crnl_mapping; //0 - no mapping, 1 mapping
  16. char device[MAX_DEVICE_NAME]; /* serial device name */
  17. diff -Naurp nanocom-1.0.orig/nanocom.h nanocom-1.0/nanocom.h
  18. --- nanocom-1.0.orig/nanocom.h 2020-09-04 14:50:15.973320870 +0200
  19. +++ nanocom-1.0/nanocom.h 2020-09-04 14:51:12.269321982 +0200
  20. @@ -73,7 +73,7 @@ typedef struct {
  21. char echo_type; /*r for remote, l for local and n for none*/
  22. } state;
  23. -state curr_state;
  24. +extern state curr_state;
  25. #endif /* NANOCOM_H */