Skip to content

[BUG] cmath incompatible with external toolchain libraries #18232

@snikeguo

Description

@snikeguo

Description / Steps to reproduce the issue

nvironment:

NuttX + arm-none-eabi-gcc 13.3.1
Must use toolchain's standard math and C++ libraries (not NuttX's built-in versions /llvm /uclib/nuttx math lib):

CONFIG_LIBM_TOOLCHAIN=y
CONFIG_LIBCXXTOOLCHAIN=y
CONFIG_LIBSUPCXX_TOOLCHAIN=y

demo:

#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main() { 
    return 0; 
}

build log:

In file included from D:/Soft/ArmGcc/xpack-arm-none-eabi-gcc-13.3.1-1.1/arm-none-eabi/include/c++/13.3.1/math.h:36,
                 from D:/Project/runtime_nuttx/src/nuttx_workspace/apps/ics/NativeAot/user_code/usercode.cpp:177:
D:/Project/runtime_nuttx/src/nuttx_workspace/nuttx/include/cxx/cmath:47:11: error: 'float_t' has not been declared in '::'
   47 |   using ::float_t;
      |           ^~~~~~~
D:/Project/runtime_nuttx/src/nuttx_workspace/nuttx/include/cxx/cmath:48:11: error: 'double_t' has not been declared in '::'
   48 |   using ::double_t;
      |           ^~~~~~~~
D:/Project/runtime_nuttx/src/nuttx_workspace/nuttx/include/cxx/cmath:51:11: error: 'acosf' has not been declared in '::'
   51 |   using ::acosf;

On which OS does this issue occur?

[OS: Windows]

What is the version of your OS?

win11

NuttX Version

mastere

Issue Architecture

[Arch: arm]

Issue Area

[Area: OS Components]

Host information

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

Labels

Arch: armIssues related to ARM (32-bit) architectureArea: OS ComponentsOS Components issuesOS: WindowsIssues related to Windows (building system, etc)Type: BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions