This is an archive of the discontinued LLVM Phabricator instance.

Fix linking of the refactor tweaks directory
Needs RevisionPublic

Authored by che666 on May 23 2019, 6:17 AM.

Details

Reviewers
sammccall
ilya-biryukov
Group Reviewers
Restricted Project
Summary

Currently it seems that the linked libs in CMakelists for the refactor tweaks directory is incomplete leading to:

FAILED: lib64/libclangDaemonTweaks.so.9svn
: && /usr/bin/c++ -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pedantic -Wno-long-long -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/builddir/build/BUILD/clang-r361395/_build/./lib64 -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,libclangDaemonTweaks.so.9svn -o lib64/libclangDaemonTweaks.so.9svn tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RawStringLiteral.cpp.o tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o lib64/libclangAST.so.9svn lib64/libclangDaemon.so.9svn lib64/libclangToolingCore.so.9svn /usr/lib64/libLLVM-9svn.so && :
/usr/bin/ld: tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RawStringLiteral.cpp.o: in function `clang::clangd::(anonymous namespace)::RawStringLiteral::prepare(clang::clangd::Tweak::Selection const&)':
/builddir/build/BUILD/clang-r361395/_build/../tools/extra/clangd/refactor/tweaks/RawStringLiteral.cpp:60: undefined reference to `clang::SourceManager::isBeforeInTranslationUnit(clang::SourceLocation, clang::SourceLocation) const'
/usr/bin/ld: /builddir/build/BUILD/clang-r361395/_build/../tools/extra/clangd/refactor/tweaks/RawStringLiteral.cpp:64: undefined reference to `clang::SourceManager::getCharacterData(clang::SourceLocation, bool*) const'
collect2: error: ld returned 1 exit status

The above patch fixes the problem.

Diff Detail

Event Timeline

che666 created this revision.May 23 2019, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2019, 6:17 AM
sammccall accepted this revision.May 23 2019, 6:35 AM
sammccall added a subscriber: sammccall.

Thank you!

This revision is now accepted and ready to land.May 23 2019, 6:35 AM
ilya-biryukov requested changes to this revision.May 23 2019, 6:46 AM

Thanks for the fix! A few nit-picky comments about the process, in case you'll be interested in sending more patches to LLVM.

Could you please upload the patch with full context and based on the upstream monorepo or svn repo (see instructions here)?
The current patch mentions clang-r361395 directory, it should normally be stripped.

This revision now requires changes to proceed.May 23 2019, 6:46 AM