ld error caused by multiple definition:
ld: arm-none-eabi/lib/thumb/v8-m.main+fp/hard/libsupc++.a(atexit_arm.o): in function `__aeabi_atexit':
atexit_arm.cc:(.text.__aeabi_atexit+0x0): multiple definition of `__aeabi_atexit';
nuttx/staging/libxx.a(libxx_eabi_atexit.o):nuttx/libs/libxx/libxx_eabi_atexit.cxx:75: first defined here
Signed-off-by: chao.an <anchao@xiaomi.com>
Summary:
- This commit fixes compile errors in libxx_new.cxx and libxx_newa.cxx
Impact:
- None
Testing:
- Build with spresense:nsh with CONFIG_DEBUG_ERROR=y
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
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
| ^~
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);
| ^~~~~~~~~~
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>
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:
1) Add source files by config symbol
2) Include header files in #ifdef directive
These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
because the logic:
1.only work on arm platform
2.couple with elf format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I25dc95b5fc7b24196e2e71fdcf82d71d621ee2d3
since sim arch has to use other instance provided by host glibc
also initialize __dso_handle to self as glibc:
https://github.com/bminor/glibc/blob/master/csu/dso_handle.c#L21
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7531ae58fc4dbe4600bcb2c2c3a6cac021378bc1
otherwise the user is shocked that using cin/cout/cerr will crash the system
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I453427261f3e2a6e60f7dd2398f7d3bd1043a0d5
to avoid the similar code spread around each application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
* include: Introduce elf64.h and elf.h
Added elf64.h for 64bit ELF support and moved common definitions
from elf32.h to elf.h. Also introduced Elf_xxx to be used in
common libraries such as binfmt.
* binfmt, include, modlib, module: Add support for ELF64
Elf_xxx must be used instead of Elf32_xxx to support ELF64.
To use ELF64, CONFIG_ELF_64BIT must be enabled.
* binfmt, modlib: Add support for relocate address
* arch: risc-v: Add include/elf.h
* libs: machine: Add risc-v related files.
NOTE: Currently only supports ELF64
* boards: maix-bit: Add elf and posix_spawn configurations
* boards: maix-bit: Add support for module configuration
Gregory Nutt <gnutt@nuttx.org>
Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.
Xiang Xiao <xiaoxiang@xiaomi.com>
Remove TIME_EXTENDED option to more conform C standard
Note: the code/data size increment is small
math library is also needed, however, here are various ways to provide a
math library so CONFIG_LIBM is not now set.
boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs: Add required
definitiions if libcxx is enabled.
Remove hardcoded -DCLOCK_MONOTONIC from CFLAGS in Make.defs of several configurations. That defintiion is now automatically adding this define when CONFIG_LIBCXX=y.