Skip to content

Commit a87867f

Browse files
duda-patrykChromeos LUCI
authored andcommitted
fpmcu: Change method of selecting C standard
Zephyr PR #71024[1] deprecated CSTD global variable for selecting C standard. Appropriate Kconfig options should be used instead. [1] zephyrproject-rtos/zephyr#71024 BUG=b:321092852 TEST=zmake build bloonchipper Change-Id: I3debb2d9ffc7295ddfbbbd7a84dda51db3fd90a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/5498197 Tested-by: Patryk Duda <[email protected]> Commit-Queue: Patryk Duda <[email protected]> Code-Coverage: Zoss <[email protected]> Reviewed-by: Tom Hughes <[email protected]>
1 parent 3e98a43 commit a87867f

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

third_party/boringssl/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,8 @@ zephyr_library_link_libraries(crypto)
7575
#
7676
# -Wno-return-type is needed to ignore non-void functions that calls abort() and
7777
# don't have return statement (e.g. aes_hw_set_encrypt_key()).
78-
#
79-
# -std=c11 is necessary because BoringSSL sources use features available in
80-
# C11, e.g. static_assert().
8178
set(BORINGSSL_COMPILE_OPTIONS -D_POSIX_C_SOURCE=200809L
82-
-Wno-implicit-function-declaration -fno-common -Wno-return-type
83-
-std=c11)
79+
-Wno-implicit-function-declaration -fno-common -Wno-return-type)
8480

8581
# Create interface library that specifies compile options required by
8682
# BoringSSL. This is the same trick used by zephyr_library_compile_options()

third_party/boringssl/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config BORINGSSL_CRYPTO
66
bool "BoringSSL support"
77
depends on COMMON_LIBC_MALLOC_ARENA_SIZE >= 2048 || \
88
NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE >= 2048
9+
select REQUIRES_STD_C11
910
help
1011
This option enables BoringSSL cryptography library.
1112
The library is provided as external module.

zephyr/program/fpmcu/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
cmake_minimum_required(VERSION 3.13.1)
66

7-
# Set C standard to C11. If not set, Zephyr uses C99 by default.
8-
# This property must be set before 'find_package' below, so Zephyr's top
9-
# CMakeLists.txt can set up everything properly.
10-
set_property(GLOBAL PROPERTY CSTD c11)
11-
127
find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}")
138

149
# USAGE FAULT on int overflow

zephyr/program/fpmcu/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
# check_init_priorities.py.
1111
CONFIG_CHECK_INIT_PRIORITIES=n
1212

13+
# Use C11 standard to have _Static_assert() compiler builtin.
14+
# Zephyr will use it for BUILD_ASSERT() implementation (instead of silently
15+
# ignoring them).
16+
CONFIG_STD_C11=y
17+
1318
# Power Management
1419
CONFIG_PM=y
1520
CONFIG_PM_DEVICE=y

0 commit comments

Comments
 (0)