build: move -lrt to a new SYS_LIBS variable
On some platforms, librt may be a static library, so linker command line order matters. Create a new Makefile variable, SYS_LIBS, which is added to the end of all link commands and move -lrt there. Change-Id: Ie28ebd91a255097bf33cbcf9f0f74f7177a0b142 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
0faa2948b5
commit
ce60297bda
@ -105,7 +105,9 @@ LDFLAGS += -fsanitize=address
|
||||
endif
|
||||
|
||||
COMMON_CFLAGS += -pthread
|
||||
LDFLAGS += -pthread -lrt
|
||||
LDFLAGS += -pthread
|
||||
|
||||
SYS_LIBS += -lrt
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
@ -127,11 +129,11 @@ COMPILE_CXX=\
|
||||
# Link $(OBJS) and $(LIBS) into $@ (app)
|
||||
LINK_C=\
|
||||
$(Q)echo " LINK $S/$@"; \
|
||||
$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
|
||||
$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(SYS_LIBS)
|
||||
|
||||
LINK_CXX=\
|
||||
$(Q)echo " LINK $S/$@"; \
|
||||
$(CXX) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
|
||||
$(CXX) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(SYS_LIBS)
|
||||
|
||||
# Archive $(OBJS) into $@ (.a)
|
||||
LIB_C=\
|
||||
|
Loading…
Reference in New Issue
Block a user