From 30c506ec5e579e1c0517234c84a81dafc38ce10d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 17:42:18 +0100 Subject: [PATCH 1/5] Fix -fno-common issues --- neovim-0.4.3-fix-fno-common.patch | 223 ++++++++++++++++++++++++++++++ neovim.spec | 14 +- 2 files changed, 234 insertions(+), 3 deletions(-) create mode 100644 neovim-0.4.3-fix-fno-common.patch diff --git a/neovim-0.4.3-fix-fno-common.patch b/neovim-0.4.3-fix-fno-common.patch new file mode 100644 index 0000000..9d2b121 --- /dev/null +++ b/neovim-0.4.3-fix-fno-common.patch @@ -0,0 +1,223 @@ +From 2a96bc336a86b5178019e9f4880f00e65f1e9b11 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:33:55 +0100 +Subject: [PATCH 1/5] nvim:eval: Fix enum declaration for ListLenSpecials + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/eval/typval.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h +index 008453b87..5afdedff7 100644 +--- a/src/nvim/eval/typval.h ++++ b/src/nvim/eval/typval.h +@@ -33,7 +33,7 @@ typedef double float_T; + enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; + + /// Additional values for tv_list_alloc() len argument +-enum { ++enum ListLenSpecials { + /// List length is not known in advance + /// + /// To be used when there is neither a way to know how many elements will be +@@ -49,7 +49,7 @@ enum { + /// + /// To be used when it looks impractical to determine list length. + kListLenMayKnow = -3, +-} ListLenSpecials; ++}; + + /// Maximal possible value of varnumber_T variable + #define VARNUMBER_MAX INT64_MAX +-- +2.25.0 + + +From 1ff3e86b44204e15e07e152f353e389bd72836d7 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:17:37 +0100 +Subject: [PATCH 2/5] nvim:viml: Fix enum declaration of ExprParserFlags + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/viml/parser/expressions.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h +index 23e172da7..838a74227 100644 +--- a/src/nvim/viml/parser/expressions.h ++++ b/src/nvim/viml/parser/expressions.h +@@ -326,7 +326,7 @@ struct expr_ast_node { + } data; + }; + +-enum { ++enum ExprParserFlags { + /// Allow multiple expressions in a row: e.g. for :echo + /// + /// Parser will still parse only one of them though. +@@ -345,7 +345,7 @@ enum { + // viml_expressions_parser.c, nvim_parse_expression() flags parsing + // alongside with its documentation and flag sets in check_parsing() + // function in expressions parser functional and unit tests. +-} ExprParserFlags; ++}; + + /// AST error definition + typedef struct { +-- +2.25.0 + + +From 400111a478b9f522ee98f06bda4660226961806f Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:36:21 +0100 +Subject: [PATCH 3/5] nvim: Fix enum declaration of RemapValues + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/getchar.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h +index 01f60ccf4..f0b52079a 100644 +--- a/src/nvim/getchar.h ++++ b/src/nvim/getchar.h +@@ -10,12 +10,12 @@ + /// Values for "noremap" argument of ins_typebuf() + /// + /// Also used for map->m_noremap and menu->noremap[]. +-enum { ++enum RemapValues { + REMAP_YES = 0, ///< Allow remapping. + REMAP_NONE = -1, ///< No remapping. + REMAP_SCRIPT = -2, ///< Remap script-local mappings only. + REMAP_SKIP = -3, ///< No remapping for first char. +-} RemapValues; ++}; + + // Argument for flush_buffers(). + typedef enum { +-- +2.25.0 + + +From 8c74252287b68d3da778d2a5412044890913cc38 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:40:37 +0100 +Subject: [PATCH 4/5] nvim:msgpack: Correctly set up MultiQueue + *ch_before_blocking_events + +gcc10 builds with -fno-common by default. This mean you can't define +a global variable with the same name twice. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/msgpack_rpc/channel.c | 2 ++ + src/nvim/msgpack_rpc/channel.h | 6 ------ + src/nvim/os/input.c | 5 +++++ + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c +index 92ca29209..64f9694a2 100644 +--- a/src/nvim/msgpack_rpc/channel.c ++++ b/src/nvim/msgpack_rpc/channel.c +@@ -41,6 +41,8 @@ + static PMap(cstr_t) *event_strings = NULL; + static msgpack_sbuffer out_buffer; + ++extern MultiQueue *ch_before_blocking_events; ++ + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "msgpack_rpc/channel.c.generated.h" + #endif +diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h +index 9ff5abdc5..c0aeaee7a 100644 +--- a/src/nvim/msgpack_rpc/channel.h ++++ b/src/nvim/msgpack_rpc/channel.h +@@ -12,12 +12,6 @@ + + #define METHOD_MAXLEN 512 + +-/// HACK: os/input.c drains this queue immediately before blocking for input. +-/// Events on this queue are async-safe, but they need the resolved state +-/// of os_inchar(), so they are processed "just-in-time". +-MultiQueue *ch_before_blocking_events; +- +- + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "msgpack_rpc/channel.h.generated.h" + #endif +diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c +index c1580c5fc..3eacf6180 100644 +--- a/src/nvim/os/input.c ++++ b/src/nvim/os/input.c +@@ -28,6 +28,11 @@ + #define READ_BUFFER_SIZE 0xfff + #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) + ++/// HACK: os/input.c drains this queue immediately before blocking for input. ++/// Events on this queue are async-safe, but they need the resolved state ++/// of os_inchar(), so they are processed "just-in-time". ++MultiQueue *ch_before_blocking_events; ++ + typedef enum { + kInputNone, + kInputAvail, +-- +2.25.0 + + +From 708a9f9354b1a619e9d185867b30808c675e96d2 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:29:12 +0100 +Subject: [PATCH 5/5] nvim: Define channels as extern + +As gcc10 uses -fno-common by default, global variables declared with the +same name more than once is not allowed anymore revealing this issue. + +We need to define it as extern to access it. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/channel.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/channel.h b/src/nvim/channel.h +index c733e276b..91e75d411 100644 +--- a/src/nvim/channel.h ++++ b/src/nvim/channel.h +@@ -85,7 +85,7 @@ struct Channel { + bool callback_scheduled; + }; + +-EXTERN PMap(uint64_t) *channels; ++extern PMap(uint64_t) *channels; + + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "channel.h.generated.h" +-- +2.25.0 + diff --git a/neovim.spec b/neovim.spec index a16de14..0a11e29 100644 --- a/neovim.spec +++ b/neovim.spec @@ -13,7 +13,7 @@ Name: neovim Version: 0.4.3 -Release: 2%{?dist} +Release: 3%{?dist} License: ASL 2.0 Summary: Vim-fork focused on extensibility and agility @@ -22,7 +22,10 @@ Url: https://neovim.io Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{version}.tar.gz Source1: sysinit.vim Source2: spec-template -Patch0: neovim-0.1.7-bitop.patch + +Patch0: neovim-0.4.3-fix-fno-common.patch + +Patch1000: neovim-0.1.7-bitop.patch BuildRequires: gcc-c++ BuildRequires: cmake @@ -77,8 +80,10 @@ parts of Vim, without compromise, and more. %prep %setup -q +%patch0 -p1 + %if %{without luajit} -%patch0 -p1 -b .bitop +%patch1000 -p1 -b .bitop %endif %build @@ -1587,6 +1592,9 @@ install -m0644 runtime/nvim.png %{buildroot}%{_datadir}/pixmaps/nvim.png %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Mon Feb 17 2020 Andreas Schneider - 0.4.3-3 +- resolves: #1799680 - Fix -fno-common issues + * Wed Jan 29 2020 Fedora Release Engineering - 0.4.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 490b8c69f1e616680a0085325e2d9a5458dbd818 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 19:02:31 +0100 Subject: [PATCH 2/5] Update patchset for -fno-common --- neovim-0.4.3-fix-fno-common.patch | 179 +++++++++++++++++++++--------- neovim.spec | 5 +- 2 files changed, 131 insertions(+), 53 deletions(-) diff --git a/neovim-0.4.3-fix-fno-common.patch b/neovim-0.4.3-fix-fno-common.patch index 9d2b121..ecbe087 100644 --- a/neovim-0.4.3-fix-fno-common.patch +++ b/neovim-0.4.3-fix-fno-common.patch @@ -1,7 +1,7 @@ From 2a96bc336a86b5178019e9f4880f00e65f1e9b11 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 16:33:55 +0100 -Subject: [PATCH 1/5] nvim:eval: Fix enum declaration for ListLenSpecials +Subject: [PATCH 1/7] nvim:eval: Fix enum declaration for ListLenSpecials Instead of declaring an enum, this creates a global variable. As gcc10 uses -fno-common by default, global variables declared with the same @@ -44,7 +44,7 @@ index 008453b87..5afdedff7 100644 From 1ff3e86b44204e15e07e152f353e389bd72836d7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 17:17:37 +0100 -Subject: [PATCH 2/5] nvim:viml: Fix enum declaration of ExprParserFlags +Subject: [PATCH 2/7] nvim:viml: Fix enum declaration of ExprParserFlags Instead of declaring an enum, this creates a global variable. As gcc10 uses -fno-common by default, global variables declared with the same @@ -87,7 +87,7 @@ index 23e172da7..838a74227 100644 From 400111a478b9f522ee98f06bda4660226961806f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 16:36:21 +0100 -Subject: [PATCH 3/5] nvim: Fix enum declaration of RemapValues +Subject: [PATCH 3/7] nvim: Fix enum declaration of RemapValues Instead of declaring an enum, this creates a global variable. As gcc10 uses -fno-common by default, global variables declared with the same @@ -124,76 +124,54 @@ index 01f60ccf4..f0b52079a 100644 2.25.0 -From 8c74252287b68d3da778d2a5412044890913cc38 Mon Sep 17 00:00:00 2001 +From f870d61a336756a71e719f89752be796fcee45ea Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 16:40:37 +0100 -Subject: [PATCH 4/5] nvim:msgpack: Correctly set up MultiQueue - *ch_before_blocking_events +Subject: [PATCH 4/7] nvim:msgpack: Correctly set up global + ch_before_blocking_events gcc10 builds with -fno-common by default. This mean you can't define a global variable with the same name twice. See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 --- - src/nvim/msgpack_rpc/channel.c | 2 ++ - src/nvim/msgpack_rpc/channel.h | 6 ------ - src/nvim/os/input.c | 5 +++++ - 3 files changed, 7 insertions(+), 6 deletions(-) + src/nvim/msgpack_rpc/channel.h | 2 +- + src/nvim/os/input.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) -diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c -index 92ca29209..64f9694a2 100644 ---- a/src/nvim/msgpack_rpc/channel.c -+++ b/src/nvim/msgpack_rpc/channel.c -@@ -41,6 +41,8 @@ - static PMap(cstr_t) *event_strings = NULL; - static msgpack_sbuffer out_buffer; - -+extern MultiQueue *ch_before_blocking_events; -+ - #ifdef INCLUDE_GENERATED_DECLARATIONS - # include "msgpack_rpc/channel.c.generated.h" - #endif diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h -index 9ff5abdc5..c0aeaee7a 100644 +index 9ff5abdc5..90e1c7d48 100644 --- a/src/nvim/msgpack_rpc/channel.h +++ b/src/nvim/msgpack_rpc/channel.h -@@ -12,12 +12,6 @@ - - #define METHOD_MAXLEN 512 - --/// HACK: os/input.c drains this queue immediately before blocking for input. --/// Events on this queue are async-safe, but they need the resolved state --/// of os_inchar(), so they are processed "just-in-time". +@@ -15,7 +15,7 @@ + /// HACK: os/input.c drains this queue immediately before blocking for input. + /// Events on this queue are async-safe, but they need the resolved state + /// of os_inchar(), so they are processed "just-in-time". -MultiQueue *ch_before_blocking_events; -- -- ++EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); + + #ifdef INCLUDE_GENERATED_DECLARATIONS - # include "msgpack_rpc/channel.h.generated.h" - #endif diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c -index c1580c5fc..3eacf6180 100644 +index c1580c5fc..b466b1bef 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c -@@ -28,6 +28,11 @@ - #define READ_BUFFER_SIZE 0xfff - #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) +@@ -1,6 +1,7 @@ + // This is an open source non-commercial project. Dear PVS-Studio, please check + // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -+/// HACK: os/input.c drains this queue immediately before blocking for input. -+/// Events on this queue are async-safe, but they need the resolved state -+/// of os_inchar(), so they are processed "just-in-time". -+MultiQueue *ch_before_blocking_events; -+ - typedef enum { - kInputNone, - kInputAvail, ++#define EXTERN + #include + #include + #include -- 2.25.0 -From 708a9f9354b1a619e9d185867b30808c675e96d2 Mon Sep 17 00:00:00 2001 +From 5471ef87c02fedf4b19870019e23da17e56a037f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 17:29:12 +0100 -Subject: [PATCH 5/5] nvim: Define channels as extern +Subject: [PATCH 5/7] nvim: Correctly setup global channels As gcc10 uses -fno-common by default, global variables declared with the same name more than once is not allowed anymore revealing this issue. @@ -202,11 +180,24 @@ We need to define it as extern to access it. See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 --- + src/nvim/channel.c | 1 - src/nvim/channel.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + 2 files changed, 1 insertion(+), 2 deletions(-) +diff --git a/src/nvim/channel.c b/src/nvim/channel.c +index c66a0682e..5eb29a729 100644 +--- a/src/nvim/channel.c ++++ b/src/nvim/channel.c +@@ -19,7 +19,6 @@ + #include "nvim/ascii.h" + + static bool did_stdio = false; +-PMap(uint64_t) *channels = NULL; + + /// next free id for a job or rpc channel + /// 1 is reserved for stdio channel diff --git a/src/nvim/channel.h b/src/nvim/channel.h -index c733e276b..91e75d411 100644 +index c733e276b..9d26852ce 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -85,7 +85,7 @@ struct Channel { @@ -214,10 +205,94 @@ index c733e276b..91e75d411 100644 }; -EXTERN PMap(uint64_t) *channels; -+extern PMap(uint64_t) *channels; ++EXTERN PMap(uint64_t) *channels INIT(= NULL); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "channel.h.generated.h" -- 2.25.0 + +From c04cf8ab059aeddc9bc74415bceb6d9de6948dcd Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 19:06:47 +0100 +Subject: [PATCH 6/7] nvim:os: Include ui.h and channel.h we define EXTERN + +If we define EXTERN as an emtpy macro we would duplicate the globals. +--- + src/nvim/os/input.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c +index b466b1bef..cc551d104 100644 +--- a/src/nvim/os/input.c ++++ b/src/nvim/os/input.c +@@ -1,20 +1,24 @@ + // This is an open source non-commercial project. Dear PVS-Studio, please check + // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + +-#define EXTERN + #include + #include + #include + + #include + ++// This needs to be included before we define EXTERN ++#include "nvim/ui.h" ++#include "nvim/msgpack_rpc/channel.h" ++ ++#undef EXTERN ++#define EXTERN + #include "nvim/api/private/defs.h" + #include "nvim/os/input.h" + #include "nvim/event/loop.h" + #include "nvim/event/rstream.h" + #include "nvim/ascii.h" + #include "nvim/vim.h" +-#include "nvim/ui.h" + #include "nvim/memory.h" + #include "nvim/keymap.h" + #include "nvim/mbyte.h" +@@ -24,7 +28,6 @@ + #include "nvim/main.h" + #include "nvim/misc1.h" + #include "nvim/state.h" +-#include "nvim/msgpack_rpc/channel.h" + + #define READ_BUFFER_SIZE 0xfff + #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) +-- +2.25.0 + + +From 4ebbca53cfdba5313f86477c00536fd47993bfbb Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 18:04:01 +0100 +Subject: [PATCH 7/7] cmake: Check for -fno-common and use it if available + +--- + CMakeLists.txt | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index de530bb4f..7c237781c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -306,6 +306,13 @@ if(UNIX) + add_compile_options(-fstack-protector --param ssp-buffer-size=4) + link_libraries(-fstack-protector --param ssp-buffer-size=4) + endif() ++ ++ check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) ++ if (HAVE_FNO_COMMON) ++ add_compile_options(-fno-common) ++ endif() ++endif() ++ + endif() + + check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) +-- +2.25.0 + diff --git a/neovim.spec b/neovim.spec index 0a11e29..307834c 100644 --- a/neovim.spec +++ b/neovim.spec @@ -13,7 +13,7 @@ Name: neovim Version: 0.4.3 -Release: 3%{?dist} +Release: 4%{?dist} License: ASL 2.0 Summary: Vim-fork focused on extensibility and agility @@ -1592,6 +1592,9 @@ install -m0644 runtime/nvim.png %{buildroot}%{_datadir}/pixmaps/nvim.png %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Mon Feb 17 2020 Andreas Schneider - 0.4.3-4 +- Update patchset for -fno-common + * Mon Feb 17 2020 Andreas Schneider - 0.4.3-3 - resolves: #1799680 - Fix -fno-common issues From 447876641abbeaf543fbabfe61ff17da62118f8d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 19:43:57 +0100 Subject: [PATCH 3/5] Apply backported quilt patch --- neovim-0.4.3-fix-fno-common.patch | 251 +++++++----------------------- 1 file changed, 54 insertions(+), 197 deletions(-) diff --git a/neovim-0.4.3-fix-fno-common.patch b/neovim-0.4.3-fix-fno-common.patch index ecbe087..145ad27 100644 --- a/neovim-0.4.3-fix-fno-common.patch +++ b/neovim-0.4.3-fix-fno-common.patch @@ -1,24 +1,13 @@ -From 2a96bc336a86b5178019e9f4880f00e65f1e9b11 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:33:55 +0100 -Subject: [PATCH 1/7] nvim:eval: Fix enum declaration for ListLenSpecials +Patches backported from https://github.com/neovim/neovim/pull/11890 -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 --- src/nvim/eval/typval.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h -index 008453b87..5afdedff7 100644 ---- a/src/nvim/eval/typval.h -+++ b/src/nvim/eval/typval.h +Index: neovim-0.4.3/src/nvim/eval/typval.h +=================================================================== +--- neovim-0.4.3.orig/src/nvim/eval/typval.h ++++ neovim-0.4.3/src/nvim/eval/typval.h @@ -33,7 +33,7 @@ typedef double float_T; enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; @@ -37,31 +26,10 @@ index 008453b87..5afdedff7 100644 /// Maximal possible value of varnumber_T variable #define VARNUMBER_MAX INT64_MAX --- -2.25.0 - - -From 1ff3e86b44204e15e07e152f353e389bd72836d7 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 17:17:37 +0100 -Subject: [PATCH 2/7] nvim:viml: Fix enum declaration of ExprParserFlags - -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/viml/parser/expressions.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h -index 23e172da7..838a74227 100644 ---- a/src/nvim/viml/parser/expressions.h -+++ b/src/nvim/viml/parser/expressions.h +Index: neovim-0.4.3/src/nvim/viml/parser/expressions.h +=================================================================== +--- neovim-0.4.3.orig/src/nvim/viml/parser/expressions.h ++++ neovim-0.4.3/src/nvim/viml/parser/expressions.h @@ -326,7 +326,7 @@ struct expr_ast_node { } data; }; @@ -80,31 +48,10 @@ index 23e172da7..838a74227 100644 /// AST error definition typedef struct { --- -2.25.0 - - -From 400111a478b9f522ee98f06bda4660226961806f Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:36:21 +0100 -Subject: [PATCH 3/7] nvim: Fix enum declaration of RemapValues - -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/getchar.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h -index 01f60ccf4..f0b52079a 100644 ---- a/src/nvim/getchar.h -+++ b/src/nvim/getchar.h +Index: neovim-0.4.3/src/nvim/getchar.h +=================================================================== +--- neovim-0.4.3.orig/src/nvim/getchar.h ++++ neovim-0.4.3/src/nvim/getchar.h @@ -10,12 +10,12 @@ /// Values for "noremap" argument of ins_typebuf() /// @@ -120,29 +67,10 @@ index 01f60ccf4..f0b52079a 100644 // Argument for flush_buffers(). typedef enum { --- -2.25.0 - - -From f870d61a336756a71e719f89752be796fcee45ea Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:40:37 +0100 -Subject: [PATCH 4/7] nvim:msgpack: Correctly set up global - ch_before_blocking_events - -gcc10 builds with -fno-common by default. This mean you can't define -a global variable with the same name twice. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/msgpack_rpc/channel.h | 2 +- - src/nvim/os/input.c | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h -index 9ff5abdc5..90e1c7d48 100644 ---- a/src/nvim/msgpack_rpc/channel.h -+++ b/src/nvim/msgpack_rpc/channel.h +Index: neovim-0.4.3/src/nvim/msgpack_rpc/channel.h +=================================================================== +--- neovim-0.4.3.orig/src/nvim/msgpack_rpc/channel.h ++++ neovim-0.4.3/src/nvim/msgpack_rpc/channel.h @@ -15,7 +15,7 @@ /// HACK: os/input.c drains this queue immediately before blocking for input. /// Events on this queue are async-safe, but they need the resolved state @@ -152,89 +80,11 @@ index 9ff5abdc5..90e1c7d48 100644 #ifdef INCLUDE_GENERATED_DECLARATIONS -diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c -index c1580c5fc..b466b1bef 100644 ---- a/src/nvim/os/input.c -+++ b/src/nvim/os/input.c -@@ -1,6 +1,7 @@ - // This is an open source non-commercial project. Dear PVS-Studio, please check - // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - -+#define EXTERN - #include - #include - #include --- -2.25.0 - - -From 5471ef87c02fedf4b19870019e23da17e56a037f Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 17:29:12 +0100 -Subject: [PATCH 5/7] nvim: Correctly setup global channels - -As gcc10 uses -fno-common by default, global variables declared with the -same name more than once is not allowed anymore revealing this issue. - -We need to define it as extern to access it. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/channel.c | 1 - - src/nvim/channel.h | 2 +- - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/nvim/channel.c b/src/nvim/channel.c -index c66a0682e..5eb29a729 100644 ---- a/src/nvim/channel.c -+++ b/src/nvim/channel.c -@@ -19,7 +19,6 @@ - #include "nvim/ascii.h" - - static bool did_stdio = false; --PMap(uint64_t) *channels = NULL; - - /// next free id for a job or rpc channel - /// 1 is reserved for stdio channel -diff --git a/src/nvim/channel.h b/src/nvim/channel.h -index c733e276b..9d26852ce 100644 ---- a/src/nvim/channel.h -+++ b/src/nvim/channel.h -@@ -85,7 +85,7 @@ struct Channel { - bool callback_scheduled; - }; - --EXTERN PMap(uint64_t) *channels; -+EXTERN PMap(uint64_t) *channels INIT(= NULL); - - #ifdef INCLUDE_GENERATED_DECLARATIONS - # include "channel.h.generated.h" --- -2.25.0 - - -From c04cf8ab059aeddc9bc74415bceb6d9de6948dcd Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 19:06:47 +0100 -Subject: [PATCH 6/7] nvim:os: Include ui.h and channel.h we define EXTERN - -If we define EXTERN as an emtpy macro we would duplicate the globals. ---- - src/nvim/os/input.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c -index b466b1bef..cc551d104 100644 ---- a/src/nvim/os/input.c -+++ b/src/nvim/os/input.c -@@ -1,20 +1,24 @@ - // This is an open source non-commercial project. Dear PVS-Studio, please check - // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - --#define EXTERN - #include - #include - #include +Index: neovim-0.4.3/src/nvim/os/input.c +=================================================================== +--- neovim-0.4.3.orig/src/nvim/os/input.c ++++ neovim-0.4.3/src/nvim/os/input.c +@@ -7,13 +7,18 @@ #include @@ -254,7 +104,7 @@ index b466b1bef..cc551d104 100644 #include "nvim/memory.h" #include "nvim/keymap.h" #include "nvim/mbyte.h" -@@ -24,7 +28,6 @@ +@@ -23,7 +28,6 @@ #include "nvim/main.h" #include "nvim/misc1.h" #include "nvim/state.h" @@ -262,37 +112,44 @@ index b466b1bef..cc551d104 100644 #define READ_BUFFER_SIZE 0xfff #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) --- -2.25.0 - - -From 4ebbca53cfdba5313f86477c00536fd47993bfbb Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 18:04:01 +0100 -Subject: [PATCH 7/7] cmake: Check for -fno-common and use it if available - ---- - CMakeLists.txt | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index de530bb4f..7c237781c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -306,6 +306,13 @@ if(UNIX) +Index: neovim-0.4.3/src/nvim/channel.c +=================================================================== +--- neovim-0.4.3.orig/src/nvim/channel.c ++++ neovim-0.4.3/src/nvim/channel.c +@@ -15,7 +15,6 @@ + #include "nvim/ascii.h" + + static bool did_stdio = false; +-PMap(uint64_t) *channels = NULL; + + /// next free id for a job or rpc channel + /// 1 is reserved for stdio channel +Index: neovim-0.4.3/src/nvim/channel.h +=================================================================== +--- neovim-0.4.3.orig/src/nvim/channel.h ++++ neovim-0.4.3/src/nvim/channel.h +@@ -85,7 +85,7 @@ struct Channel { + bool callback_scheduled; + }; + +-EXTERN PMap(uint64_t) *channels; ++EXTERN PMap(uint64_t) *channels INIT(= NULL); + + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "channel.h.generated.h" +Index: neovim-0.4.3/CMakeLists.txt +=================================================================== +--- neovim-0.4.3.orig/CMakeLists.txt ++++ neovim-0.4.3/CMakeLists.txt +@@ -312,6 +312,11 @@ if(UNIX) + elseif(HAS_FSTACK_PROTECTOR_FLAG) add_compile_options(-fstack-protector --param ssp-buffer-size=4) - link_libraries(-fstack-protector --param ssp-buffer-size=4) endif() + + check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) + if (HAVE_FNO_COMMON) + add_compile_options(-fno-common) + endif() -+endif() -+ endif() check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) --- -2.25.0 - From f905df2e963201d632680137241a72a759230a42 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 23 Feb 2020 16:32:06 +0100 Subject: [PATCH 4/5] Update to upstream patchset for -fno-common --- 11890.patch | 225 ++++++++++++++++++++++++++++++ neovim-0.4.3-fix-fno-common.patch | 155 -------------------- neovim.spec | 7 +- 3 files changed, 230 insertions(+), 157 deletions(-) create mode 100644 11890.patch delete mode 100644 neovim-0.4.3-fix-fno-common.patch diff --git a/11890.patch b/11890.patch new file mode 100644 index 0000000..51c6269 --- /dev/null +++ b/11890.patch @@ -0,0 +1,225 @@ +From ebcde1de42588e697e0f4eaed9f6f0ea6a77a2cd Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:33:55 +0100 +Subject: [PATCH 1/6] nvim:eval: Fix enum declaration for ListLenSpecials + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/eval/typval.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h +index 008453b87f2..5afdedff751 100644 +--- a/src/nvim/eval/typval.h ++++ b/src/nvim/eval/typval.h +@@ -33,7 +33,7 @@ typedef double float_T; + enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; + + /// Additional values for tv_list_alloc() len argument +-enum { ++enum ListLenSpecials { + /// List length is not known in advance + /// + /// To be used when there is neither a way to know how many elements will be +@@ -49,7 +49,7 @@ enum { + /// + /// To be used when it looks impractical to determine list length. + kListLenMayKnow = -3, +-} ListLenSpecials; ++}; + + /// Maximal possible value of varnumber_T variable + #define VARNUMBER_MAX INT64_MAX + +From b87b4a61476bb65e9200bd2ee93b8a98ca4db84e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:17:37 +0100 +Subject: [PATCH 2/6] nvim:viml: Fix enum declaration of ExprParserFlags + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/viml/parser/expressions.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h +index 23e172da75b..838a7422718 100644 +--- a/src/nvim/viml/parser/expressions.h ++++ b/src/nvim/viml/parser/expressions.h +@@ -326,7 +326,7 @@ struct expr_ast_node { + } data; + }; + +-enum { ++enum ExprParserFlags { + /// Allow multiple expressions in a row: e.g. for :echo + /// + /// Parser will still parse only one of them though. +@@ -345,7 +345,7 @@ enum { + // viml_expressions_parser.c, nvim_parse_expression() flags parsing + // alongside with its documentation and flag sets in check_parsing() + // function in expressions parser functional and unit tests. +-} ExprParserFlags; ++}; + + /// AST error definition + typedef struct { + +From 986db1adb491b5cb5936d2369816236847af26da Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:36:21 +0100 +Subject: [PATCH 3/6] nvim: Fix enum declaration of RemapValues + +Instead of declaring an enum, this creates a global variable. As gcc10 +uses -fno-common by default, global variables declared with the same +name more than once is not allowed anymore revealing this issue. + +Each time this header is included, we define the enum name as a global +variable. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/getchar.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h +index 01f60ccf494..f0b52079aad 100644 +--- a/src/nvim/getchar.h ++++ b/src/nvim/getchar.h +@@ -10,12 +10,12 @@ + /// Values for "noremap" argument of ins_typebuf() + /// + /// Also used for map->m_noremap and menu->noremap[]. +-enum { ++enum RemapValues { + REMAP_YES = 0, ///< Allow remapping. + REMAP_NONE = -1, ///< No remapping. + REMAP_SCRIPT = -2, ///< Remap script-local mappings only. + REMAP_SKIP = -3, ///< No remapping for first char. +-} RemapValues; ++}; + + // Argument for flush_buffers(). + typedef enum { + +From 517bf15603aba37014b62553eb008e26f2a1db48 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 16:40:37 +0100 +Subject: [PATCH 4/6] nvim:msgpack: Correctly set up global + ch_before_blocking_events + +gcc10 builds with -fno-common by default. This mean you can't define +a global variable with the same name twice. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/msgpack_rpc/channel.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h +index 9ff5abdc5f5..90e1c7d48b4 100644 +--- a/src/nvim/msgpack_rpc/channel.h ++++ b/src/nvim/msgpack_rpc/channel.h +@@ -15,7 +15,7 @@ + /// HACK: os/input.c drains this queue immediately before blocking for input. + /// Events on this queue are async-safe, but they need the resolved state + /// of os_inchar(), so they are processed "just-in-time". +-MultiQueue *ch_before_blocking_events; ++EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); + + + #ifdef INCLUDE_GENERATED_DECLARATIONS + +From 823b2104c3e579e8c3db8baab263dca0aa9d48bc Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 17:29:12 +0100 +Subject: [PATCH 5/6] nvim: Correctly setup global channels + +As gcc10 uses -fno-common by default, global variables declared with the +same name more than once is not allowed anymore revealing this issue. + +We need to define it as extern to access it. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 +--- + src/nvim/channel.c | 1 - + src/nvim/channel.h | 2 +- + src/nvim/main.c | 1 + + 3 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/channel.c b/src/nvim/channel.c +index c66a0682e35..5eb29a7290c 100644 +--- a/src/nvim/channel.c ++++ b/src/nvim/channel.c +@@ -19,7 +19,6 @@ + #include "nvim/ascii.h" + + static bool did_stdio = false; +-PMap(uint64_t) *channels = NULL; + + /// next free id for a job or rpc channel + /// 1 is reserved for stdio channel +diff --git a/src/nvim/channel.h b/src/nvim/channel.h +index c733e276bef..9d26852ce53 100644 +--- a/src/nvim/channel.h ++++ b/src/nvim/channel.h +@@ -85,7 +85,7 @@ struct Channel { + bool callback_scheduled; + }; + +-EXTERN PMap(uint64_t) *channels; ++EXTERN PMap(uint64_t) *channels INIT(= NULL); + + #ifdef INCLUDE_GENERATED_DECLARATIONS + # include "channel.h.generated.h" +diff --git a/src/nvim/main.c b/src/nvim/main.c +index 56d9030a7f4..4a9f2371a29 100644 +--- a/src/nvim/main.c ++++ b/src/nvim/main.c +@@ -10,6 +10,7 @@ + #include + + #include "nvim/ascii.h" ++#include "nvim/channel.h" + #include "nvim/vim.h" + #include "nvim/main.h" + #include "nvim/aucmd.h" + +From 0504f2f88dac9a4cf1fe1052a1e00ab203e9cf8e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 17 Feb 2020 18:04:01 +0100 +Subject: [PATCH 6/6] cmake: Check for -fno-common and use it if available + +--- + CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index de530bb4f7d..74e161d9890 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -308,6 +308,11 @@ if(UNIX) + endif() + endif() + ++check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) ++if (HAVE_FNO_COMMON) ++ add_compile_options(-fno-common) ++endif() ++ + check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) + if(HAS_DIAG_COLOR_FLAG) + if(CMAKE_GENERATOR MATCHES "Ninja") diff --git a/neovim-0.4.3-fix-fno-common.patch b/neovim-0.4.3-fix-fno-common.patch deleted file mode 100644 index 145ad27..0000000 --- a/neovim-0.4.3-fix-fno-common.patch +++ /dev/null @@ -1,155 +0,0 @@ -Patches backported from https://github.com/neovim/neovim/pull/11890 - ---- - src/nvim/eval/typval.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: neovim-0.4.3/src/nvim/eval/typval.h -=================================================================== ---- neovim-0.4.3.orig/src/nvim/eval/typval.h -+++ neovim-0.4.3/src/nvim/eval/typval.h -@@ -33,7 +33,7 @@ typedef double float_T; - enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; - - /// Additional values for tv_list_alloc() len argument --enum { -+enum ListLenSpecials { - /// List length is not known in advance - /// - /// To be used when there is neither a way to know how many elements will be -@@ -49,7 +49,7 @@ enum { - /// - /// To be used when it looks impractical to determine list length. - kListLenMayKnow = -3, --} ListLenSpecials; -+}; - - /// Maximal possible value of varnumber_T variable - #define VARNUMBER_MAX INT64_MAX -Index: neovim-0.4.3/src/nvim/viml/parser/expressions.h -=================================================================== ---- neovim-0.4.3.orig/src/nvim/viml/parser/expressions.h -+++ neovim-0.4.3/src/nvim/viml/parser/expressions.h -@@ -326,7 +326,7 @@ struct expr_ast_node { - } data; - }; - --enum { -+enum ExprParserFlags { - /// Allow multiple expressions in a row: e.g. for :echo - /// - /// Parser will still parse only one of them though. -@@ -345,7 +345,7 @@ enum { - // viml_expressions_parser.c, nvim_parse_expression() flags parsing - // alongside with its documentation and flag sets in check_parsing() - // function in expressions parser functional and unit tests. --} ExprParserFlags; -+}; - - /// AST error definition - typedef struct { -Index: neovim-0.4.3/src/nvim/getchar.h -=================================================================== ---- neovim-0.4.3.orig/src/nvim/getchar.h -+++ neovim-0.4.3/src/nvim/getchar.h -@@ -10,12 +10,12 @@ - /// Values for "noremap" argument of ins_typebuf() - /// - /// Also used for map->m_noremap and menu->noremap[]. --enum { -+enum RemapValues { - REMAP_YES = 0, ///< Allow remapping. - REMAP_NONE = -1, ///< No remapping. - REMAP_SCRIPT = -2, ///< Remap script-local mappings only. - REMAP_SKIP = -3, ///< No remapping for first char. --} RemapValues; -+}; - - // Argument for flush_buffers(). - typedef enum { -Index: neovim-0.4.3/src/nvim/msgpack_rpc/channel.h -=================================================================== ---- neovim-0.4.3.orig/src/nvim/msgpack_rpc/channel.h -+++ neovim-0.4.3/src/nvim/msgpack_rpc/channel.h -@@ -15,7 +15,7 @@ - /// HACK: os/input.c drains this queue immediately before blocking for input. - /// Events on this queue are async-safe, but they need the resolved state - /// of os_inchar(), so they are processed "just-in-time". --MultiQueue *ch_before_blocking_events; -+EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); - - - #ifdef INCLUDE_GENERATED_DECLARATIONS -Index: neovim-0.4.3/src/nvim/os/input.c -=================================================================== ---- neovim-0.4.3.orig/src/nvim/os/input.c -+++ neovim-0.4.3/src/nvim/os/input.c -@@ -7,13 +7,18 @@ - - #include - -+// This needs to be included before we define EXTERN -+#include "nvim/ui.h" -+#include "nvim/msgpack_rpc/channel.h" -+ -+#undef EXTERN -+#define EXTERN - #include "nvim/api/private/defs.h" - #include "nvim/os/input.h" - #include "nvim/event/loop.h" - #include "nvim/event/rstream.h" - #include "nvim/ascii.h" - #include "nvim/vim.h" --#include "nvim/ui.h" - #include "nvim/memory.h" - #include "nvim/keymap.h" - #include "nvim/mbyte.h" -@@ -23,7 +28,6 @@ - #include "nvim/main.h" - #include "nvim/misc1.h" - #include "nvim/state.h" --#include "nvim/msgpack_rpc/channel.h" - - #define READ_BUFFER_SIZE 0xfff - #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) -Index: neovim-0.4.3/src/nvim/channel.c -=================================================================== ---- neovim-0.4.3.orig/src/nvim/channel.c -+++ neovim-0.4.3/src/nvim/channel.c -@@ -15,7 +15,6 @@ - #include "nvim/ascii.h" - - static bool did_stdio = false; --PMap(uint64_t) *channels = NULL; - - /// next free id for a job or rpc channel - /// 1 is reserved for stdio channel -Index: neovim-0.4.3/src/nvim/channel.h -=================================================================== ---- neovim-0.4.3.orig/src/nvim/channel.h -+++ neovim-0.4.3/src/nvim/channel.h -@@ -85,7 +85,7 @@ struct Channel { - bool callback_scheduled; - }; - --EXTERN PMap(uint64_t) *channels; -+EXTERN PMap(uint64_t) *channels INIT(= NULL); - - #ifdef INCLUDE_GENERATED_DECLARATIONS - # include "channel.h.generated.h" -Index: neovim-0.4.3/CMakeLists.txt -=================================================================== ---- neovim-0.4.3.orig/CMakeLists.txt -+++ neovim-0.4.3/CMakeLists.txt -@@ -312,6 +312,11 @@ if(UNIX) - elseif(HAS_FSTACK_PROTECTOR_FLAG) - add_compile_options(-fstack-protector --param ssp-buffer-size=4) - endif() -+ -+ check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) -+ if (HAVE_FNO_COMMON) -+ add_compile_options(-fno-common) -+ endif() - endif() - - check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) diff --git a/neovim.spec b/neovim.spec index 307834c..164afb9 100644 --- a/neovim.spec +++ b/neovim.spec @@ -13,7 +13,7 @@ Name: neovim Version: 0.4.3 -Release: 4%{?dist} +Release: 5%{?dist} License: ASL 2.0 Summary: Vim-fork focused on extensibility and agility @@ -23,7 +23,7 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template -Patch0: neovim-0.4.3-fix-fno-common.patch +Patch0: https://patch-diff.githubusercontent.com/raw/neovim/neovim/pull/11890.patch Patch1000: neovim-0.1.7-bitop.patch @@ -1592,6 +1592,9 @@ install -m0644 runtime/nvim.png %{buildroot}%{_datadir}/pixmaps/nvim.png %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Sun Feb 23 2020 Andreas Schneider - 0.4.3-5 +- Update to upstream patchset for -fno-common + * Mon Feb 17 2020 Andreas Schneider - 0.4.3-4 - Update patchset for -fno-common From fd689959a773677ba0591cf166f8377d401aca94 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 5 Aug 2020 15:14:11 +0200 Subject: [PATCH 5/5] Update to version 0.4.4 --- .gitignore | 1 + 11890.patch | 225 ---------------------------------------------------- neovim.spec | 11 ++- sources | 2 +- 4 files changed, 7 insertions(+), 232 deletions(-) delete mode 100644 11890.patch diff --git a/.gitignore b/.gitignore index e62c006..3f75b39 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /neovim-0.3.8.tar.gz /neovim-0.4.2.tar.gz /neovim-0.4.3.tar.gz +/neovim-0.4.4.tar.gz diff --git a/11890.patch b/11890.patch deleted file mode 100644 index 51c6269..0000000 --- a/11890.patch +++ /dev/null @@ -1,225 +0,0 @@ -From ebcde1de42588e697e0f4eaed9f6f0ea6a77a2cd Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:33:55 +0100 -Subject: [PATCH 1/6] nvim:eval: Fix enum declaration for ListLenSpecials - -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/eval/typval.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h -index 008453b87f2..5afdedff751 100644 ---- a/src/nvim/eval/typval.h -+++ b/src/nvim/eval/typval.h -@@ -33,7 +33,7 @@ typedef double float_T; - enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; - - /// Additional values for tv_list_alloc() len argument --enum { -+enum ListLenSpecials { - /// List length is not known in advance - /// - /// To be used when there is neither a way to know how many elements will be -@@ -49,7 +49,7 @@ enum { - /// - /// To be used when it looks impractical to determine list length. - kListLenMayKnow = -3, --} ListLenSpecials; -+}; - - /// Maximal possible value of varnumber_T variable - #define VARNUMBER_MAX INT64_MAX - -From b87b4a61476bb65e9200bd2ee93b8a98ca4db84e Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 17:17:37 +0100 -Subject: [PATCH 2/6] nvim:viml: Fix enum declaration of ExprParserFlags - -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/viml/parser/expressions.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h -index 23e172da75b..838a7422718 100644 ---- a/src/nvim/viml/parser/expressions.h -+++ b/src/nvim/viml/parser/expressions.h -@@ -326,7 +326,7 @@ struct expr_ast_node { - } data; - }; - --enum { -+enum ExprParserFlags { - /// Allow multiple expressions in a row: e.g. for :echo - /// - /// Parser will still parse only one of them though. -@@ -345,7 +345,7 @@ enum { - // viml_expressions_parser.c, nvim_parse_expression() flags parsing - // alongside with its documentation and flag sets in check_parsing() - // function in expressions parser functional and unit tests. --} ExprParserFlags; -+}; - - /// AST error definition - typedef struct { - -From 986db1adb491b5cb5936d2369816236847af26da Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:36:21 +0100 -Subject: [PATCH 3/6] nvim: Fix enum declaration of RemapValues - -Instead of declaring an enum, this creates a global variable. As gcc10 -uses -fno-common by default, global variables declared with the same -name more than once is not allowed anymore revealing this issue. - -Each time this header is included, we define the enum name as a global -variable. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/getchar.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h -index 01f60ccf494..f0b52079aad 100644 ---- a/src/nvim/getchar.h -+++ b/src/nvim/getchar.h -@@ -10,12 +10,12 @@ - /// Values for "noremap" argument of ins_typebuf() - /// - /// Also used for map->m_noremap and menu->noremap[]. --enum { -+enum RemapValues { - REMAP_YES = 0, ///< Allow remapping. - REMAP_NONE = -1, ///< No remapping. - REMAP_SCRIPT = -2, ///< Remap script-local mappings only. - REMAP_SKIP = -3, ///< No remapping for first char. --} RemapValues; -+}; - - // Argument for flush_buffers(). - typedef enum { - -From 517bf15603aba37014b62553eb008e26f2a1db48 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 16:40:37 +0100 -Subject: [PATCH 4/6] nvim:msgpack: Correctly set up global - ch_before_blocking_events - -gcc10 builds with -fno-common by default. This mean you can't define -a global variable with the same name twice. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/msgpack_rpc/channel.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h -index 9ff5abdc5f5..90e1c7d48b4 100644 ---- a/src/nvim/msgpack_rpc/channel.h -+++ b/src/nvim/msgpack_rpc/channel.h -@@ -15,7 +15,7 @@ - /// HACK: os/input.c drains this queue immediately before blocking for input. - /// Events on this queue are async-safe, but they need the resolved state - /// of os_inchar(), so they are processed "just-in-time". --MultiQueue *ch_before_blocking_events; -+EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL); - - - #ifdef INCLUDE_GENERATED_DECLARATIONS - -From 823b2104c3e579e8c3db8baab263dca0aa9d48bc Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 17:29:12 +0100 -Subject: [PATCH 5/6] nvim: Correctly setup global channels - -As gcc10 uses -fno-common by default, global variables declared with the -same name more than once is not allowed anymore revealing this issue. - -We need to define it as extern to access it. - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 ---- - src/nvim/channel.c | 1 - - src/nvim/channel.h | 2 +- - src/nvim/main.c | 1 + - 3 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/channel.c b/src/nvim/channel.c -index c66a0682e35..5eb29a7290c 100644 ---- a/src/nvim/channel.c -+++ b/src/nvim/channel.c -@@ -19,7 +19,6 @@ - #include "nvim/ascii.h" - - static bool did_stdio = false; --PMap(uint64_t) *channels = NULL; - - /// next free id for a job or rpc channel - /// 1 is reserved for stdio channel -diff --git a/src/nvim/channel.h b/src/nvim/channel.h -index c733e276bef..9d26852ce53 100644 ---- a/src/nvim/channel.h -+++ b/src/nvim/channel.h -@@ -85,7 +85,7 @@ struct Channel { - bool callback_scheduled; - }; - --EXTERN PMap(uint64_t) *channels; -+EXTERN PMap(uint64_t) *channels INIT(= NULL); - - #ifdef INCLUDE_GENERATED_DECLARATIONS - # include "channel.h.generated.h" -diff --git a/src/nvim/main.c b/src/nvim/main.c -index 56d9030a7f4..4a9f2371a29 100644 ---- a/src/nvim/main.c -+++ b/src/nvim/main.c -@@ -10,6 +10,7 @@ - #include - - #include "nvim/ascii.h" -+#include "nvim/channel.h" - #include "nvim/vim.h" - #include "nvim/main.h" - #include "nvim/aucmd.h" - -From 0504f2f88dac9a4cf1fe1052a1e00ab203e9cf8e Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 17 Feb 2020 18:04:01 +0100 -Subject: [PATCH 6/6] cmake: Check for -fno-common and use it if available - ---- - CMakeLists.txt | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index de530bb4f7d..74e161d9890 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -308,6 +308,11 @@ if(UNIX) - endif() - endif() - -+check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) -+if (HAVE_FNO_COMMON) -+ add_compile_options(-fno-common) -+endif() -+ - check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) - if(HAS_DIAG_COLOR_FLAG) - if(CMAKE_GENERATOR MATCHES "Ninja") diff --git a/neovim.spec b/neovim.spec index 164afb9..221e4f7 100644 --- a/neovim.spec +++ b/neovim.spec @@ -12,8 +12,8 @@ %endif Name: neovim -Version: 0.4.3 -Release: 5%{?dist} +Version: 0.4.4 +Release: 1%{?dist} License: ASL 2.0 Summary: Vim-fork focused on extensibility and agility @@ -23,8 +23,6 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template -Patch0: https://patch-diff.githubusercontent.com/raw/neovim/neovim/pull/11890.patch - Patch1000: neovim-0.1.7-bitop.patch BuildRequires: gcc-c++ @@ -80,8 +78,6 @@ parts of Vim, without compromise, and more. %prep %setup -q -%patch0 -p1 - %if %{without luajit} %patch1000 -p1 -b .bitop %endif @@ -1592,6 +1588,9 @@ install -m0644 runtime/nvim.png %{buildroot}%{_datadir}/pixmaps/nvim.png %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Wed Aug 05 2020 Andreas Schneider - 0.4.4-1 +- resolves: #1769329 - Update to version 0.4.4 + * Sun Feb 23 2020 Andreas Schneider - 0.4.3-5 - Update to upstream patchset for -fno-common diff --git a/sources b/sources index f6cf3f7..81610b3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.4.3.tar.gz) = e13853fa296eda8618f389c71b6cbbd6f01d561615e80cc92959131dd10e395b1c6732a7d9ef6dbb9fe3ea9da4c11485b464547e2d46b22e59b8a20214e861f5 +SHA512 (neovim-0.4.4.tar.gz) = ca5c2fe1784ac7b0d2117948ba2e9ae5d94e36d22ff9e0967047e1e03e605537672d85543897af335103215ad462c86962f25267d352a77d61bc3d1cafb3c183