Skip to content

Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2" #68911

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

Merged
merged 2 commits into from
Oct 2, 2023
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
2 changes: 1 addition & 1 deletion stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function(_add_target_variant_swift_compile_flags
${ARGN})

# On Windows, we don't set SWIFT_SDK_WINDOWS_PATH_ARCH_{ARCH}_PATH, so don't include it.
if ((NOT "${sdk}" STREQUAL "WINDOWS") AND NOT ("${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}" STREQUAL ""))
if (NOT "${sdk}" STREQUAL "WINDOWS")
list(APPEND result "-sdk" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}")
endif()

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SwiftShims/swift/shims/LibcShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ __swift_size_t _swift_stdlib_fwrite_stdout(const void *ptr, __swift_size_t size,
// General utilities <stdlib.h>
// Memory management functions
extern int posix_memalign(void *_Nullable *_Nonnull memptr, __swift_size_t alignment, __swift_size_t size);
extern void free(void *_Nullable);
static inline void _swift_stdlib_free(void *_Nullable ptr) {
extern void free(void *_Nullable);
free(ptr);
}

Expand Down
3 changes: 1 addition & 2 deletions stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,14 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)

set(SWIFT_SDK_embedded_ARCH_${arch}_MODULE "${mod}")
set(SWIFT_SDK_embedded_LIB_SUBDIR "embedded")
set(SWIFT_SDK_embedded_ARCH_${arch}_TRIPLE "${triple}")
add_swift_target_library_single(
embedded-stdlib-${triple}
swiftCore
ONLY_SWIFTMODULE
IS_STDLIB IS_STDLIB_CORE
${SWIFTLIB_EMBEDDED_SOURCES}
GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES}
SWIFT_COMPILE_FLAGS -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
SWIFT_COMPILE_FLAGS -target "${triple}" -Xcc -D__MACH__ -enable-experimental-feature Embedded
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
SDK "embedded"
ARCHITECTURE "${arch}"
Expand Down
2 changes: 2 additions & 0 deletions test/embedded/fno-builtin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx

// REQUIRES: rdar116354297

public func foo() -> [Int] {
var a = [1, 2, 3]
a.append(4)
Expand Down