Skip to content

Commit

Permalink
[crt] Enable sparc and mips targets
Browse files Browse the repository at this point in the history
This patch enables sparc and mips in compiler-rt CRT, meaning that now every platform supported by compiler-rt builtins (that runs on Linux, i.e. not WebAssembly) will be suported by compiler-rt CRT

Reviewed By: phosek, MaskRay

Differential Revision: https://reviews.llvm.org/D147819
  • Loading branch information
xbjfk authored and MaskRay committed Apr 12, 2023
1 parent 2ba8844 commit 2c12e9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler-rt/cmake/crt-config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ set(HEXAGON hexagon)
set(X86 i386)
set(X86_64 x86_64)
set(LOONGARCH64 loongarch64)
set(MIPS32 mips mipsel)
set(MIPS64 mips64 mips64el)
set(PPC32 powerpc powerpcspe)
set(PPC64 powerpc64 powerpc64le)
set(RISCV32 riscv32)
set(RISCV64 riscv64)
set(VE ve)

set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC32}
${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON} ${LOONGARCH64})
${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON} ${LOONGARCH64}
${MIPS32} ${MIPS64} ${SPARC} ${SPARCV9})

include(CompilerRTUtils)

Expand Down
8 changes: 8 additions & 0 deletions compiler-rt/lib/crt/crtbegin.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ __asm__(".pushsection .init,\"ax\",%progbits\n\t"
__asm__(".pushsection .init,\"ax\",%progbits\n\t"
"bl __do_init\n\t"
".popsection");
#elif defined(__mips__)
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
"jal __do_init\n\t"
".popsection");
#elif defined(__powerpc__) || defined(__powerpc64__)
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
"bl __do_init\n\t"
Expand Down Expand Up @@ -109,6 +113,10 @@ __asm__(".pushsection .fini,\"ax\",@progbits\n\t"
__asm__(".pushsection .fini,\"ax\",%progbits\n\t"
"bl __do_fini\n\t"
".popsection");
#elif defined(__mips__)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
"jal __do_fini\n\t"
".popsection");
#elif defined(__powerpc__) || defined(__powerpc64__)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
"bl __do_fini\n\t"
Expand Down

0 comments on commit 2c12e9b

Please sign in to comment.