Skip to content

Conversation

@simpal01
Copy link
Contributor

@simpal01 simpal01 commented May 13, 2025

We don't want two implementations of the __aeabi runtime in two different libraries. We could suppress the compiler-rt implementation at build time so there's only the picolibc definition. This patch llvm/llvm-project#137952 introduced a new cmake flag called
COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS to support this functionality.

When enabled, this flag excludes the following ARM AEABI memory function implementations from the compiler-rt build:

  • __aeabi_memcmp
  • __aeabi_memset
  • __aeabi_memcpy
  • __aeabi_memmove

These functions are already provided by standard C libraries like newlib, and picolibc, so excluding them avoids duplicate symbol definitions and reduces unnecessary code duplication.

Also we can now remove the downstream patch that changed the library order to put -lc before compiler-rt builtins as there is now this recent upstream addition of the
COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS flag.

… the ATFE to exclude libc-provided AEABI builtins.

We don't want two implementations of the __aeabi runtime
in two different libraries. We could suppress the compiler-rt
implementation at build time so there's only the picolibc definition.
This patch llvm/llvm-project#137952
introduced a new cmake flag called
COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS to support
this functionality.

When enabled, this flag excludes the following ARM AEABI memory
function implementations from the compiler-rt build:
__aeabi_memcmp
__aeabi_memset
__aeabi_memcpy
__aeabi_memmove

These functions are already provided by standard C libraries like
newlib, and picolibc, so excluding them avoids duplicate symbol
definitions and reduces unnecessary code duplication.

Also we can now remove the downstream patch that changed the
library order to put -lc before compiler-rt builtins as there is
now this recent upstream addition of the
COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS flag.
@simpal01 simpal01 requested review from dcandler and smithp35 May 13, 2025 16:39
@simpal01 simpal01 changed the title [ATFE] Enable COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS in the ATFE to exclude libc-provided AEABI builtins. [ATFE] Exclude libc-provided AEABI builtins from compiler-rt in ATFE using compiler-rt macro COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS May 13, 2025
@simpal01 simpal01 changed the title [ATFE] Exclude libc-provided AEABI builtins from compiler-rt in ATFE using compiler-rt macro COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS [ATFE] Configure ATFE to exclude libc-provided AEABI builtins from compiler-rt May 13, 2025
Copy link
Contributor

@dcandler dcandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simpal01 simpal01 merged commit ef52277 into arm:arm-software May 14, 2025
simpal01 added a commit to simpal01/arm-toolchain that referenced this pull request May 22, 2025
…th llvm-libc.

Previously, the following symbols were excluded from the build due to the patch introduced in arm#326

__aeabi_memcmp
__aeabi_memset
__aeabi_memcpy
__aeabi_memmove

LLVM libc currently does not provide implementations for __aeabi* symbols. This change ensures that the above implementations from compiler-rt are preserved when linking with llvm-libc , to avoid missing symbol errors at link time.
simpal01 added a commit that referenced this pull request May 22, 2025
…th llvm-libc. (#343)

Previously, the following symbols were excluded from the build due to
the patch introduced in #326

__aeabi_memcmp
__aeabi_memset
__aeabi_memcpy
__aeabi_memmove

LLVM libc currently does not provide implementations for __aeabi*
symbols. This change ensures that the above implementations from
compiler-rt are preserved when linking with llvm-libc , to avoid missing
symbol errors at link time.
@simpal01 simpal01 deleted the fix-duplicate-symbol-issue1 branch June 26, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants