Skip to content

Commit 5634b80

Browse files
committed
git-extra: link executables as terminal server aware
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 git-for-windows/git#3935 Signed-off-by: Matthias Aßhauer <[email protected]>
1 parent fe3c9e3 commit 5634b80

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

git-extra/Makefile

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SRCDIR ?= .
33
WINDRES ?= windres
44
CFLAGS ?= -Wall
55
CXXFLAGS ?= -Wall
6+
LDFLAGS ?= -Wl,--tsaware
67

78
all: $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/WhoUses.exe \
89
$(BUILDDIR)/blocked-file-util.exe $(BUILDDIR)/proxy-lookup.exe \
@@ -11,7 +12,7 @@ all: $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/WhoUses.exe \
1112
$(BUILDDIR)/git-credential-helper-selector.exe
1213

1314
$(BUILDDIR)/create-shortcut.exe: $(BUILDDIR)/create-shortcut.o
14-
$(CC) $(CFLAGS) -o $@ $^ -luuid -lole32
15+
$(CC) $(CFLAGS) -o $(LDFLAGS) $@ $^ -luuid -lole32
1516

1617
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
1718
$(CC) -c $(CFLAGS) $< -o $@
@@ -20,7 +21,7 @@ $(BUILDDIR)/%.res: $(SRCDIR)/%.rc
2021
$(WINDRES) --input $< --output $@ --output-format coff
2122

2223
$(BUILDDIR)/WhoUses.exe: $(BUILDDIR)/WhoUses.o $(BUILDDIR)/SystemInfo.o
23-
$(CXX) $(CXXFLAGS) -o $@ $^
24+
$(CXX) $(CXXFLAGS) -o $(LDFLAGS) $@ $^
2425

2526
$(BUILDDIR)/WhoUses.o: $(SRCDIR)/WhoUses.cpp $(SRCDIR)/SystemInfo.h
2627
$(BUILDDIR)/SystemInfo.o: $(SRCDIR)/SystemInfo.cpp $(SRCDIR)/SystemInfo.h
@@ -29,31 +30,31 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
2930
$(CXX) -c $(CXXFLAGS) $< -o $@
3031

3132
$(BUILDDIR)/blocked-file-util.exe: $(BUILDDIR)/blocked-file-util.o
32-
$(CC) $(CFLAGS) -o $@ $^
33+
$(CC) $(CFLAGS) -o $(LDFLAGS) $@ $^
3334

3435
$(BUILDDIR)/proxy-lookup.o: CFLAGS += -DUNICODE
3536

3637
$(BUILDDIR)/proxy-lookup.exe: $(BUILDDIR)/proxy-lookup.o
37-
$(CC) -municode $(CFLAGS) -o $@ $^ -lshell32 -lwinhttp
38+
$(CC) -municode $(CFLAGS) -o $(LDFLAGS) $@ $^ -lshell32 -lwinhttp
3839

3940
$(BUILDDIR)/git-askyesno.o: CFLAGS += -DUNICODE
4041

4142
$(BUILDDIR)/git-askyesno.exe: $(BUILDDIR)/git-askyesno.o
42-
$(CC) -municode $(CFLAGS) -o $@ $^
43+
$(CC) -municode $(CFLAGS) -o $(LDFLAGS) $@ $^
4344

4445
$(BUILDDIR)/git-credential-helper-selector.o: CFLAGS += -DUNICODE
4546

4647
$(BUILDDIR)/git-credential-helper-selector.exe: \
4748
$(BUILDDIR)/git-credential-helper-selector.o \
4849
$(BUILDDIR)/git-credential-helper-selector.res
49-
$(CC) -municode $(CFLAGS) -o $@ $^ -lgdi32 -lcomctl32
50+
$(CC) -municode $(CFLAGS) -o $(LDFLAGS) $@ $^ -lgdi32 -lcomctl32
5051

5152
$(BUILDDIR)/git-askpass.o: CFLAGS += -DUNICODE
5253

5354
$(BUILDDIR)/git-askpass.exe: \
5455
$(BUILDDIR)/git-askpass.o \
5556
$(BUILDDIR)/git-askpass.res
56-
$(CC) -municode $(CFLAGS) -o $@ $^
57+
$(CC) -municode $(CFLAGS) -o $(LDFLAGS) $@ $^
5758
clean:
5859
$(RM) $(BUILDDIR)/create-shortcut.exe $(BUILDDIR)/create-shortcut.o
5960
$(RM) $(BUILDDIR)/WhoUses.exe $(BUILDDIR)/WhoUses.o \

git-extra/PKGBUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ sha256sums=('8ed76d1cb069ac8568f21c431f5e23caebea502d932ab4cdff71396f4f0d5b72'
6363
'3cd83627f1d20e1108533419fcf33c657cbcf777c3dc39fa7f13748b7d63858a'
6464
'd51229e5ec3653782a2c09aa5ad9af8f159aba94bc28498d7f358c33399b313d'
6565
'4716d520e7e6e0a1281bad1ae4c21e3e6442127c3030d27681162b9c40aa6b9d'
66-
'b551341275bfed94c902e5f820f4b2d0194c479ec477256790141e923c9e7bb0'
66+
'3d424aa12eb0c930835b55eb2d259750b3c79e4966fddbe30c976153fc724071'
6767
'd212e1bbe75a9f81443126701324c9c44c3ed5750dd9822eba754a1799ed13b3'
6868
'402c51eba82453a76f5110f4754bb1005df507a6e4532574c2b9627ff4e1dc81'
6969
'd9024bab283ebb67b5d39d49ee5d2592e170abf1f92d3db34edcdd7eeed0b6b9'

0 commit comments

Comments
 (0)