Skip to content

CMake error when trying to build Compiler-RT for ARM32. (Attempt to add a custom rule to output ... which already has a custom rule.) #55046

Closed
@UsmanNadeem

Description

@UsmanNadeem

Seeing this issue after: https://reviews.llvm.org/D120682

-- Compiler-RT supported architectures: arm;armv6m
-- Builtin supported architectures: arm;armv6m
-- For arm builtins preferring arm/fp_mode.c to fp_mode.c
-- For arm builtins preferring arm/bswapdi2.S to bswapdi2.c
-- For arm builtins preferring arm/bswapsi2.S to bswapsi2.c
-- For arm builtins preferring arm/clzdi2.S to clzdi2.c
-- For arm builtins preferring arm/clzsi2.S to clzsi2.c
-- For arm builtins preferring arm/comparesf2.S to comparesf2.c
-- For arm builtins preferring arm/divmodsi4.S to divmodsi4.c
-- For arm builtins preferring arm/divsi3.S to divsi3.c
-- For arm builtins preferring arm/modsi3.S to modsi3.c
-- For arm builtins preferring arm/udivmodsi4.S to udivmodsi4.c
-- For arm builtins preferring arm/udivsi3.S to udivsi3.c
-- For arm builtins preferring arm/umodsi3.S to umodsi3.c
-- For armv6m builtins preferring arm/divsi3.S to divsi3.c
-- For armv6m builtins preferring arm/udivsi3.S to udivsi3.c
-- For armv6m builtins preferring arm/comparesf2.S to comparesf2.c
-- For armv6m builtins preferring arm/addsf3.S to addsf3.c
-- Supported architectures for crt: arm;armv6m
CMake Error: Attempt to add a custom rule to output ".../compiler-rt/arm32/linux/lib/linux/clang_rt.crtbegin-arm.o.rule" which already has a custom rule.
CMake Error: Attempt to add a custom rule to output ".../compiler-rt/arm32/linux/lib/linux/clang_rt.crtend-arm.o.rule" which already has a custom rule.
-- Configuring incomplete, errors occurred!

Before the patch, if I printed ${CRT_SUPPORTED_ARCH} in compiler-rt/lib/crt/CMakeLists.txt I only got arm. Now I get arm;armv6m. Like this:

# compiler-rt/lib/crt/CMakeLists.txt
+ message(STATUS "Supported architectures for crt: ${CRT_SUPPORTED_ARCH}")
foreach(arch ${CRT_SUPPORTED_ARCH})
  add_compiler_rt_runtime(clang_rt.crtbegin
    OBJECT
    ARCHS ${arch}
    SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c
    CFLAGS ${CRT_CFLAGS}
    PARENT_TARGET crt)
  add_compiler_rt_runtime(clang_rt.crtend
    OBJECT
    ARCHS ${arch}
    SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c
    CFLAGS ${CRT_CFLAGS}
    PARENT_TARGET crt)
endforeach()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions