[PATCH] D81967: [clang-tools-extra] Prevent linking to duplicate .a libs and dylib

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 16 14:19:14 PDT 2020


mgorny created this revision.
mgorny added reviewers: alexfh, hokein, sammccall, ilya-biryukov, kadircet, ioeric, bkramer, aaron.ballman, klimek, juliehockett.
Herald added subscribers: sstefan1, phosek, usaxena95, lebedev.ri, arphaman, jkorous, kbarton, nemanjai.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: lebedev.ri.
mgorny added a comment.
Herald added a subscriber: wuzish.

For the record, this seems to trigger some command-line option parser problem:

  ******************** TEST 'Clang Tools :: clang-tidy/infrastructure/invalid-command-line.cpp' FAILED ********************                          
  Script:                                                                                                                                            
  --                                                                                                                                                 
  : 'RUN: at line 1';   not clang-tidy --invalid-arg 2>&1 | FileCheck /home/mgorny/git/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure$
  invalid-command-line.cpp                                                                                                                           
  --                                                                                                                                                 
  Exit Code: 1                                                                                                                                       
                                                                                                                                                     
  Command Output (stderr):                                                                                                                           
  --                                                                                                                                                 
  /home/mgorny/git/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/invalid-command-line.cpp:4:16: error: CHECK-NEXT: expected string no
  t found in input                                                                                                                                   
  // CHECK-NEXT: clang-tidy{{(\.exe)?}}: Did you mean '--extra-arg'?                                                                                 
                 ^                                                                                                                                   
  <stdin>:2:1: note: scanning from here                                                                                                              
  clang-tidy: Did you mean '--enable-pre'?                                                                                                           
  ^                                                                        
                                                                                                                                                     
  Input file: <stdin>                                                      
  Check file: /home/mgorny/git/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/invalid-command-line.cpp                                
                                                                                                                                                     
  -dump-input=help describes the format of the following dump.             
                                                                                                                                                     
  Full input was:                                                                                                                                    
  <<<<<<                                                                                                                                             
          1: error: [CommonOptionsParser]: clang-tidy: Unknown command line argument '--invalid-arg'. Try: 'clang-tidy --help'                       
          2: clang-tidy: Did you mean '--enable-pre'?                                                                                                
  next:4     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found                                                                          
  >>>>>>                                                                                                                                             

I'm going to investigate further tomorrow.


Fix various tool libraries not to link to clang's .a libraries and dylib
simultaneously.  This may cause breakage, in particular through
duplicate command-line option declarations.


https://reviews.llvm.org/D81967

Files:
  clang-tools-extra/clang-apply-replacements/CMakeLists.txt
  clang-tools-extra/clang-change-namespace/CMakeLists.txt
  clang-tools-extra/clang-doc/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/find-all-symbols/CMakeLists.txt
  clang-tools-extra/clang-move/CMakeLists.txt
  clang-tools-extra/clang-query/CMakeLists.txt
  clang-tools-extra/clang-reorder-fields/CMakeLists.txt
  clang-tools-extra/clang-tidy/CMakeLists.txt
  clang-tools-extra/clang-tidy/abseil/CMakeLists.txt
  clang-tools-extra/clang-tidy/android/CMakeLists.txt
  clang-tools-extra/clang-tidy/boost/CMakeLists.txt
  clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
  clang-tools-extra/clang-tidy/cert/CMakeLists.txt
  clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
  clang-tools-extra/clang-tidy/darwin/CMakeLists.txt
  clang-tools-extra/clang-tidy/fuchsia/CMakeLists.txt
  clang-tools-extra/clang-tidy/google/CMakeLists.txt
  clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt
  clang-tools-extra/clang-tidy/linuxkernel/CMakeLists.txt
  clang-tools-extra/clang-tidy/llvm/CMakeLists.txt
  clang-tools-extra/clang-tidy/llvmlibc/CMakeLists.txt
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
  clang-tools-extra/clang-tidy/mpi/CMakeLists.txt
  clang-tools-extra/clang-tidy/objc/CMakeLists.txt
  clang-tools-extra/clang-tidy/openmp/CMakeLists.txt
  clang-tools-extra/clang-tidy/performance/CMakeLists.txt
  clang-tools-extra/clang-tidy/plugin/CMakeLists.txt
  clang-tools-extra/clang-tidy/portability/CMakeLists.txt
  clang-tools-extra/clang-tidy/readability/CMakeLists.txt
  clang-tools-extra/clang-tidy/tool/CMakeLists.txt
  clang-tools-extra/clang-tidy/utils/CMakeLists.txt
  clang-tools-extra/clang-tidy/zircon/CMakeLists.txt
  clang-tools-extra/clangd/CMakeLists.txt
  clang-tools-extra/clangd/unittests/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81967.271193.patch
Type: text/x-patch
Size: 19021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200616/005031ec/attachment-0001.bin>


More information about the cfe-commits mailing list