llvmPackages_11.compiler-rt: Add i486, i586, i686 to X86 family. Expose ix86 family builtins.

Co-Authored-By: John Ericson <git@JohnEricson.me>
This commit is contained in:
Giulio De Pasquale 2022-04-15 01:41:25 +02:00
parent 5e66f427c6
commit 5989c9d76c

View File

@ -74,6 +74,8 @@ stdenv.mkDerivation {
postPatch = lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
substituteInPlace cmake/config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'foreach(arch ''${ARM64})' 'foreach(arch)'
@ -96,6 +98,12 @@ stdenv.mkDerivation {
ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
''
# See https://reviews.llvm.org/D37278 for why android exception
+ lib.optionalString (stdenv.hostPlatform.isx86_32 && !stdenv.hostPlatform.isAndroid) ''
for f in $out/lib/*/*builtins-i?86*; do
ln -s "$f" $(echo "$f" | sed -e 's/builtins-i.86/builtins-i386/')
done
'';
meta = llvm_meta // {