Skip to content

Commit

Permalink
greenhills: add empty "__extension__" definition to fix build error
Browse files Browse the repository at this point in the history
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has
          no storage class or type specifier
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
  ^

"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";"
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                         ^

"libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";"
    {
    ^

"libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts
          here after previous syntax error
  }

Signed-off-by: guoshichao <[email protected]>
  • Loading branch information
extinguish committed Aug 10, 2024
1 parent ffb01e6 commit 990b061
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@

#if defined(__ghs__)

# define __extension__

/* the following function is not truly need in runtime, and in order to fix
* undefined symbol link error, we need to make the following symbols as weak
*/

# pragma weak __gh_long_long_printf
# pragma weak __gh_float_printf
# pragma weak __gh_fputs_stdout
Expand Down

0 comments on commit 990b061

Please sign in to comment.