From 60053bff48892212d854cdcdd1f3b1f9c72515e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= Date: Sun, 10 Jul 2022 12:20:43 +0200 Subject: [PATCH] git-extra: link executables as terminal server aware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Whith Windows 2000, Microsoft introduced a flag to the PE header to mark executables as "terminal server aware". Windows terminal servers provide a redirected Windows directory and redirected registry hives when launching legacy applications without this flag set. Since we do not use any INI files in the Windows directory and don't write to the registry, we don't need this additional preparation. Telling the OS that we don't need this should provide slightly improved startup times in terminal server environments. This partially addresses https://github.com/git-for-windows/git/issues/3935 Signed-off-by: Matthias Aßhauer --- git-extra/Makefile | 15 ++++++++------- git-extra/PKGBUILD | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/git-extra/Makefile b/git-extra/Makefile index 420866671b..092a80c788 100644 --- a/git-extra/Makefile +++ b/git-extra/Makefile @@ -3,6 +3,7 @@ SRCDIR ?= . WINDRES ?= windres CFLAGS ?= -Wall CXXFLAGS ?= -Wall +LDFLAGS = -Wl,--tsaware all: $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/WhoUses.exe \ $(BUILDDIR)/blocked-file-util.exe $(BUILDDIR)/proxy-lookup.exe \ @@ -11,7 +12,7 @@ all: $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/WhoUses.exe \ $(BUILDDIR)/git-credential-helper-selector.exe $(BUILDDIR)/create-shortcut.exe: $(BUILDDIR)/create-shortcut.o - $(CC) $(CFLAGS) -o $@ $^ -luuid -lole32 + $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $^ -luuid -lole32 $(BUILDDIR)/%.o: $(SRCDIR)/%.c $(CC) -c $(CFLAGS) $< -o $@ @@ -20,7 +21,7 @@ $(BUILDDIR)/%.res: $(SRCDIR)/%.rc $(WINDRES) --input $< --output $@ --output-format coff $(BUILDDIR)/WhoUses.exe: $(BUILDDIR)/WhoUses.o $(BUILDDIR)/SystemInfo.o - $(CXX) $(CXXFLAGS) -o $@ $^ + $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $^ $(BUILDDIR)/WhoUses.o: $(SRCDIR)/WhoUses.cpp $(SRCDIR)/SystemInfo.h $(BUILDDIR)/SystemInfo.o: $(SRCDIR)/SystemInfo.cpp $(SRCDIR)/SystemInfo.h @@ -29,31 +30,31 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(CXX) -c $(CXXFLAGS) $< -o $@ $(BUILDDIR)/blocked-file-util.exe: $(BUILDDIR)/blocked-file-util.o - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $^ $(BUILDDIR)/proxy-lookup.o: CFLAGS += -DUNICODE $(BUILDDIR)/proxy-lookup.exe: $(BUILDDIR)/proxy-lookup.o - $(CC) -municode $(CFLAGS) -o $@ $^ -lshell32 -lwinhttp + $(CC) -municode $(CFLAGS) -o $@ $(LDFLAGS) $^ -lshell32 -lwinhttp $(BUILDDIR)/git-askyesno.o: CFLAGS += -DUNICODE $(BUILDDIR)/git-askyesno.exe: $(BUILDDIR)/git-askyesno.o - $(CC) -municode $(CFLAGS) -o $@ $^ + $(CC) -municode $(CFLAGS) -o $@ $(LDFLAGS) $^ $(BUILDDIR)/git-credential-helper-selector.o: CFLAGS += -DUNICODE $(BUILDDIR)/git-credential-helper-selector.exe: \ $(BUILDDIR)/git-credential-helper-selector.o \ $(BUILDDIR)/git-credential-helper-selector.res - $(CC) -municode $(CFLAGS) -o $@ $^ -lgdi32 -lcomctl32 + $(CC) -municode $(CFLAGS) -o $@ $(LDFLAGS) $^ -lgdi32 -lcomctl32 $(BUILDDIR)/git-askpass.o: CFLAGS += -DUNICODE $(BUILDDIR)/git-askpass.exe: \ $(BUILDDIR)/git-askpass.o \ $(BUILDDIR)/git-askpass.res - $(CC) -municode $(CFLAGS) -o $@ $^ + $(CC) -municode $(CFLAGS) -o $@ $(LDFLAGS) $^ clean: $(RM) $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/create-shortcut.o $(RM) $(BUILDDIR)/WhoUses.exe $(BUILDDIR)/WhoUses.o \ diff --git a/git-extra/PKGBUILD b/git-extra/PKGBUILD index 6d96873032..d776a7cf7c 100644 --- a/git-extra/PKGBUILD +++ b/git-extra/PKGBUILD @@ -63,7 +63,7 @@ sha256sums=('8ed76d1cb069ac8568f21c431f5e23caebea502d932ab4cdff71396f4f0d5b72' '3cd83627f1d20e1108533419fcf33c657cbcf777c3dc39fa7f13748b7d63858a' 'd51229e5ec3653782a2c09aa5ad9af8f159aba94bc28498d7f358c33399b313d' '4716d520e7e6e0a1281bad1ae4c21e3e6442127c3030d27681162b9c40aa6b9d' - 'b551341275bfed94c902e5f820f4b2d0194c479ec477256790141e923c9e7bb0' + '937e25c096e0fa91f86f689a00a5bf5442c2333fbedab30239a935e682ae2e80' 'd212e1bbe75a9f81443126701324c9c44c3ed5750dd9822eba754a1799ed13b3' '402c51eba82453a76f5110f4754bb1005df507a6e4532574c2b9627ff4e1dc81' 'd9024bab283ebb67b5d39d49ee5d2592e170abf1f92d3db34edcdd7eeed0b6b9'