Skip to content

QuickJS Compilation Error #181

@amir1387aht

Description

@amir1387aht

Answers checklist.

  • I have read the documentation SiFli-SDK Programming Guide and the issue is not addressed there.
  • I have updated my SiFli-SDK branch (main or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

SiFli-SDK version.

v2.4.2

Operating System used.

Windows

What is the expected behavior?

Hi everyone, recently i tried to add QuickJs to my project but i got some build error when compiling, I'm doing something wrong?

What is the actual behavior?

Compile Error

Steps to reproduce.

Enabling QuickJS

Image

Build or installation Logs.

D:\SiFli-SDK\external\quickjs\qjs.c:CC build_eh-lb525_hcpu\sifli_sdk\external\quickjs\quickjs-libc.o
 In function 'main':
D:\SiFli-SDK\external\quickjs\qjs.c:470:9: error: 'load_jscalc' undeclared (first use in this function)
  470 |     if (load_jscalc)
      |         ^~~~~~~~~~~
D:\SiFli-SDK\external\quickjs\qjs.c:470:9: note: each undeclared identifier is reported only once for each function it appears in
D:\SiFli-SDK\external\quickjs\qjs.c:471:9: error: 'bignum_ext' undeclared (first use in this function)
  471 |         bignum_ext = 1;
      |         ^~~~~~~~~~
CC build_eh-lb525_hcpu\sifli_sdk\middleware\app_fwk\app_schedule.o
CC build_eh-lb525_hcpu\sifli_sdk\middleware\app_fwk\app_schedule_port.o
scons: *** [build_eh-lb525_hcpu\sifli_sdk\external\quickjs\qjs.o] Error 1
D:\SiFli-SDK\external\quickjs\quickjs.c: In function 'find_line_num':
D:\SiFli-SDK\external\quickjs\quickjs.c:6463:31: error: passing argument 1 of 'get_sleb128' from incompatible pointer type [-Wincompatible-pointer-types]
 6463 |             ret = get_sleb128(&v, p, p_end);
      |                               ^~
      |                               |
      |                               int *
D:\SiFli-SDK\external\quickjs\quickjs.c:6424:33: note: expected 'int32_t *' {aka 'long int *'} but argument is of type  int *'
 6424 | static int get_sleb128(int32_t *pval, const uint8_t *buf,
      |                        ~~~~~~~~~^~~~
In file included from D:\SiFli-SDK\rtos\rtthread\include/rtlibc.h:21,
                 from D:\SiFli-SDK\rtos\rtthread\include/rtdef.h:1179,
                 from D:\SiFli-SDK\rtos\rtthread\include/rtthread.h:23,
                 from D:\SiFli-SDK\external\quickjs\cutils.h:28,
                 from D:\SiFli-SDK\external\quickjs\quickjs-libc.c:77:
D:\SiFli-SDK\rtos\rtthread\include/libc/libc_signal.h:57:9: warning: "SI_USER" redefined
   57 | #define SI_USER     0x01    /* Signal sent by kill(). */
      |         ^~~~~~~
In file included from C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/signal.h:6,
                 from D:\SiFli-SDK\external\quickjs\quickjs-libc.c:37:
C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/sys/signal.h:63:9: note: this is the location of the previous definition
   63 | #define SI_USER    1    /* Sent by a user. kill(), abort(), etc */
      |         ^~~~~~~
D:\SiFli-SDK\rtos\rtthread\include/libc/libc_signal.h:58:9: warning: "SI_QUEUE" redefined
   58 | #define SI_QUEUE    0x02    /* Signal sent by sigqueue(). */
      |         ^~~~~~~~
C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/sys/signal.h:64:9: note: this is the location of the previous definition
   64 | #define SI_QUEUE   2    /* Sent by sigqueue() */
      |         ^~~~~~~~
D:\SiFli-SDK\rtos\rtthread\include/libc/libc_signal.h:59:9: warning: "SI_TIMER" redefined
   59 | #define SI_TIMER    0x03    /* Signal generated by expiration of a
      |         ^~~~~~~~
C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/sys/signal.h:65:9: note: this is the location of the previous definition
   65 | #define SI_TIMER   3    /* Sent by expiration of a timer_settime() timer */
      |         ^~~~~~~~
D:\SiFli-SDK\rtos\rtthread\include/libc/libc_signal.h:61:9: warning: "SI_ASYNCIO" redefined
   61 | #define SI_ASYNCIO  0x04    /* Signal generated by completion of an
      |         ^~~~~~~~~~
C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/sys/signal.h:66:9: note: this is the location of the previous definition
   66 | #define SI_ASYNCIO 4    /* Indicates completion of asycnhronous IO */
      |         ^~~~~~~~~~
D:\SiFli-SDK\rtos\rtthread\include/libc/libc_signal.h:63:9: warning: "SI_MESGQ" redefined
   63 | #define SI_MESGQ    0x05    /* Signal generated by arrival of a
      |         ^~~~~~~~
C:/Users/NIKCOM/.sifli/tools/arm-none-eabi-gcc/14.2.1/arm-none-eabi/include/sys/signal.h:67:9: note: this is the location of the previous definition
   67 | #define SI_MESGQ   5    /* Indicates arrival of a message at an empty queue */
      |         ^~~~~~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_std_exit':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:381:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
  381 |     if (JS_ToInt32(ctx, &status, argv[0]))
      |                         ^~~~~~~
      |                         |
      |                         int *
In file included from D:\SiFli-SDK\external\quickjs\quickjs-libc.h:30,
                 from D:\SiFli-SDK\external\quickjs\quickjs-libc.c:79:
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_os_open':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1664:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1664 |     if (JS_ToInt32(ctx, &flags, argv[1]))
      |                         ^~~~~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1667:29: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1667 |         if (JS_ToInt32(ctx, &mode, argv[2])) {
      |                             ^~~~~
      |                             |
      |                             int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_os_close':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1689:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1689 |     if (JS_ToInt32(ctx, &fd, argv[0]))
      |                         ^~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_os_seek':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1702:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1702 |     if (JS_ToInt32(ctx, &fd, argv[0]))
      |                         ^~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1707:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1707 |     if (JS_ToInt32(ctx, &whence, argv[2]))
      |                         ^~~~~~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_os_read_write':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1727:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1727 |     if (JS_ToInt32(ctx, &fd, argv[0]))
      |                         ^~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs-libc.c: In function 'js_os_mkdir':
D:\SiFli-SDK\external\quickjs\quickjs-libc.c:1829:29: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
 1829 |         if (JS_ToInt32(ctx, &mode, argv[1]))
      |                             ^~~~~
      |                             |
      |                             int *
D:\SiFli-SDK\external\quickjs\quickjs.h:683:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
  683 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val);
      |                                ~~~~~~~~~^~~~
scons: *** [build_eh-lb525_hcpu\sifli_sdk\external\quickjs\quickjs-libc.o] Error 1
D:\SiFli-SDK\external\quickjs\quickjs.c: In function 'js_parseInt':
D:\SiFli-SDK\external\quickjs\quickjs.c:40094:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
40094 |     if (JS_ToInt32(ctx, &radix, argv[1])) {
      |                         ^~~~~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.c:10998:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
10998 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val)
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs.c: In function 'js_math_imul':
D:\SiFli-SDK\external\quickjs\quickjs.c:41979:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
41979 |     if (JS_ToInt32(ctx, &a, argv[0]))
      |                         ^~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.c:10998:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
10998 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val)
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs.c:41981:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
41981 |     if (JS_ToInt32(ctx, &b, argv[1]))
      |                         ^~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.c:10998:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
10998 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val)
      |                                ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs.c: In function 'remainingElementsCount_add':
D:\SiFli-SDK\external\quickjs\quickjs.c:46869:29: error: passing argument 2 of 'JS_ToInt32Free' from incompatible pointer type [-Wincompatible-pointer-types]
46869 |     if (JS_ToInt32Free(ctx, &remainingElementsCount, val))
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             int *
D:\SiFli-SDK\external\quickjs\quickjs.c:10937:52: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
10937 | static int JS_ToInt32Free(JSContext *ctx, int32_t *pres, JSValue val)
      |                                           ~~~~~~~~~^~~~
D:\SiFli-SDK\external\quickjs\quickjs.c: In function 'js_promise_all_resolve_element':
D:\SiFli-SDK\external\quickjs\quickjs.c:46897:25: error: passing argument 2 of 'JS_ToInt32' from incompatible pointer type [-Wincompatible-pointer-types]
46897 |     if (JS_ToInt32(ctx, &index, func_data[1]))
      |                         ^~~~~~
      |                         |
      |                         int *
D:\SiFli-SDK\external\quickjs\quickjs.c:10998:41: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
10998 | int JS_ToInt32(JSContext *ctx, int32_t *pres, JSValueConst val)
      |                                ~~~~~~~~~^~~~
scons: *** [build_eh-lb525_hcpu\sifli_sdk\external\quickjs\quickjs.o] Error 1
scons: building terminated because of errors.

More Information.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    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