Skip to content

Commit 6ffaecc

Browse files
committed
shell: do not play duplicated definition games to shrink the executable
Playing with linker games to shrink git-shell did not go well with various other platforms and compilers. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d2b9dff commit 6ffaecc

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ endif
333333
export PERL_PATH
334334

335335
LIB_FILE=libgit.a
336-
COMPAT_LIB = compat/lib.a
337336
XDIFF_LIB=xdiff/lib.a
338337

339338
LIB_H += archive.h
@@ -1224,12 +1223,6 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
12241223
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
12251224
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
12261225

1227-
$(COMPAT_LIB): $(COMPAT_OBJS)
1228-
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(COMPAT_OBJS)
1229-
1230-
git-shell$X: abspath.o ctype.o exec_cmd.o quote.o strbuf.o usage.o wrapper.o shell.o $(COMPAT_LIB)
1231-
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(COMPAT_LIB)
1232-
12331226
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
12341227
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
12351228
builtin-revert.o wt-status.o: wt-status.h
@@ -1442,7 +1435,7 @@ distclean: clean
14421435

14431436
clean:
14441437
$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
1445-
$(LIB_FILE) $(XDIFF_LIB) $(COMPAT_LIB)
1438+
$(LIB_FILE) $(XDIFF_LIB)
14461439
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
14471440
$(RM) $(TEST_PROGRAMS)
14481441
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*

shell.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
#include "exec_cmd.h"
44
#include "strbuf.h"
55

6-
/* Stubs for functions that make no sense for git-shell. These stubs
7-
* are provided here to avoid linking in external redundant modules.
8-
*/
9-
void release_pack_memory(size_t need, int fd){}
10-
void trace_argv_printf(const char **argv, const char *fmt, ...){}
11-
void trace_printf(const char *fmt, ...){}
12-
13-
146
static int do_generic_cmd(const char *me, char *arg)
157
{
168
const char *my_argv[4];

0 commit comments

Comments
 (0)