Skip to content

[libc] investigate the usage of -fno-builtin-foo for foo.c rather than -ffreestanding #118392

@nickdesaulniers

Description

@nickdesaulniers

cmake/modules/LLVMLibCCompileOptionRules.cmake currently blankets -ffreestanding (for CPU targets) for TUs to avoid creating infinite recursion via things like loop idiom recognition turning the implementation of memcpy into memcpy. I think I'd like to remove -ffreestanding and instead move to building strlen with -fno-builtin-strlen, etc, for all symbols, and remove -ffreestanding. Clang supports a function attribute for this, but gcc does not, so command line flags it is.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96628

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