From c0b50458b95e33023a9d57cd78dae784ff4b5489 Mon Sep 17 00:00:00 2001 From: Harshil-Jani Date: Thu, 2 Feb 2023 03:51:37 +0000 Subject: [PATCH 1/2] mingw: remove duplicate `USE_NED_ALLOCATOR` directive nedalloc was added to fix the slowness of memory allocator. Here specifically for the MSys2 build there seems to be a duplication of USE_NED_ALLOCATOR directive. So this patch intends to remove the duplicate USE_NED_ALLOCATOR and keeping it only into the MSys2 config section so it still uses the nedalloc. Signed-off-by: Harshil-Jani Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.mak.uname | 1 - 1 file changed, 1 deletion(-) diff --git a/config.mak.uname b/config.mak.uname index d63629fe80..377667c4bb 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -652,7 +652,6 @@ ifeq ($(uname_S),MINGW) USE_WIN32_IPC = YesPlease USE_WIN32_MMAP = YesPlease MMAP_PREVENTS_DELETE = UnfortunatelyYes - USE_NED_ALLOCATOR = YesPlease UNRELIABLE_FSTAT = UnfortunatelyYes OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo NO_REGEX = YesPlease From 2987407f3c7eed909cc57b4d4a93260b0be7e29f Mon Sep 17 00:00:00 2001 From: Harshil-Jani Date: Thu, 2 Feb 2023 03:51:38 +0000 Subject: [PATCH 2/2] mingw: remove msysGit/MSYS1 support MSys has long fallen behind MSYS2 in features like Unicode or x86_64 support or even security bug fixes, and is therefore no longer used by anyone in the Git developer community. The Git for Windows project itself started switching from MSys to MSYS2 early in 2015, i.e. about eight years ago. Let's drop supporting MSys as a development platform. Signed-off-by: Harshil-Jani Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.mak.uname | 85 ++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 50 deletions(-) diff --git a/config.mak.uname b/config.mak.uname index 377667c4bb..965ec53083 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -623,6 +623,9 @@ ifeq ($(uname_S),NONSTOP_KERNEL) SHELL_PATH = /usr/coreutils/bin/bash endif ifeq ($(uname_S),MINGW) + ifeq ($(shell expr "$(uname_R)" : '1\.'),2) + $(error "Building with MSys is no longer supported") + endif pathsep = ; HAVE_ALLOCA_H = YesPlease NO_PREAD = YesPlease @@ -676,61 +679,43 @@ ifeq ($(uname_S),MINGW) RC = windres -O coff NATIVE_CRLF = YesPlease X = .exe -ifneq (,$(wildcard ../THIS_IS_MSYSGIT)) - htmldir = doc/git/html/ - prefix = + # MSys2 + prefix = /usr/ + # Enable DEP + BASIC_LDFLAGS += -Wl,--nxcompat + # Enable ASLR (unless debugging) + ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS)))) + BASIC_LDFLAGS += -Wl,--dynamicbase + endif + ifeq (MINGW32,$(MSYSTEM)) + prefix = /mingw32 + HOST_CPU = i686 + BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup + endif + ifeq (MINGW64,$(MSYSTEM)) + prefix = /mingw64 + HOST_CPU = x86_64 + BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup + else + COMPAT_CFLAGS += -D_USE_32BIT_TIME_T + BASIC_LDFLAGS += -Wl,--large-address-aware + endif + CC = gcc + COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \ + -fstack-protector-strong + EXTLIBS += -lntdll INSTALL = /bin/install - EXTLIBS += /mingw/lib/libz.a INTERNAL_QSORT = YesPlease HAVE_LIBCHARSET_H = YesPlease - NO_GETTEXT = YesPlease - NO_PYTHON = YesPlease - COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -else - ifneq ($(shell expr "$(uname_R)" : '1\.'),2) - # MSys2 - prefix = /usr/ - # Enable DEP - BASIC_LDFLAGS += -Wl,--nxcompat - # Enable ASLR (unless debugging) - ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS)))) - BASIC_LDFLAGS += -Wl,--dynamicbase - endif - ifeq (MINGW32,$(MSYSTEM)) - prefix = /mingw32 - HOST_CPU = i686 - BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup - endif - ifeq (MINGW64,$(MSYSTEM)) - prefix = /mingw64 - HOST_CPU = x86_64 - BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup - else - COMPAT_CFLAGS += -D_USE_32BIT_TIME_T - BASIC_LDFLAGS += -Wl,--large-address-aware - endif - CC = gcc - COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \ - -fstack-protector-strong - EXTLIBS += -lntdll - INSTALL = /bin/install - INTERNAL_QSORT = YesPlease - HAVE_LIBCHARSET_H = YesPlease - USE_GETTEXT_SCHEME = fallthrough - USE_LIBPCRE = YesPlease - USE_NED_ALLOCATOR = YesPlease - ifeq (/mingw64,$(subst 32,64,$(prefix))) - # Move system config into top-level /etc/ - ETC_GITCONFIG = ../etc/gitconfig - ETC_GITATTRIBUTES = ../etc/gitattributes - endif - else - COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO - NO_CURL = YesPlease - NO_PYTHON = YesPlease + USE_GETTEXT_SCHEME = fallthrough + USE_LIBPCRE = YesPlease + USE_NED_ALLOCATOR = YesPlease + ifeq (/mingw64,$(subst 32,64,$(prefix))) + # Move system config into top-level /etc/ + ETC_GITCONFIG = ../etc/gitconfig + ETC_GITATTRIBUTES = ../etc/gitattributes endif endif -endif ifeq ($(uname_S),QNX) COMPAT_CFLAGS += -DSA_RESTART=0 EXPAT_NEEDS_XMLPARSE_H = YesPlease