Skip to content

Commit b5a169f

Browse files
tyfkdagunan
authored andcommitted
Fix symbol duplication on Xcode/clang (tensorflow#4504)
Following linker error happened on Xcode: ``` duplicate symbol __Z14tf_git_versionv in: /Users/admin/tmp/tensorflow/tensorflow/contrib/ios_examples/simple/../../makefile/gen/lib/libtensorflow-core.a(version_info.o) duplicate symbol __Z19tf_compiler_versionv in: /Users/admin/tmp/tensorflow/tensorflow/contrib/ios_examples/simple/../../makefile/gen/lib/libtensorflow-core.a(version_info.o) ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` These functions are defined in `tensorflow/core/util/version_info.cc`. It seems an object file for it is added twice in Makefile: (`$(wildcard tensorflow/core/util/*.cc)` and `$(tensorflow/core/util/version_info.cc) `)
1 parent b73effb commit b5a169f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tensorflow/contrib/makefile/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ $(wildcard tensorflow/core/platform/*/*/*.cc) \
426426
$(wildcard tensorflow/core/util/*.cc) \
427427
$(wildcard tensorflow/core/util/*/*.cc) \
428428
tensorflow/core/util/version_info.cc
429+
# Remove duplicates (for version_info.cc)
430+
CORE_CC_ALL_SRCS := $(sort $(CORE_CC_ALL_SRCS))
429431
CORE_CC_EXCLUDE_SRCS := \
430432
$(wildcard tensorflow/core/*/*test.cc) \
431433
$(wildcard tensorflow/core/*/*testutil*) \

0 commit comments

Comments
 (0)