Skip to content

Revert "lib: newlib: Add workaround for #38258" #38733

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Sep 24, 2021
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 cmake/verify-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# FORMAT=json: Print the output as a json formatted string, useful for Python

# This is the minimum required Zephyr-SDK version which supports CMake package
set(TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION 0.13)
set(TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION 0.13.1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have earlier limited the requested Zephyr SDK based on arch when the SDK was a minor bump affecting only some architectures like here:

if("${ARCH}" STREQUAL "arm64")
set(TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION 0.12.4)
else()
set(TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION 0.12)
endif()

but as Zephyr 0.13.1 affects both xtensa and arm i'm also fine with just bumping for everyone.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so just placing this comment to get general opinions from everyone.


# Set internal variables if set in environment.
if(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT)
Expand Down
14 changes: 0 additions & 14 deletions lib/libc/newlib/libc-hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,6 @@ static int malloc_prepare(const struct device *unused)
"minimum required size specified by "
"CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE");

#ifdef CONFIG_XTENSA
/*
* FIXME: For Xtensa, the first `malloc` call may fail if the HEAP_BASE
* is such that the first `sbrk` call returns a 4096-byte
* aligned address.
*
* This is a very ugly workaround for the issue #38258 and must
* be removed once it is fixed.
*/
void *ptr = malloc(16);

free(ptr);
#endif /* CONFIG_XTENSA */

return 0;
}

Expand Down