Skip to content

Attempt to generate a next toolchain with #61668 #61721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ endif()
ENABLE_LANGUAGE(C)

# Use C++14.
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

Expand All @@ -55,6 +55,7 @@ include(SwiftUtils)
include(CheckSymbolExists)
include(CMakeDependentOption)
include(CheckLanguage)
include(GNUInstallDirs)

# Enable Swift for the host compiler build if we have the language. It is
# optional until we have a bootstrap story.
Expand Down Expand Up @@ -321,6 +322,10 @@ if(SWIFT_PROFDATA_FILE AND EXISTS ${SWIFT_PROFDATA_FILE})
add_definitions("-fprofile-instr-use=${SWIFT_PROFDATA_FILE}")
endif()

set(SWIFT_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
"Path for binary subdirectory to use during installation.
Used by add_swift_tool_symlink in AddSwift.cmake so that llvm_install_symlink generates the installation script properly.")

#
# User-configurable Swift Standard Library specific options.
#
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ function(add_swift_fuzzer_host_tool executable)
endfunction()

macro(add_swift_tool_symlink name dest component)
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE COMPONENT ${component})
llvm_add_tool_symlink(SWIFT ${name} ${dest} ALWAYS_GENERATE)
llvm_install_symlink(SWIFT ${name} ${dest} COMPONENT ${component})
endmacro()

# Declare that files in this library are built with LLVM's support
Expand Down
5 changes: 3 additions & 2 deletions include/swift/Runtime/Heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ namespace swift {
// Never returns nil. The returned memory is uninitialized.
//
// An "alignment mask" is just the alignment (a power of 2) minus 1.
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
void *swift_slowAlloc(size_t bytes, size_t alignMask);
SWIFT_RUNTIME_EXPORT
void *swift_slowAlloc SWIFT_RETURNS_NONNULL SWIFT_NODISCARD(size_t bytes,
size_t alignMask);

// If the caller cannot promise to zero the object during destruction,
// then call these corresponding APIs:
Expand Down
12 changes: 6 additions & 6 deletions include/swift/Runtime/HeapObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ struct OpaqueValue;
///
/// POSSIBILITIES: The argument order is fair game. It may be useful
/// to have a variant which guarantees zero-initialized memory.
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
HeapObject *swift_allocObject(HeapMetadata const *metadata,
size_t requiredSize,
size_t requiredAlignmentMask);
SWIFT_RUNTIME_EXPORT
HeapObject *swift_allocObject SWIFT_RETURNS_NONNULL
SWIFT_NODISCARD(HeapMetadata const *metadata, size_t requiredSize,
size_t requiredAlignmentMask);

/// Initializes the object header of a stack allocated object.
///
Expand Down Expand Up @@ -117,8 +117,8 @@ BoxPair swift_makeBoxUnique(OpaqueValue *buffer, Metadata const *type,
size_t alignMask);

/// Returns the address of a heap object representing all empty box types.
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
HeapObject* swift_allocEmptyBox();
SWIFT_RUNTIME_EXPORT
HeapObject *swift_allocEmptyBox SWIFT_RETURNS_NONNULL SWIFT_NODISCARD();

/// Atomically increments the retain count of an object.
///
Expand Down
20 changes: 9 additions & 11 deletions include/swift/Runtime/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,19 @@ swift_getGenericMetadata(MetadataRequest request,
/// - installing new v-table entries and overrides; and
/// - registering the class with the runtime under ObjC interop.
/// Most of this work can be achieved by calling swift_initClassMetadata.
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
ClassMetadata *
swift_allocateGenericClassMetadata(const ClassDescriptor *description,
const void *arguments,
const GenericClassMetadataPattern *pattern);
SWIFT_RUNTIME_EXPORT
ClassMetadata *swift_allocateGenericClassMetadata SWIFT_RETURNS_NONNULL
SWIFT_NODISCARD(const ClassDescriptor *description, const void *arguments,
const GenericClassMetadataPattern *pattern);

/// Allocate a generic value metadata object. This is intended to be
/// called by the metadata instantiation function of a generic struct or
/// enum.
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
ValueMetadata *
swift_allocateGenericValueMetadata(const ValueTypeDescriptor *description,
const void *arguments,
const GenericValueMetadataPattern *pattern,
size_t extraDataSize);
SWIFT_RUNTIME_EXPORT
ValueMetadata *swift_allocateGenericValueMetadata SWIFT_RETURNS_NONNULL
SWIFT_NODISCARD(const ValueTypeDescriptor *description, const void *arguments,
const GenericValueMetadataPattern *pattern,
size_t extraDataSize);

/// Check that the given metadata has the right state.
SWIFT_RUNTIME_EXPORT SWIFT_CC(swift)
Expand Down
29 changes: 7 additions & 22 deletions tools/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ swift_create_post_build_symlink(swift-frontend
DESTINATION "swift-api-digester${CMAKE_EXECUTABLE_SUFFIX}"
WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}")

# This is needed to be able to use the LLVM functions
# to create symlinks to swift-frontend
add_llvm_install_targets(install-swift-frontend
DEPENDS swift-frontend)
add_dependencies(install-compiler install-swift-frontend)
add_dependencies(install-compiler-stripped install-swift-frontend-stripped)

add_swift_tool_symlink(swift swift-frontend compiler)
add_swift_tool_symlink(swiftc swift-frontend compiler)
add_swift_tool_symlink(swift-symbolgraph-extract swift-frontend compiler)
Expand All @@ -120,27 +127,5 @@ add_swift_tool_symlink(swift-indent swift-frontend editor-integration)
add_swift_tool_symlink(swift-api-digester swift-frontend compiler)

add_dependencies(compiler swift-frontend)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT compiler)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swiftc${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT compiler)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-symbolgraph-extract${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT compiler)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-api-extract${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT compiler)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-api-digester${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT compiler)
add_dependencies(autolink-driver swift-frontend)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-autolink-extract${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT autolink-driver)
add_dependencies(editor-integration swift-frontend)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-indent${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT editor-integration)

8 changes: 8 additions & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,14 @@ installable-package=%(installable_package)s
# in Linux CI bots
relocate-xdg-cache-home-under-build-subdir

extra-cmake-options=
# This is to prevent failures in linking
# tsan_interceptors_dispatch as part of libclang_rt.tsan
# We are now inheriting the -Wl,-z,defs linker flags
# from HandleLLVMOptions.cmake, so the compiler now complains
# for BlocksRuntime symbols that are undefined
-DCOMPILER_RT_INTERCEPT_LIBDISPATCH:BOOL=OFF


[preset: buildbot_linux_base]
mixin-preset=
Expand Down