Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/tcc-0.9.27
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/tcc-0.9.27/tests/libtcc_test.c

    r321 r331  
    1616}
    1717
     18/* this strinc is referenced by the generated code */
     19const char hello[] = "Hello World!";
     20
    1821char my_program[] =
     22"#include <tcclib.h>\n" /* include the "Simple libc header for TCC" */
     23"extern int add(int a, int b);\n"
     24"#ifdef _WIN32\n" /* dynamically linked data needs 'dllimport' */
     25" __attribute__((dllimport))\n"
     26"#endif\n"
     27"extern const char hello[];\n"
    1928"int fib(int n)\n"
    2029"{\n"
     
    2736"int foo(int n)\n"
    2837"{\n"
    29 "    printf(\"Hello World!\\n\");\n"
     38"    printf(\"%s\\n\", hello);\n"
    3039"    printf(\"fib(%d) = %d\\n\", n, fib(n));\n"
    3140"    printf(\"add(%d, %d) = %d\\n\", n, 2 * n, add(n, 2 * n));\n"
     
    3645{
    3746    TCCState *s;
     47    int i;
    3848    int (*func)(int);
    3949
     
    4555
    4656    /* if tcclib.h and libtcc1.a are not installed, where can we find them */
    47     if (argc == 2 && !memcmp(argv[1], "lib_path=",9))
    48         tcc_set_lib_path(s, argv[1]+9);
     57    for (i = 1; i < argc; ++i) {
     58        char *a = argv[i];
     59        if (a[0] == '-') {
     60            if (a[1] == 'B')
     61                tcc_set_lib_path(s, a+2);
     62            else if (a[1] == 'I')
     63                tcc_add_include_path(s, a+2);
     64            else if (a[1] == 'L')
     65                tcc_add_library_path(s, a+2);
     66        }
     67    }
    4968
    5069    /* MUST BE CALLED before any compilation */
     
    5473        return 1;
    5574
    56     /* as a test, we add a symbol that the compiled program can use.
     75    /* as a test, we add symbols that the compiled program can use.
    5776       You may also open a dll with tcc_add_dll() and use symbols from that */
    5877    tcc_add_symbol(s, "add", add);
     78    tcc_add_symbol(s, "hello", hello);
    5979
    6080    /* relocate the code */
Note: See TracChangeset for help on using the changeset viewer.