Skip to content

[compiler-rt] circular dependency on libc #123848

@nickdesaulniers

Description

@nickdesaulniers

cc @petrhosek @frobtech @michaelrj-google @pcc @compnerd

Ideally, we'd be able to build the compiler builtins without depending on the libc (for purposes of bootstrapping a system). Right now, I observe build failures for the builtins ninja target when attempting to bootstrap such a sysroot:

  • compiler-rt/lib/builtins/emutls.c depends on <stdlib.h>
  • compiler-rt/lib/builtins/clear_cache.c depends on <assert.h>
  • compiler-rt/lib/builtins/enable_execute_stack.c depends on <sys/mman.h>
  • compiler-rt/lib/builtins/eprintf.c depends on <stdio.h>
  • compiler-rt/lib/builtins/cpu_model/x86.c depends on <assert.h>

It looks like COMPILER_RT_BAREMETAL_BUILD can be unset to disable the addition of emutls.c, enable_execute_stack.c, and eprintf.c . (Ah @petrhosek has been here before, thanks @petrhosek !) AFAICT, there's currently no cmake option to skip building the rest.

Otherwise, it seems like we may have a circular dependency between the compiler builtins and the libc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions