From 770bf680abe41b3ac2f22ab671dacd014ec72f20 Mon Sep 17 00:00:00 2001 From: Markham Date: Fri, 15 Apr 2022 22:10:14 +0200 Subject: [PATCH] ofgwrite fix build with gcc10 fno common --- ...rite-fix-build-with-gcc10-fno-common.patch | 91 +++++++++++++++++++ make/applications.mk | 1 + 2 files changed, 92 insertions(+) create mode 100644 archive-patches/ofgwrite-fix-build-with-gcc10-fno-common.patch diff --git a/archive-patches/ofgwrite-fix-build-with-gcc10-fno-common.patch b/archive-patches/ofgwrite-fix-build-with-gcc10-fno-common.patch new file mode 100644 index 0000000..17f274a --- /dev/null +++ b/archive-patches/ofgwrite-fix-build-with-gcc10-fno-common.patch @@ -0,0 +1,91 @@ +From 6bfb5dd9ab2f6e6cd45c208493844b5f65616976 Mon Sep 17 00:00:00 2001 +From: max_10 +Date: Sun, 6 Sep 2020 12:03:13 +0200 +Subject: - ofgwrite: fixed build with gcc 10 -fno-common + + +diff --git a/ofgwrite.c b/ofgwrite.c +index 1cd00f0..a944e2b 100644 +--- a/ofgwrite.c ++++ b/ofgwrite.c +@@ -14,6 +14,29 @@ + #include + #include + ++struct stat kernel_file_stat; ++struct stat rootfs_file_stat; ++ ++char kernel_device_arg[1000]; ++char rootfs_device_arg[1000]; ++char kernel_device[1000]; ++char rootfs_device[1000]; ++char rootfs_sub_dir[1000]; ++ ++int found_kernel_device; ++int found_rootfs_device; ++int user_kernel; ++int user_rootfs; ++int rootsubdir_check; ++int multiboot_partition; ++char current_rootfs_device[1000]; ++char current_kernel_device[1000]; ++char current_rootfs_sub_dir[1000]; ++char vumodel[63]; ++ ++enum FlashModeTypeEnum kernel_flash_mode; ++enum FlashModeTypeEnum rootfs_flash_mode; ++ + const char ofgwrite_version[] = "4.5.0"; + int flash_kernel = 0; + int flash_rootfs = 0; +--- a/ofgwrite.h ++++ b/ofgwrite.h +@@ -1,23 +1,23 @@ + #include + +-struct stat kernel_file_stat; +-struct stat rootfs_file_stat; ++extern struct stat kernel_file_stat; ++extern struct stat rootfs_file_stat; + +-char kernel_device_arg[1000]; +-char rootfs_device_arg[1000]; +-char kernel_device[1000]; +-char rootfs_device[1000]; +-char rootfs_sub_dir[1000]; +- +-int found_kernel_device; +-int found_rootfs_device; +-int user_kernel; +-int user_rootfs; +-int multiboot_partition; +-char current_rootfs_device[1000]; +-char current_kernel_device[1000]; +-char current_rootfs_sub_dir[1000]; +-char vumodel[63]; ++extern char kernel_device_arg[1000]; ++extern char rootfs_device_arg[1000]; ++extern char kernel_device[1000]; ++extern char rootfs_device[1000]; ++extern char rootfs_sub_dir[1000]; ++ ++extern int found_kernel_device; ++extern int found_rootfs_device; ++extern int user_kernel; ++extern int user_rootfs; ++extern int multiboot_partition; ++extern char current_rootfs_device[1000]; ++extern char current_kernel_device[1000]; ++extern char current_rootfs_sub_dir[1000]; ++extern char vumodel[63]; + + void handle_busybox_fatal_error(); + +@@ -31,5 +31,5 @@ enum FlashModeTypeEnum + FLASH_MODE_UNKNOWN, MTD, TARBZ2 + }; + +-enum FlashModeTypeEnum kernel_flash_mode; +-enum FlashModeTypeEnum rootfs_flash_mode; ++extern enum FlashModeTypeEnum kernel_flash_mode; ++extern enum FlashModeTypeEnum rootfs_flash_mode; diff --git a/make/applications.mk b/make/applications.mk index b778373..22e9a96 100755 --- a/make/applications.mk +++ b/make/applications.mk @@ -806,6 +806,7 @@ $(D)/ofgwrite: $(ARCHIVE)/ofgwrite-git-$(OFGWRITE_VER).tar.bz2 | $(TARGETPREFIX) $(PATCH)/ofgwrite.patch; \ $(PATCH)/ofgwrite-neutrino.patch; \ $(PATCH)/ofgwrite-fix-build-with-glibc-2.25.patch; \ + $(PATCH)/ofgwrite-fix-build-with-gcc10-fno-common.patch; \ export CC=$(TARGET)-gcc && \ export AR=$(TARGET)-ar && \ $(BUILDENV); \ -- 2.39.5