Link all libraries when building shared libraries

Summary:
The motivation is here: http://stackoverflow.com/questions/30706348/rocksdb-make-error

Apparently there is a bug (?) in g++ where we don't link rt library properly when building RocksDB's shared library. It looks like this works when we add an option -Wl, --no-as-needed.

Test Plan: make shared_lib

Reviewers: meyering, sdong, yhchiang

Reviewed By: yhchiang

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D39681
main
Igor Canadi 10 years ago
parent 75222d130e
commit d03f110904
  1. 3
      Makefile

@ -345,7 +345,8 @@ $(SHARED3): $(SHARED4)
endif endif
$(SHARED4): $(SHARED4):
$(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED3) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(LIB_SOURCES) $(LDFLAGS) -o $@ $(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED3) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(LIB_SOURCES) \
-Wl,--no-as-needed $(LDFLAGS) -o $@
endif # PLATFORM_SHARED_EXT endif # PLATFORM_SHARED_EXT

Loading…
Cancel
Save