[PATCH] D151066: [tools] Add explicit check for plugin-api.h

Dmitry Antipov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 01:40:05 PDT 2023


dmantipov created this revision.
Herald added a project: All.
dmantipov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When using regular (host) build environments (on RedHat and
alikes at least), LLVM_BINUTILS_INCDIR usually expands to
/usr/include, which is always present. Since plugin-api.h
comes from separate binutils-devel package, an absence of
the latter causes compilation error, which can be avoided
by adding explicit check for plugin-api.h.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151066

Files:
  llvm/tools/gold/CMakeLists.txt


Index: llvm/tools/gold/CMakeLists.txt
===================================================================
--- llvm/tools/gold/CMakeLists.txt
+++ llvm/tools/gold/CMakeLists.txt
@@ -3,6 +3,12 @@
 if( LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR )
   include_directories( ${LLVM_BINUTILS_INCDIR} )
 
+  find_path(PLUGIN_API_H plugin-api.h ${LLVM_BINUTILS_INCDIR})
+  if (NOT PLUGIN_API_H)
+    message(FATAL_ERROR "Can't find plugin-api.h in ${LLVM_BINUTILS_INCDIR}. "
+      "Make sure you have GNU binutils header files installed there.")
+  endif()
+
   set(LLVM_LINK_COMPONENTS
      ${LLVM_TARGETS_TO_BUILD}
      Linker


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151066.524194.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230522/c36e8541/attachment.bin>


More information about the llvm-commits mailing list