LD: nuttx
arm-none-eabi-ld: warning: net_sendfile.o: missing .note.GNU-stack section implies executable stack
arm-none-eabi-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
arm-none-eabi-ld: warning: nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: apps/staging/libfeature.a(feature_framework.cpp.frameworks.base.feature_1.o): in function `std::__1::__throw_length_error[abi:un170006](char const*)':
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
enable LIBSUPCXX:
text data bss dec hex filename
93080 592 5472 99144 18348 nuttx/nuttx
enable LIBCXXABI:
before:
text data bss dec hex filename
126468 352 5960 132780 206ac nuttx/nuttx
after:
text data bss dec hex filename
68048 352 5960 74360 12278 nuttx/nuttx
Summary:
Optimize text segment code size by about 46%.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f.
parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.
libcxx depends on pthread_key_create
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
In the following code, even though the application does not use exceptions, an exception is still thrown in libcxx
If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.
Therefore, we need to use libcxxabi to ensure normal functions in a multi-threaded environment.
using namespace std;
void foo(bool recur);
int bar(bool recur)
{
if (recur) {
foo(false);
}
return 0xFAFAFA;
}
void foo(bool recur)
{
static int i = bar(recur);
cout << "Static is:" << i << "\n";
}
int main(int argc, char *argv[])
{
foo(true);
return 0;
}
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Because `set_source_files_properties` in cmake will overwrite the properties instead of appending them.
This module implements addition and deletion by
first `getting_source_file_property` and then `set_source_files_properties`
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
./helloxx_main.cxx:29:10: fatal error: cxxabi.h: No such file or directory
29 | #include <cxxabi.h>
| ^~~~~~~~~~
CONFIG_LIBCXXABI is turned on, but the library include is not linked to nuttx/include, causing the compilation to fail.
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
Inclusion of mach/mach_time.h by libcxx/src/chrono.cpp breaks
the build on latest MACOS dues to https://forums.developer.apple.com/forums/thread/746737
The interface from mach/mach_time.h is not referenced in chrono.cpp
so it is safe to remove it
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
It seems libcxx needs C++20 from 12.0.0 to 17.0.6: 3b625060fc
But we're setting CMAKE_CXX_STANDARD to 17, errors on my side:
nuttx/libs/libxx/libcxx/src/include/to_chars_floating_point.h:122:46: error: ‘bit_cast’ is not a member of ‘std’
122 | const _Uint_type _Uint_value = _VSTD::bit_cast<_Uint_type>(_Value);
| ^~~~~~~~
nuttx/libs/libxx/libcxx/src/memory_resource_init_helper.h:2:8: error: ‘constinit’ does not name a type
2 | static constinit ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
| ^~~~~~~~~
nuttx/libs/libxx/libcxx/src/memory_resource_init_helper.h:2:8: note: C++20 ‘constinit’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This tries to mirror the following change.
```
commit c260fee516
Author: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Date: Tue Aug 31 14:47:13 2021 -0300
libs/libxx: Enforce RTTI for building libcxxabi
It is okay for the application to be built without RTTI (-fno-rrti), but
libcxxabi requires RTTI at least for the library.
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
```
the patch has been removed in the following change.
```
commit 4f90a6140c
Author: Stuart Ianna <stuart.ianna@motec.com.au>
Date: Mon Jan 23 09:08:00 2023 +1100
libcxx: Remove exiting patches and update libcxx version to 15.0.7
- Add __config_site for NuttX.
In libcxx 12.0.0. CMake concatenated __config_site with _config,
which enabled NuttX to build without its inclusion. In 15.0.7, this
file is configured by CMake and included explicitly in __config.
- Add additional include directories.
- Mute always_inline warning.
- Make the download of libcxx/libcxxabi configurable
```
Silence two warnings when building libcxx with GCC 12.2.0 and std=c++2b:
libcxx/src/charconv.cpp_CXXFLAGS += -Wno-attributes
- Results from libcxx fallback to use __always_inline__ when exclude_from_explicit_instantiation isn't available.
libcxx/src/locale.cpp_CXXFLAGS += -Wno-attributes
- Results from the expansion of _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS. Should be fine to ignore.
When we build NuttX on macOS, it shows many `sed` messages (and the build still completes successfully):
```text
$ tools/configure.sh pinephone:nsh
$ make
sed: illegal option -- r
```
This is due to the Makefiles executing `sed -r` which is not a valid option on macOS.
This PR proposes to change `sed -r` to `sed -E` because:
- `sed -E` on macOS is equivalent to `sed -r` on Linux
- `sed -E` and `sed -r` are aliases according to the GNU `sed` Manual
- `sed -E` is already used in nuttx_add_romfs.cmake, nuttx_add_symtab.cmake and process_config.sh
- Add __config_site for NuttX.
In libcxx 12.0.0. CMake concatenated __config_site with _config,
which enabled NuttX to build without its inclusion. In 15.0.7, this
file is configured by CMake and included explicitly in __config.
- Add additional include directories.
- Mute always_inline warning.
- Make the download of libcxx/libcxxabi configurable