Skip to content

Commit

Permalink
update main-with-bazel from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
BoringSSL Robot committed Apr 11, 2024
2 parents 8cb316d + bdb7b19 commit 07fa278
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/include/openssl/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@

// Trusty and Android baremetal aren't Linux but currently define __linux__.
// As a workaround, we exclude them here.
// We also exclude nanolibc/CrOS EC/Zephyr. nanolibc/CrOS EC/Zephyr
// sometimes build for a non-Linux target (which should not define __linux__),
// but also sometimes build for Linux. Although technically running in Linux
// userspace, this lacks all the libc APIs we'd normally expect on Linux, so we
// treat it as a non-Linux target.
// We also exclude nanolibc/CrOS EC. nanolibc/CrOS EC sometimes build for a
// non-Linux target (which should not define __linux__), but also sometimes
// build for Linux. Although technically running in Linux userspace, this lacks
// all the libc APIs we'd normally expect on Linux, so we treat it as a
// non-Linux target.
//
// TODO(b/169780122): Remove this workaround once Trusty no longer defines it.
// TODO(b/291101350): Remove this workaround once Android baremetal no longer
// defines it.
#if defined(__linux__) && !defined(__TRUSTY__) && \
!defined(ANDROID_BAREMETAL) && !defined(OPENSSL_NANOLIBC) && \
!defined(CROS_EC) && !defined(CROS_ZEPHYR)
!defined(CROS_EC)
#define OPENSSL_LINUX
#endif

Expand Down Expand Up @@ -148,16 +148,19 @@
#define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
#endif

// CROS_ZEPHYR is an embedded target for ChromeOS Zephyr Embedded Controller.
// Zephyr is an open source RTOS, optimized for embedded devices.
// Defining this on any other platform is not supported. Other embedded
// platforms must introduce their own defines.
//
// https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/docs/zephyr/README.md
#if defined(CROS_ZEPHYR)
// Zephyr supports multithreading with cooperative and preemptive scheduling.
// It also implements POSIX Threads (pthread) API, so it's not necessary to
// implement BoringSSL internal threading API using some custom API.
//
// https://www.zephyrproject.org/
#if defined(__ZEPHYR__)
#define OPENSSL_NO_FILESYSTEM
#define OPENSSL_NO_POSIX_IO
#define OPENSSL_NO_SOCK
#define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
#endif

#if defined(__ANDROID_API__)
Expand Down

0 comments on commit 07fa278

Please sign in to comment.