Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ endmacro()
# OBJECT_LIBS <object libraries to use as sources>
# PARENT_TARGET <convenience parent target>
# ADDITIONAL_HEADERS <header files>
# EXTENSIONS <boolean>
# C_STANDARD <version>
# CXX_STANDARD <version>)
function(add_compiler_rt_runtime name type)
Expand All @@ -174,7 +173,7 @@ function(add_compiler_rt_runtime name type)
cmake_parse_arguments(LIB
""
"PARENT_TARGET;C_STANDARD;CXX_STANDARD"
"OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;DEPS;LINK_LIBS;OBJECT_LIBS;ADDITIONAL_HEADERS;EXTENSIONS"
"OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;DEPS;LINK_LIBS;OBJECT_LIBS;ADDITIONAL_HEADERS"
${ARGN})
set(libnames)
# Until we support this some other way, build compiler-rt runtime without LTO
Expand Down Expand Up @@ -445,10 +444,6 @@ function(add_compiler_rt_runtime name type)
if(type STREQUAL "SHARED")
rt_externalize_debuginfo(${libname})
endif()

if(DEFINED LIB_EXTENSIONS)
set_target_properties(${libname} PROPERTIES C_EXTENSIONS ${LIB_EXTENSIONS})
endif()
endforeach()
if(LIB_PARENT_TARGET)
add_dependencies(${LIB_PARENT_TARGET} ${libnames})
Expand Down
6 changes: 2 additions & 4 deletions compiler-rt/lib/profile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,13 @@ if(APPLE)
CFLAGS ${EXTRA_FLAGS}
SOURCES ${PROFILE_SOURCES}
ADDITIONAL_HEADERS ${PROFILE_HEADERS}
PARENT_TARGET profile
EXTENSIONS ON)
PARENT_TARGET profile)
else()
add_compiler_rt_runtime(clang_rt.profile
STATIC
ARCHS ${PROFILE_SUPPORTED_ARCH}
CFLAGS ${EXTRA_FLAGS}
SOURCES ${PROFILE_SOURCES}
ADDITIONAL_HEADERS ${PROFILE_HEADERS}
PARENT_TARGET profile
EXTENSIONS ON)
PARENT_TARGET profile)
endif()
5 changes: 5 additions & 0 deletions compiler-rt/lib/profile/GCDAProfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

#if !defined(__Fuchsia__)

#if defined(__linux__)
// For fdopen()
#define _DEFAULT_SOURCE
#endif

#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
Expand Down
5 changes: 5 additions & 0 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

#if !defined(__Fuchsia__)

#if defined(__linux__)
// For fileno(), ftruncate(), getpagesize(), setenv()
#define _DEFAULT_SOURCE
#endif

#include <assert.h>
#include <errno.h>
#include <stdio.h>
Expand Down
5 changes: 5 additions & 0 deletions compiler-rt/lib/profile/InstrProfilingUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#include <windows.h>
#include "WindowsMMap.h"
#else
#if defined(__linux__)
// For fdopen(), fileno(), getpagesize(), madvise()
#define _DEFAULT_SOURCE
#endif

#include <errno.h>
#include <fcntl.h>
#include <sys/file.h>
Expand Down