-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Newlib defines POSIX primitives when -std=gnu #52739
Labels
area: Networking
area: newlib
Newlib C Standard Library
area: POSIX
POSIX API Library
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Comments
stephanosio
added
bug
The issue is a bug, or the PR is fixing a bug
area: Networking
area: POSIX
POSIX API Library
area: newlib
Newlib C Standard Library
labels
Dec 2, 2022
stephanosio
added a commit
to stephanosio/zephyr
that referenced
this issue
Dec 2, 2022
This commit updates the Newlib integration to define `_ANSI_SOURCE` in order to prevent Newlib from defining POSIX primitives in its headers when GNU dialect is used (`-std=gnu*`). Newlib `features.h` defines `_DEFAULT_SOURCE` when `__STRICT_ANSI__` is not defined by GCC (i.e. when `-std=gnu*`), which results in the Newlib headers defining POSIX primitives that are in conflict with the POSIX primitives defined by Zephyr. Newlib must not define POSIX primitives unless the feature test macros such as `_POSIX_SOURCE`, `_GNU_SOURCE` and `_DEFAULT_SOURCE` are explicitly defined. Note that `-std=gnu` does not imply `_GNU_SOURCE` or `_DEFAULT_SOURCE` because it is only supposed to instruct the compiler to use the GNU C language dialect (i.e. GNU C language extensions). Refer to the GitHub issue zephyrproject-rtos#52739 for more details. Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio
added a commit
to stephanosio/nrfconnect-sdk-connectedhomeip
that referenced
this issue
Dec 2, 2022
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
nordicjm
pushed a commit
to nrfconnect/sdk-connectedhomeip
that referenced
this issue
Dec 2, 2022
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
jori-nordic
pushed a commit
to jori-nordic/zephyr
that referenced
this issue
Dec 5, 2022
This commit updates the Newlib integration to define `_ANSI_SOURCE` in order to prevent Newlib from defining POSIX primitives in its headers when GNU dialect is used (`-std=gnu*`). Newlib `features.h` defines `_DEFAULT_SOURCE` when `__STRICT_ANSI__` is not defined by GCC (i.e. when `-std=gnu*`), which results in the Newlib headers defining POSIX primitives that are in conflict with the POSIX primitives defined by Zephyr. Newlib must not define POSIX primitives unless the feature test macros such as `_POSIX_SOURCE`, `_GNU_SOURCE` and `_DEFAULT_SOURCE` are explicitly defined. Note that `-std=gnu` does not imply `_GNU_SOURCE` or `_DEFAULT_SOURCE` because it is only supposed to instruct the compiler to use the GNU C language dialect (i.e. GNU C language extensions). Refer to the GitHub issue zephyrproject-rtos#52739 for more details. Upstream PR: zephyrproject-rtos#52740 Signed-off-by: Stephanos Ioannidis <[email protected]>
carlescufi
pushed a commit
that referenced
this issue
Dec 5, 2022
This commit updates the Newlib integration to define `_ANSI_SOURCE` in order to prevent Newlib from defining POSIX primitives in its headers when GNU dialect is used (`-std=gnu*`). Newlib `features.h` defines `_DEFAULT_SOURCE` when `__STRICT_ANSI__` is not defined by GCC (i.e. when `-std=gnu*`), which results in the Newlib headers defining POSIX primitives that are in conflict with the POSIX primitives defined by Zephyr. Newlib must not define POSIX primitives unless the feature test macros such as `_POSIX_SOURCE`, `_GNU_SOURCE` and `_DEFAULT_SOURCE` are explicitly defined. Note that `-std=gnu` does not imply `_GNU_SOURCE` or `_DEFAULT_SOURCE` because it is only supposed to instruct the compiler to use the GNU C language dialect (i.e. GNU C language extensions). Refer to the GitHub issue #52739 for more details. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/connectedhomeip
that referenced
this issue
Jan 5, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/connectedhomeip
that referenced
this issue
Jan 6, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/connectedhomeip
that referenced
this issue
Jan 6, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
added a commit
to Damian-Nordic/connectedhomeip
that referenced
this issue
Jan 9, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739.
andy31415
added a commit
to project-chip/connectedhomeip
that referenced
this issue
Jan 9, 2023
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <[email protected]> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <[email protected]> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <[email protected]> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <[email protected]> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <[email protected]> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <[email protected]> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <[email protected]> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <[email protected]> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <[email protected]> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <[email protected]> Signed-off-by: Damian Krolik <[email protected]> Co-authored-by: Marcin Kajor <[email protected]> Co-authored-by: Kamil Kasperczyk <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
cletnick
pushed a commit
to cletnick/connectedhomeip
that referenced
this issue
Jan 10, 2023
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <[email protected]> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <[email protected]> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <[email protected]> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <[email protected]> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <[email protected]> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <[email protected]> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <[email protected]> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <[email protected]> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <[email protected]> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <[email protected]> Signed-off-by: Damian Krolik <[email protected]> Co-authored-by: Marcin Kajor <[email protected]> Co-authored-by: Kamil Kasperczyk <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/sdk-connectedhomeip
that referenced
this issue
Jan 16, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/sdk-connectedhomeip
that referenced
this issue
Jan 17, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/sdk-connectedhomeip
that referenced
this issue
Jan 17, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
Damian-Nordic
pushed a commit
to Damian-Nordic/sdk-connectedhomeip
that referenced
this issue
Feb 21, 2023
This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. Signed-off-by: Stephanos Ioannidis <[email protected]>
kkasperczyk-no
added a commit
to kkasperczyk-no/sdk-connectedhomeip
that referenced
this issue
Mar 15, 2023
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <[email protected]> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <[email protected]> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <[email protected]> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <[email protected]> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <[email protected]> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <[email protected]> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <[email protected]> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <[email protected]> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <[email protected]> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <[email protected]> Signed-off-by: Damian Krolik <[email protected]> Co-authored-by: Marcin Kajor <[email protected]> Co-authored-by: Kamil Kasperczyk <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
kkasperczyk-no
added a commit
to kkasperczyk-no/sdk-connectedhomeip
that referenced
this issue
Mar 15, 2023
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <[email protected]> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <[email protected]> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <[email protected]> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <[email protected]> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <[email protected]> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <[email protected]> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <[email protected]> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <[email protected]> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <[email protected]> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <[email protected]> Signed-off-by: Damian Krolik <[email protected]> Co-authored-by: Marcin Kajor <[email protected]> Co-authored-by: Kamil Kasperczyk <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
lecndav
pushed a commit
to lecndav/connectedhomeip
that referenced
this issue
Mar 22, 2023
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <[email protected]> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <[email protected]> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <[email protected]> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <[email protected]> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <[email protected]> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <[email protected]> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <[email protected]> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <[email protected]> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <[email protected]> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <[email protected]> Signed-off-by: Damian Krolik <[email protected]> Co-authored-by: Marcin Kajor <[email protected]> Co-authored-by: Kamil Kasperczyk <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
krish2718
pushed a commit
to krish2718/sdk-hostap
that referenced
this issue
Mar 27, 2023
As per [1], newlibc now defines _ANSI_SOURCE to avoid POSIX conflicts, but as hostapd needs POSIX stuff from libc, need to enable this explicitly. [1] - zephyrproject-rtos/zephyr#52739 Signed-off-by: Krishna T <[email protected]>
krish2718
pushed a commit
to krish2718/sdk-hostap
that referenced
this issue
Mar 27, 2023
As per [1], newlibc now defines _ANSI_SOURCE to avoid POSIX conflicts, but as hostapd needs POSIX stuff from libc, need to enable this explicitly. [1] - zephyrproject-rtos/zephyr#52739 Signed-off-by: Krishna T <[email protected]>
coreboot-org-bot
pushed a commit
to coreboot/chrome-ec
that referenced
this issue
Oct 25, 2023
Newlib's `string.h` declares `strnlen()` function only when _GNU_SOURCE, _DEFAULT_SOURCE or _POSIX_C_SOURCE is defined. Zephyr intentionally disables POSIX declarations by defining _ANSI_SOURCE to avoid conflicts with Zephyr POSIX library and networking subsystem [1]. It's still possible to use `strnlen()` from Newlib, we just need to define _POSIX_C_SOURCE to 200809. [1] zephyrproject-rtos/zephyr#52739 BUG=b:299924239 TEST=zmake build bloonchipper Change-Id: I8cd966cd0097dfc5bf72fb9db6db6e20d96f6dee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4973835 Commit-Queue: Patryk Duda <[email protected]> Code-Coverage: Zoss <[email protected]> Tested-by: Patryk Duda <[email protected]> Reviewed-by: Sung-Chi Li <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Networking
area: newlib
Newlib C Standard Library
area: POSIX
POSIX API Library
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Describe the bug
Newlib attempts to provide POSIX primitives in its headers when
-std=gnu
, which leads to various conflicts with the POSIX primitives provided by the Zephyr POSIX library and the networking subsystem (sockets).To Reproduce
Build
samples/net/sockets/echo
forqemu_cortex_m3
with the following patch:Expected behavior
Newlib should not define POSIX primitives unless the feature test macros such as
_POSIX_SOURCE
,_GNU_SOURCE
and_DEFAULT_SOURCE
, are explicitly defined by the user.Note that
-std=gnu
should not imply_GNU_SOURCE
or_DEFAULT_SOURCE
because it merely specifies the language dialect (i.e. GNU C language extensions) to be used.Impact
Unable to build applications that make use of Zephyr POSIX library and networking sockets with
-std=gnu
.Logs and console output
Environment (please complete the following information):
Additional context
Note that:
-std=c99
by default and this results in GCC defining__STRICT_ANSI__
.-std=gnu99
,__STRICT_ANSI__
is not defined.Newlib
features.h
, when neither__STRICT_ANSI__
nor any of the feature test macros is explicitly defined, assumes the "default source" feature set and defines_DEFAULT_SOURCE
, which implies POSIX and BSD feature sets:Newlib
sys/types.h
defines various POSIX/BSD primitives and includessys/select.h
when__BSD_VISIBLE
is true:Newlib
sys/select.h
, included bysys/types.h
, defines the FD macros that are in conflict with the Zephyr-side FD macros:The text was updated successfully, but these errors were encountered: