Skip to content

Conversation

@voltur01
Copy link
Contributor

llvm/llvm-project#167998 enabled baremetal builds of compiler_rt profile runtime, so replace ATfE downstream minimal profile implementation (proflib.c) with compiler_rt one.

proflib.c file is kept to provide the code needed to interface compiler_rt profile library to keep it clear in one place.

This depends on adding supported Arm architecture in upstream LLVM runtimes CMake file: llvm/llvm-project#172984

llvm/llvm-project#167998 enabled baremetal builds of compiler_rt profile runtime, so replace ATfE downstream minimal profile implementation (proflib.c) with compiler_rt one.

proflib.c file is kept to provide the code needed to interface compiler_rt profile library to keep it clear in one place.

This depends on adding supported Arm architecture in upstream LLVM runtimes CMake file.
@voltur01 voltur01 requested a review from a team as a code owner December 19, 2025 10:26
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX}
-DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}
-DCMAKE_SYSTEM_NAME=Generic
Copy link
Contributor

@vhscampos vhscampos Dec 19, 2025

Choose a reason for hiding this comment

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

Where do all these options come from? Did you base it on something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the same as compiler_rt invocation for builtins

except that:

  • it is named compiler-rt-profile
  • it turns builtins OFF
  • it turns profile library ON and baremetal profile ON
  • it depends on builtins and C library

The profile library cannot be built in one go with builtins, because of dependencies: profile needs C library that needs builtins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know if there is a sensible way to move common part out to avoid duplication - hopefully, someone with more CMake experience can advise.

Copy link
Contributor

@vhscampos vhscampos Dec 19, 2025

Choose a reason for hiding this comment

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

Maybe you could take all the common arguments and place them into another variable. It's not a major issue anyway, do it only if you want.

Example: the compiler_rt_cmake_args variable

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