]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: make tc linking depend on libtc.a
authorDavid Michael <david.michael@coreos.com>
Tue, 3 Jan 2017 23:32:46 +0000 (15:32 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 9 Jan 2017 20:06:58 +0000 (12:06 -0800)
There was a race condition where the command to link the tc binary
could (rarely) run before the libtc.a archive existed.

tc/Makefile

index bb9011432ea10acf3d573181233218684f53a300..7fd0c4ad8f897ae82a64d0929efe74825b78c03d 100644 (file)
@@ -96,7 +96,7 @@ ifneq ($(TC_CONFIG_NO_XT),y)
 endif
 
 TCOBJ += $(TCMODULES)
-LDLIBS += -L. -ltc -lm
+LDLIBS += -L. -lm
 
 ifeq ($(SHARED_LIBS),y)
 LDLIBS += -ldl
@@ -124,13 +124,13 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
        $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic $< -o $@
 
 
-all: libtc.a tc $(TCSO)
+all: tc $(TCSO)
 
-tc: $(TCOBJ) $(TCLIB)
+tc: $(TCOBJ) libtc.a
        $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 libtc.a: $(TCLIB)
-       $(QUIET_AR)$(AR) rcs $@ $(TCLIB)
+       $(QUIET_AR)$(AR) rcs $@ $^
 
 install: all
        mkdir -p $(MODDESTDIR)