Commit Graph

41 Commits

Author SHA1 Message Date
SPRESENSE 53bbf797da libcxx: Apply 0001_fix_stdatomic_h_miss_typedef.patch to libcxx.defs
0001_fix_stdatomic_h_miss_typedef.patch is only applied to cmake,
so apply it to Makefile as well.
2024-09-27 17:10:17 +08:00
Petro Karashchenko 5495ff4d78 libs/libxx: add patch to remove mach/mach_time.h inclusion
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>
2024-02-16 10:42:23 -08:00
YAMAMOTO Takashi 3e4bc9bcef libcxx.defs: appease "expr: syntax error" messages with clang 2024-01-04 13:01:42 +01:00
ThomasNS 224be61f5a upgrade llvm version to 17.0.6 and set default nuttx math lib as default 2023-12-17 03:39:26 -08:00
Stuart Ianna ad9f6b79e0 libs/libcxx: Silence warnings when building libcxx.
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.
2023-10-26 09:07:17 +02:00
Lee Lup Yuen 6cad7e9582 arm, arm64, xtensa, libxx: Change sed -r to sed -E to support macOS
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
2023-10-10 11:36:32 +03:00
Xiang Xiao 381c7dd747 Fix error: unknown warning option '-Wno-unqualified-std-cast-call'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-24 08:40:10 +03:00
Stuart Ianna 4f90a6140c 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
2023-09-24 08:40:10 +03:00
Petro Karashchenko 587f01a5e2 libs/libxx/libcxx: fix CI compilation issue reported on MACOS
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-19 01:17:17 +08:00
wangming9 61a38ca680 libs/libxx/libcxx: Fix compilation warnings
Summary
Workaround the following warning with "GCC 12"
CXX:  libcxxabi/src/cxa_demangle.cpp In file included from libcxx/src/locale.cpp:15:
In member function 'std::__1::_EnableIf<std::__1::__is_cpp17_forward_iterator<_ForwardIterator>::value> std::__1::basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = const wchar_t*; _CharT = wchar_t; _Traits = std::__1::char_traits<wchar_t>; _Allocator = std::__1::allocator<wchar_t>]',    inlined from 'std::__1::basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator, _InputIterator) [with _InputIterator = const wchar_t*; <template-parameter-2-2> = void; _CharT = wchar_t; _Traits = std::__1::char_traits<wchar_t>; _Allocator = std::__1::allocator<wchar_t>]' at include/libcxx/string:2182:11,
    inlined from 'virtual int std::__1::collate_byname<wchar_t>::do_compare(const char_type*, const char_type*, const char_type*, const char_type*) const' at libcxx/src/locale.cpp:764:33:
include/libcxx/string:2156:35: warning: 'lhs' may be used uninitialized [-Wmaybe-uninitialized]
 2156 |         this->__throw_length_error();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~

include/libcxx/new:237:24: warning: argument 1 value '18446744073709551599' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  237 |   return ::operator new(__args...);
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-09-09 17:08:23 +03:00
chao an ba2601deb6 Toolchain: strict GCC version check from GCC-12.2 to GCC-12
Toolchain related detection errors are still not resolved on GCC-12.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-23 23:52:17 +08:00
chao an b8780fe906 arch/arm: relax compiler check for workaround with "GCC 12.2"
1. relax compiler check for workaround with "GCC 12.2"
2. export GCCVER to environment

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-24 19:00:52 +03:00
Petro Karashchenko a261439b8b libs/libx: relax compiler check for workaround with "GCC 12.2"
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-21 21:59:30 -03:00
Karel Kočí 62661600b2 treewide: add DOWNLOAD variable as unification of curl call
This is a followup to the commit
03b164f59c.
2023-03-08 17:05:05 +08:00
YAMAMOTO Takashi e9158efd42 libcxx.defs: Disable a warning and explain why 2023-02-27 23:55:52 +08:00
chao an 5fac313df7 libs/libxx: Fix typo in shell expressions
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-22 01:05:46 +08:00
chao an 1d41182755 libs/libxx: check GCC version before set special flags
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-21 15:33:18 +08:00
chao an e29d275ef8 libs/libcxx: Workaround -Wmaybe-uninitialized warning with "GCC 12.2"
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-20 19:26:55 +08:00
Xiang Xiao f64da13e9b libxx: Add CXX_STANDARD to select -std=c++??
and default to "c++17"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 15:41:57 +02:00
yinshengkai 95d9abcf58 tools: replace DEFINE script to Makefile variable
In the past, predefined macros were generated by define.sh scripts
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
Huang Qi e0185faa78 Don't download tarballs if a local git repo found
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-28 03:07:58 +08:00
Xiang Xiao c1e5ba4602 libxx: Always build libcxx with -std=c++17
since the implementation of barrier require
the aligned new which is defined in C++ 17

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-29 21:08:14 -03:00
Gustavo Henrique Nihei 0bd436c8db libcxx: Fix libc++ for archs without conditional load/store support
This commit brings a patch already merged to upstream LLVM project:
https://reviews.llvm.org/D118391

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-03-30 11:19:29 +08:00
Gustavo Henrique Nihei 8a215b60af libcxx: Add patch for preventing redefinition of PS macro on Xtensa
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-03-30 11:19:29 +08:00
Xiang Xiao ce73f9cbfc libxx: Move libcxxabi special setting from libcxx.defs to libcxxabi.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-30 10:44:24 +02:00
Xiang Xiao 397d329966 libxx: Give VERSION make variable prefix to avoid the conflict
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-30 10:44:24 +02:00
Xiang Xiao bdc86e85d7 libcxx: Avoid the waring: "__EXCEPTIONS" is not defined, evaluates to 0 [-Werror=undef]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 17:13:43 -03:00
zhuyanlin f2fe51c22d libc:libcxx: add support for libcxxabi.
libcxxabi is either-or select with glibcxx.

Change-Id: I4fbea19f0648ddc318379dd43bac8406f7c86927
2021-08-26 19:32:24 +08:00
Abdelatif Guettouche 15fb70cb00 libs/libxx: Download C++ libraries during context.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-19 03:05:54 -07:00
Xiang Xiao 3c400f32fa Remove the locale fallback from libcxx
since these functions can handled by NuttX's libc now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-30 09:43:26 -03:00
SPRESENSE 25b7bdf943 libs/libxx/libcxx.defs: Fix build error on Windows platform
The libcxx-X.Y.Z.src.tar.xz contains a symbolic link to a directory
that not exist as below.

`libcxx-X.Y.Z.src/test/std/pstl -> ../../../pstl/test/std`

Linux and macOS environment have no problem, but it causes an error
when extracting tarball on Windows platform. This symbolic link is not
actually used, so exclude it from extracting the tarball.
2021-07-21 08:59:22 -07:00
Xiang Xiao a81166aef6 Update libcxx to 12.0.0 release
and remove the temporary patch since all patch is in the mainline now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-16 01:18:41 -07:00
YAMAMOTO Takashi b41524f0e6 libcxx: -Wno-shadow for files including filesystem_common.h
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.
2020-12-24 21:57:39 -06:00
YAMAMOTO Takashi 6481b774e4 libcxx: Disable -Wshadow for locale.cpp
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.

libcxx/src/locale.cpp: In member function 'void std::__1::locale::__install_ctor(const std::__1::locale&, std::__1::locale::facet*, long int)':
libcxx/src/locale.cpp:576:62: warning: declaration of 'id' shadows a member of 'std::__1::locale' [-Wshadow]
  576 | locale::__install_ctor(const locale& other, facet* f, long id)
      |                                                              ^
In file included from /Users/yamamoto/git/nuttx/nuttx/include/libcxx/locale:181,
                 from libcxx/src/locale.cpp:16:
/Users/yamamoto/git/nuttx/nuttx/include/libcxx/__locale:203:32: note: shadowed declaration is here
  203 | class _LIBCPP_TYPE_VIS locale::id
      |                                ^~
2020-12-24 21:57:39 -06:00
YAMAMOTO Takashi 884882501c libcxx: Disable -Wshadow for barrier.cpp
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.

libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   35 |         : __expected(__expected)
      |         ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   44 |     }
      |     ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   44 |     }
      |     ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
CXX:  libcxx/src/new.cpp
In file included from libcxx/src/new.cpp:19:
/usr/include/c++/9/cxxabi.h: In member function 'virtual bool __cxxabiv1::__pbase_type_info::__pointer_catch(const __cxxabiv1::__pbase_type_info*, void**, unsigned int) const':
/usr/include/c++/9/cxxabi.h:308:23: error: 'const class std::type_info' has no member named '__do_catch'
  308 |     return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
      |                       ^~~~~~~~~~
2020-12-24 21:57:39 -06:00
Huang Qi 073912e232 Replace all wget with curl
wget is missing from some system (like macOS and Windows native),
it's better to use curl to simplify build environment.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-22 03:36:10 -06:00
YAMAMOTO Takashi b1878fe099 libcxx: Don't remove the downloaded file eagerly
It's convenient during development.
Also, it can be useful for offline builds.
2020-12-20 23:16:11 -06:00
YAMAMOTO Takashi dfa2949b69 libcxx: Make download+patch a separate target
So that it doesn't need to be done on every sethost.sh.
2020-12-20 23:16:11 -06:00
Xiang Xiao 8bc4a5b08a [libc++] Cherry pick patches from mainline to fix warnings
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-15 08:28:36 -03:00
Xiang Xiao c67da1d2b5 libxx: Switch the package downloading from 11.0.0.rc1 to 11.0.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-12 20:33:55 +01:00
Xiang Xiao 6039fb48ae libxx: Integrate libc++ latest official release
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0a5f6dd8504382c49546c05399c2ea6470cd528
2020-08-17 13:45:56 -03:00