Compare

e0e94ccedd7bfcc64d0d91008d85b88074e70a89..f243cc38dfebd4f3aee2e82136d56e22552fd523

mingw: avoid over-specifying `--pic-executable`

In bf2d5d8239e (Don't let ld strip relocations, 2016-01-16) (picked from
https://github.com/git-for-windows/git/pull/612/commits/6a237925bf10),
Git for Windows introduced the `-Wl,-pic-executable` flag, specifying
the exact entry point via `-e`. This required discerning between i686
and x86_64 code because the former required the symbol to be prefixed
with an underscore, the latter did not.

As per https://sourceware.org/bugzilla/show_bug.cgi?id=10865, the
specified symbols are already the default, though.

So let's drop the overly-specific definition.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin <johannes.schindelin@gmx.de> · 2026-09-10 06:05 UTC · committed by Junio C Hamano

Browse files
1 file changed, +4 −7
modified config.mak.uname
@@ -757,19 +757,16 @@ ifeq ($(uname_S),MINGW)
757 757 ifeq (MINGW32,$(MSYSTEM))
758 758 prefix = /mingw32
759 759 HOST_CPU = i686
760 - BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
761 - endif
762 - ifeq (MINGW64,$(MSYSTEM))
760 + BASIC_LDFLAGS += -Wl,--pic-executable -Wl,--large-address-aware
761 + else ifeq (MINGW64,$(MSYSTEM))
763 762 prefix = /mingw64
764 763 HOST_CPU = x86_64
765 - BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
764 + BASIC_LDFLAGS += -Wl,--pic-executable
766 765 else ifeq (CLANGARM64,$(MSYSTEM))
767 766 prefix = /clangarm64
768 767 HOST_CPU = aarch64
769 - BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
768 + BASIC_LDFLAGS += -Wl,--pic-executable
770 769 else
771 - COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
772 - BASIC_LDFLAGS += -Wl,--large-address-aware
773 770 endif
774 771 COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
775 772 -fstack-protector-strong