{"action":"created","issue":{"url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/16","labels_url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/16/comments","events_url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/16/events","html_url":"https://github.com/eliben/llvm-clang-samples/issues/16","id":69473618,"number":16,"title":"unresolved symbols when linking hello_pass.so ","user":{"login":"AntonBikineev","id":5951678,"avatar_url":"https://avatars.githubusercontent.com/u/5951678?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonBikineev","html_url":"https://github.com/AntonBikineev","followers_url":"https://api.github.com/users/AntonBikineev/followers","following_url":"https://api.github.com/users/AntonBikineev/following{/other_user}","gists_url":"https://api.github.com/users/AntonBikineev/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonBikineev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonBikineev/subscriptions","organizations_url":"https://api.github.com/users/AntonBikineev/orgs","repos_url":"https://api.github.com/users/AntonBikineev/repos","events_url":"https://api.github.com/users/AntonBikineev/events{/privacy}","received_events_url":"https://api.github.com/users/AntonBikineev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-19T23:07:29Z","updated_at":"2015-09-09T00:55:57Z","closed_at":null,"body":"```Undefined symbols for architecture x86_64:\r\n  \"llvm::raw_ostream::write_escaped(llvm::StringRef, bool)\", referenced from:\r\n      HelloFuncs::runOnFunction(llvm::Function&) in hello_pass-05c8d0.o\r\n  \"llvm::raw_ostream::write(char const*, unsigned long)\", referenced from:\r\n      llvm::raw_ostream::operator<<(llvm::StringRef) in hello_pass-05c8d0.o\r\n  \"llvm::raw_ostream::write(unsigned char)\", referenced from:\r\n      llvm::raw_ostream::operator<<(char) in hello_pass-05c8d0.o```\r\n\r\nI resolved it changing LLVM_LDFLAGS_NOLIBS to LLVM_LDFLAGS"},"comment":{"url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/comments/138742460","html_url":"https://github.com/eliben/llvm-clang-samples/issues/16#issuecomment-138742460","issue_url":"https://api.github.com/repos/eliben/llvm-clang-samples/issues/16","id":138742460,"user":{"login":"ob","id":4950,"avatar_url":"https://avatars.githubusercontent.com/u/4950?v=3","gravatar_id":"","url":"https://api.github.com/users/ob","html_url":"https://github.com/ob","followers_url":"https://api.github.com/users/ob/followers","following_url":"https://api.github.com/users/ob/following{/other_user}","gists_url":"https://api.github.com/users/ob/gists{/gist_id}","starred_url":"https://api.github.com/users/ob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ob/subscriptions","organizations_url":"https://api.github.com/users/ob/orgs","repos_url":"https://api.github.com/users/ob/repos","events_url":"https://api.github.com/users/ob/events{/privacy}","received_events_url":"https://api.github.com/users/ob/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T00:55:57Z","updated_at":"2015-09-09T00:55:57Z","body":"I have the same problem as @AntonBikineev. I also solved it the same way, by applying the following patch:\r\n\r\n```diff --git a/Makefile b/Makefile\r\nindex 7110840..c987686 100644\r\n--- a/Makefile\r\n+++ b/Makefile\r\n@@ -49,7 +49,7 @@ $(info -----------------------------------------------)\r\n # Note: starting with release 3.7, llvm-config will inject flags that gcc may\r\n # not support (for example '-Wcovered-switch-default'). If you run into this\r\n # problem, build with CXX set to a modern clang++ binary instead of g++.\r\n-CXX := g++\r\n+CXX := clang++\r\n CXXFLAGS := -fno-rtti -O0 -g\r\n PLUGIN_CXXFLAGS := -fpic\r\n\r\n@@ -158,7 +158,7 @@ $(BUILDDIR)/bb_toposort_sccs: $(SRC_LLVM_DIR)/bb_toposort_sccs.cpp\r\n\r\n $(BUILDDIR)/hello_pass.so: $(SRC_LLVM_DIR)/hello_pass.cpp\r\n        $(CXX) $(PLUGIN_CXXFLAGS) $(CXXFLAGS) $(LLVM_CXXFLAGS) \\\r\n-               $^ $(PLUGIN_LDFLAGS) $(LLVM_LDFLAGS_NOLIBS) -o $@\r\n+               $^ $(PLUGIN_LDFLAGS) $(LLVM_LDFLAGS) -o $@\r\n\r\n $(BUILDDIR)/clang-check: $(SRC_CLANG_DIR)/ClangCheck.cpp\r\n        $(CXX) $(CXXFLAGS) $(LLVM_CXXFLAGS) $(CLANG_INCLUDES) $^ \\```\r\n\r\nNot sure what that's about... but I can help debug. I'm on OS X Yosemite 10.10.5. I built llvm/clang as of today (from git) using ninja. "}}