[llvm] Add llvm-dlltool to the toolchain list (PR #72563)

Matheus Izvekov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 12:09:33 PST 2023


https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/72563

This adds dlltool to the list of tools which don't get excluded from installation when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

The most important effect here is that this tool will now be included in the official Windows release.

While llvm-lib reuses the dlltool machinary internally and has many of the same capabilities, it does not expose the functionality controller by the '-k' flag, which is currently the only way to create import libraries for i386 with stdcall symbols from a module definition alone.

We avoid changing llvm-lib tool, since it is designed to emulate LIB.EXE from MSVC toolchain, and as this functionality is not supported there, we would have had to introduce an LLVM extension flag in order to support it.

See https://reviews.llvm.org/D36548 for reference on rationale for dlltool '-k' flag.

>From 7394df329b04817099f1fd0b1e7d5b93feb0c91c Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Thu, 16 Nov 2023 20:11:25 +0100
Subject: [PATCH] Add llvm-dlltool to the toolchain list

This adds dlltool to the list of tools which don't get excluded
from installation when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

The most important effect here is that this tool will now be
included in the official Windows release.

While llvm-lib reuses the dlltool machinary internally and has
many of the same capabilities, it does not expose the functionality
controller by the '-k' flag, which is currently the only way to create
import libraries for i386 with stdcall symbols from a module definition alone.

We avoid changing llvm-lib tool, since it is designed to emulate LIB.EXE from
MSVC toolchain, and as this functionality is not supported there, we would have
had to introduce an LLVM extension flag in order to support it.

See https://reviews.llvm.org/D36548 for reference on rationale for
dlltool '-k' flag.
---
 llvm/cmake/modules/AddLLVM.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 05e4d6c823c0d69..0fa52150095ea9a 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1307,6 +1307,7 @@ if(NOT LLVM_TOOLCHAIN_TOOLS)
     llvm-ar
     llvm-cov
     llvm-cxxfilt
+    llvm-dlltool
     llvm-dwp
     llvm-ranlib
     llvm-lib



More information about the llvm-commits mailing list