[profile] Add InstrProfilingInternal.c.o to Darwin kext builtins

Fixes a build failure in the Darwin kernel. Tested with:

% nm -m ./lib/libclang_rt.cc_kext_x86_64_osx.a | grep lprofSetProfileDumped

rdar://66249602
This commit is contained in:
Vedant Kumar 2020-07-29 17:22:27 -07:00
parent 44e7d44997
commit 618a0c0d3b
6 changed files with 17 additions and 2 deletions

View File

@ -398,7 +398,8 @@ macro(darwin_add_builtin_libraries)
set(PROFILE_SOURCES ../profile/InstrProfiling
../profile/InstrProfilingBuffer
../profile/InstrProfilingPlatformDarwin
../profile/InstrProfilingWriter)
../profile/InstrProfilingWriter
../profile/InstrProfilingInternal)
foreach (os ${ARGN})
list_intersect(DARWIN_BUILTIN_ARCHS DARWIN_${os}_BUILTIN_ARCHS BUILTIN_SUPPORTED_ARCH)
foreach (arch ${DARWIN_BUILTIN_ARCHS})

View File

@ -6,6 +6,9 @@
|*
\*===----------------------------------------------------------------------===*/
// Note: This is linked into the Darwin kernel, and must remain compatible
// with freestanding compilation. See `darwin_add_builtin_libraries`.
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@ -17,7 +20,6 @@
#define INSTR_PROF_VALUE_PROF_DATA
#include "profile/InstrProfData.inc"
COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) {
return sizeof(void *) == sizeof(uint64_t) ? (INSTR_PROF_RAW_MAGIC_64)
: (INSTR_PROF_RAW_MAGIC_32);

View File

@ -6,6 +6,9 @@
|*
\*===----------------------------------------------------------------------===*/
// Note: This is linked into the Darwin kernel, and must remain compatible
// with freestanding compilation. See `darwin_add_builtin_libraries`.
#include "InstrProfiling.h"
#include "InstrProfilingInternal.h"
#include "InstrProfilingPort.h"

View File

@ -6,6 +6,9 @@
|*
\*===----------------------------------------------------------------------===*/
// Note: This is linked into the Darwin kernel, and must remain compatible
// with freestanding compilation. See `darwin_add_builtin_libraries`.
#if !defined(__Fuchsia__)
#include "InstrProfilingInternal.h"

View File

@ -6,6 +6,9 @@
|*
\*===----------------------------------------------------------------------===*/
// Note: This is linked into the Darwin kernel, and must remain compatible
// with freestanding compilation. See `darwin_add_builtin_libraries`.
#include "InstrProfiling.h"
#if defined(__APPLE__)

View File

@ -6,6 +6,9 @@
|*
\*===----------------------------------------------------------------------===*/
// Note: This is linked into the Darwin kernel, and must remain compatible
// with freestanding compilation. See `darwin_add_builtin_libraries`.
#ifdef _MSC_VER
/* For _alloca */
#include <malloc.h>