Skip to content

Commit e66917d

Browse files
committed
Fool libtool to allow building a shared library although linking to libclang_rt.builtins-aarch64.a
1 parent e722508 commit e66917d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Dockerfile.mri.erb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ RUN printf "1\n" | update-alternatives --config <%= target %>-gcc && \
211211
printf "1\n" | update-alternatives --config <%= target %>-g++
212212
<% end %>
213213

214+
<% if platform =~ /aarch64-mingw/ %>
215+
# Fool libtool to allow building a shared library although linking to libclang_rt.builtins-aarch64.a
216+
#
217+
# Linker option "-llibclang_rt.builtins-aarch64.a" is required on Windows on ARM when compiling C++ and when clang is called with -nostdlib (due to be invoked by libtool).
218+
# Unfortunately libtool then forces a static build.
219+
# This is a ugly hack to make libtool beleave that the library is a DLL instead of an archive and to allow building a DLL instand.
220+
#
221+
RUN sudo cp /llvm-mingw-20250114-ucrt-ubuntu-20.04-<%= RUBY_PLATFORM[/^\w+/] %>/aarch64-w64-mingw32/bin/libc++.dll /llvm-mingw-20250114-ucrt-ubuntu-20.04-<%= RUBY_PLATFORM[/^\w+/] %>/aarch64-w64-mingw32/lib/libclang_rt.builtins-aarch64.0
222+
<% end %>
223+
214224
<% if platform =~ /darwin/ %>
215225
# Install wrapper around strip to re-sign binaries (ad-hoc signature)
216226
COPY build/strip_wrapper_codesign /root/

0 commit comments

Comments
 (0)