tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] What is the exact Darwin port status? (i.e. macOS)


From: Christian Jullien
Subject: [Tinycc-devel] What is the exact Darwin port status? (i.e. macOS)
Date: Sun, 26 Feb 2017 07:50:24 +0100

Many times in past years I’ve seen questions and threads about tcc and macOS.

 

Someone gave me this week a not so old mac laptop I installed with Sierra to give a try and, if possible, add support for 0.9.27.

 

The real question before going further:

Is Darwin a support tcc environment (with possible limitations) and who is the maintainer?

 

Things are not really good, see below:

 

System and cc:

byas:tinycc jullien$ cc -v

Apple LLVM version 8.0.0 (clang-800.0.42.1)

Target: x86_64-apple-darwin16.4.0

Thread model: posix

InstalledDir: /Library/Developer/CommandLineTools/usr/bin

 

byas:tinycc jullien$ uname -a

Darwin byas.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

 

Configure:

byas:tinycc jullien$ ./configure

Binary  directory   /usr/local/bin

TinyCC directory    /usr/local/lib/tcc

Library directory   /usr/local/lib

Include directory   /usr/local/include

Manual directory    /usr/local/share/man

Info directory      /usr/local/share/info

Doc directory       /usr/local/share/doc

Target root prefix  -

Source path         /Users/jullien/tinycc

C compiler          gcc

Target OS           Darwin

CPU                 x86_64

Big Endian          no

Profiling           no

Cross compilers     no

Use libgcc          no

Triplet             -

Creating config.mak and config.h

 

Trying to build:

Some warnings because of clang, but … Ok

byas:tinycc jullien$ make

gcc -o tcc.o -c tcc.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o libtcc.o -c libtcc.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o tccpp.o -c tccpp.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

tccpp.c:2618:32: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer

      types with different sign [-Wpointer-sign]

            cstr_cat(&tokcstr, p1, len);

                               ^~

tccpp.c:347:50: note: passing argument to parameter 'str' here

ST_FUNC void cstr_cat(CString *cstr, const char *str, int len)

                                                 ^

tccpp.c:3733:19: warning: comparison of constant 11 with _expression_ of type 'enum (anonymous enum at ./tcc.h:708:5)' is always false

      [-Wtautological-constant-out-of-range-compare]

    if (s1->Pflag == 1 + 10)

        ~~~~~~~~~ ^  ~~~~~~

tccpp.c:1026:19: warning: unused function 'tok_size' [-Wunused-function]

static inline int tok_size(const int *p)

                  ^

3 warnings generated.

gcc -o tccgen.o -c tccgen.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o tccelf.o -c tccelf.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

tccelf.c:790:26: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign

      [-Wpointer-sign]

        relocate(s1, rel, type, ptr, addr, tgt);

                                ^~~

./tcc.h:1436:68: note: passing argument to parameter 'ptr' here

ST_FUNC void relocate(TCCState *s1, ElfW_Rel *rel, int type, char *ptr, addr_t addr, addr_t val);

                                                                   ^

1 warning generated.

gcc -o tccasm.o -c tccasm.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o tccrun.o -c tccrun.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o x86_64-gen.o -c x86_64-gen.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

gcc -o x86_64-link.o -c x86_64-link.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

./x86_64-link.c:178:33: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                    qrel->r_addend = read64le(ptr) + val;

                                              ^~~

./tcc.h:1489:48: note: passing argument to parameter 'p' here

static inline uint64_t read64le(unsigned char *p) {

                                               ^

./x86_64-link.c:182:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add64le(ptr, val);

                    ^~~

./tcc.h:1495:43: note: passing argument to parameter 'p' here

static inline void add64le(unsigned char *p, int64_t x) {

                                          ^

./x86_64-link.c:191:48: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                qrel->r_addend = (int)read32le(ptr) + val;

                                               ^~~

./tcc.h:1480:48: note: passing argument to parameter 'p' here

static inline uint32_t read32le(unsigned char *p) {

                                               ^

./x86_64-link.c:194:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, val);

                    ^~~

./tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

./x86_64-link.c:205:52: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                    qrel->r_addend = (int)read32le(ptr) + rel->r_addend;

                                                   ^~~

./tcc.h:1480:48: note: passing argument to parameter 'p' here

static inline uint32_t read32le(unsigned char *p) {

                                               ^

./x86_64-link.c:222:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, diff);

                    ^~~

./tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

./x86_64-link.c:228:23: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            write64le(ptr, val - rel->r_addend);

                      ^~~

./tcc.h:1492:45: note: passing argument to parameter 'p' here

static inline void write64le(unsigned char *p, uint64_t x) {

                                            ^

./x86_64-link.c:233:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, s1->got->sh_addr - addr +

                    ^~~

./tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

./x86_64-link.c:237:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, val - s1->got->sh_addr);

                    ^~~

./tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

./x86_64-link.c:241:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, s1->sym_attrs[sym_index].got_offset);

                    ^~~

./tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

10 warnings generated.

gcc -o i386-asm.o -c i386-asm.c -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning

clang: warning: -Wl,-flat_namespace,-undefined,warning: 'linker' input unused

In file included from i386-asm.c:233:

./x86_64-asm.h:94:28: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 4722439 to 3847

      [-Wconstant-conversion]

     DEF_ASM_OP0L(sysretq, 0x480f07, 0, 0)

     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

i386-asm.c:228:77: note: expanded from macro 'DEF_ASM_OP0L'

#define DEF_ASM_OP0L(name, opcode, group, instr_type) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 0 },

                                                      ~                     ^~~~~~

i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

In file included from i386-asm.c:233:

./x86_64-asm.h:121:25: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688702 to 4030

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movsbw, 0x660fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG16))

    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from i386-asm.c:233:

./x86_64-asm.h:378:22: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688512 to 3840

      [-Wconstant-conversion]

ALT(DEF_ASM_OP1(str, 0x660f00, 1, OPC_MODRM, OPT_REG16))

    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i386-asm.c:229:81: note: expanded from macro 'DEF_ASM_OP1'

#define DEF_ASM_OP1(name, opcode, group, instr_type, op0) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 1, { op0 }},

                                                          ~                     ^~~~~~

i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from i386-asm.c:233:

./x86_64-asm.h:428:23: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688726 to 4054

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movq, 0x660fd6, 0, OPC_MODRM, OPT_SSE, OPT_EA | OPT_SSE ))

    ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from i386-asm.c:233:

./x86_64-asm.h:429:23: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 15929214 to 3966

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movq, 0xf30f7e, 0, OPC_MODRM, OPT_EA | OPT_SSE, OPT_SSE ))

    ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

i386-asm.c:402:58: warning: passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types

      with different sign [-Wpointer-sign]

        } else if ((op->reg = asm_parse_numeric_reg(tok, &op->type)) >= 0) {

                                                         ^~~~~~~~~

i386-asm.c:281:46: note: passing argument to parameter 'type' here

static int asm_parse_numeric_reg(int t, int *type)

                                             ^

6 warnings generated.

ar rcs libtcc.a libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o tccrun.o x86_64-gen.o x86_64-link.o i386-asm.o

gcc -o tcc tcc.o libtcc.a -DTCC_TARGET_X86_64       -Wall -g -O2 -D_FORTIFY_SOURCE=0 -I.  -Wl,-flat_namespace,-undefined,warning -lm -ldl

./tcc -c ./lib/libtcc1.c -o libtcc1.o -DTCC_TARGET_X86_64 -B. -D_ANSI_SOURCE

./tcc -c ./lib/alloca86_64.S -o alloca86_64.o -DTCC_TARGET_X86_64 -B. -D_ANSI_SOURCE

./tcc -c ./lib/alloca86_64-bt.S -o alloca86_64-bt.o -DTCC_TARGET_X86_64 -B. -D_ANSI_SOURCE

./tcc -ar rcs libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o

 

What tcc knows (it thinks it is Linux, I can fix this one easily):

byas:tinycc jullien$ ./tcc -vv

tcc version 0.9.27 (x86_64 Linux)

install: /usr/local/lib/tcc

include:

  /usr/local/lib/tcc/include

  /usr/local/include

  /usr/include

libraries:

  /usr/lib

  /lib

  /usr/local/lib

crt:

  /usr/lib

libtcc1:

  /usr/local/lib/tcc/libtcc1.a

elfinterp:

  /lib64/ld-linux-x86-64.so.2

 

And now the tests:

byas:tinycc jullien$ make -k test

/Library/Developer/CommandLineTools/usr/bin/make -C tests

------------ hello-run ------------

../tcc -B.. -I../include -I.. -I.. -D_ANSI_SOURCE -run ../examples/ex1.c

tcc: error: library 'c' not found

make[1]: *** [hello-run] Error 255

gcc -o libtcc_test libtcc_test.c ../libtcc.a -D_FORTIFY_SOURCE=0 -I.. -I.. -Wl,-flat_namespace,-undefined,warning -lm -ldl

------------ libtest ------------

./libtcc_test -B.. -I../include -I.. -I.. -D_ANSI_SOURCE

tcc: error: library 'c' not found

make[1]: *** [libtest] Error 1

------------ memtest ------------

gcc -D_FORTIFY_SOURCE=0 -I.. -I.. -Wl,-flat_namespace,-undefined,warning -DTCC_TARGET_X86_64 -DONE_SOURCE -DMEM_DEBUG=2 ../tcc.c -lm -ldl -o memtest-tcc

In file included from ../tcc.c:22:

In file included from ../libtcc.c:40:

../tccpp.c:2618:32: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to

      integer types with different sign [-Wpointer-sign]

            cstr_cat(&tokcstr, p1, len);

                               ^~

../tccpp.c:347:50: note: passing argument to parameter 'str' here

ST_FUNC void cstr_cat(CString *cstr, const char *str, int len)

                                                 ^

../tccpp.c:3733:19: warning: comparison of constant 11 with _expression_ of type 'enum (anonymous enum at ../tcc.h:708:5)' is always false

      [-Wtautological-constant-out-of-range-compare]

    if (s1->Pflag == 1 + 10)

        ~~~~~~~~~ ^  ~~~~~~

In file included from ../tcc.c:22:

In file included from ../libtcc.c:42:

../tccelf.c:790:26: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different

      sign [-Wpointer-sign]

        relocate(s1, rel, type, ptr, addr, tgt);

                                ^~~

../tcc.h:1436:68: note: passing argument to parameter 'ptr' here

ST_FUNC void relocate(TCCState *s1, ElfW_Rel *rel, int type, char *ptr, addr_t addr, addr_t val);

                                                                   ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:178:33: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                    qrel->r_addend = read64le(ptr) + val;

                                              ^~~

../tcc.h:1489:48: note: passing argument to parameter 'p' here

static inline uint64_t read64le(unsigned char *p) {

                                               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:182:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add64le(ptr, val);

                    ^~~

../tcc.h:1495:43: note: passing argument to parameter 'p' here

static inline void add64le(unsigned char *p, int64_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:191:48: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                qrel->r_addend = (int)read32le(ptr) + val;

                                               ^~~

../tcc.h:1480:48: note: passing argument to parameter 'p' here

static inline uint32_t read32le(unsigned char *p) {

                                               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:194:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, val);

                    ^~~

../tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:205:52: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

                    qrel->r_addend = (int)read32le(ptr) + rel->r_addend;

                                                   ^~~

../tcc.h:1480:48: note: passing argument to parameter 'p' here

static inline uint32_t read32le(unsigned char *p) {

                                               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:222:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, diff);

                    ^~~

../tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:228:23: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            write64le(ptr, val - rel->r_addend);

                      ^~~

../tcc.h:1492:45: note: passing argument to parameter 'p' here

static inline void write64le(unsigned char *p, uint64_t x) {

                                            ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:233:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, s1->got->sh_addr - addr +

                    ^~~

../tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:237:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, val - s1->got->sh_addr);

                    ^~~

../tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:62:

../x86_64-link.c:241:21: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with

      different sign [-Wpointer-sign]

            add32le(ptr, s1->sym_attrs[sym_index].got_offset);

                    ^~~

../tcc.h:1486:43: note: passing argument to parameter 'p' here

static inline void add32le(unsigned char *p, int32_t x) {

                                          ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:67:

In file included from ../i386-asm.c:233:

../x86_64-asm.h:94:28: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 4722439 to 3847

      [-Wconstant-conversion]

     DEF_ASM_OP0L(sysretq, 0x480f07, 0, 0)

     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

../i386-asm.c:228:77: note: expanded from macro 'DEF_ASM_OP0L'

#define DEF_ASM_OP0L(name, opcode, group, instr_type) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 0 },

                                                      ~                     ^~~~~~

../i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:67:

In file included from ../i386-asm.c:233:

../x86_64-asm.h:121:25: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688702 to 4030

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movsbw, 0x660fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG16))

    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

../i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

../i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:67:

In file included from ../i386-asm.c:233:

../x86_64-asm.h:378:22: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688512 to 3840

      [-Wconstant-conversion]

ALT(DEF_ASM_OP1(str, 0x660f00, 1, OPC_MODRM, OPT_REG16))

    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../i386-asm.c:229:81: note: expanded from macro 'DEF_ASM_OP1'

#define DEF_ASM_OP1(name, opcode, group, instr_type, op0) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 1, { op0 }},

                                                          ~                     ^~~~~~

../i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

../i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:67:

In file included from ../i386-asm.c:233:

../x86_64-asm.h:428:23: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 6688726 to 4054

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movq, 0x660fd6, 0, OPC_MODRM, OPT_SSE, OPT_EA | OPT_SSE ))

    ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

../i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

../i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

In file included from ../tcc.c:22:

In file included from ../libtcc.c:67:

In file included from ../i386-asm.c:233:

../x86_64-asm.h:429:23: warning: implicit conversion from 'int' to 'uint16_t' (aka 'unsigned short') changes value from 15929214 to 3966

      [-Wconstant-conversion]

ALT(DEF_ASM_OP2(movq, 0xf30f7e, 0, OPC_MODRM, OPT_EA | OPT_SSE, OPT_SSE ))

    ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../i386-asm.c:230:86: note: expanded from macro 'DEF_ASM_OP2'

#define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) { TOK_ASM_ ## name, O(opcode), T(opcode, instr_type, group), 2, { op0, op1 }},

                                                               ~                     ^~~~~~

../i386-asm.c:224:85: note: expanded from macro 'O'

#define O(o) ((((o) & 0xff00) == 0x0f00) ? ((((o) >> 8) & ~0xff) | ((o) & 0xff)) : (o))

                                                                                    ^

../i386-asm.c:222:16: note: expanded from macro 'ALT'

#define ALT(x) x

               ^

../i386-asm.c:402:58: warning: passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer

      types with different sign [-Wpointer-sign]

        } else if ((op->reg = asm_parse_numeric_reg(tok, &op->type)) >= 0) {

                                                         ^~~~~~~~~

../i386-asm.c:281:46: note: passing argument to parameter 'type' here

static int asm_parse_numeric_reg(int t, int *type)

                                             ^

19 warnings generated.

./memtest-tcc -B.. -I../include -I.. -I.. -D_ANSI_SOURCE -DTCC_TARGET_X86_64 -DONE_SOURCE ../tcc.c -lm -ldl

/usr/lib/crt1.o: error: unrecognized file type

tcc: error: file 'crt1.o' not found

tcc: error: file 'crti.o' not found

In file included from ../tcc.c:22:

In file included from ../libtcc.c:21:

In file included from ../tcc.h:27:

In file included from /usr/include/stdlib.h:63:

In file included from /usr/include/_types.h:27:

In file included from /usr/include/sys/_types.h:32:

/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

In file included from ../tcc.c:22:

In file included from ../libtcc.c:21:

In file included from ../tcc.h:29:

../include/stdarg.h:19: error: incompatible redefinition of 'va_list'

make[1]: *** [memtest] Error 1

------------ dlltest ------------

../tcc -B.. -I../include -I.. -I.. -D_ANSI_SOURCE -DONE_SOURCE -DTCC_TARGET_X86_64 -DLIBTCC_AS_DLL ../libtcc.c -lm -ldl -shared -o libtcc2.so

tcc: error: file 'crti.o' not found

In file included from ../libtcc.c:21:

In file included from ../tcc.h:27:

In file included from /usr/include/stdlib.h:63:

In file included from /usr/include/_types.h:27:

In file included from /usr/include/sys/_types.h:32:

/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

In file included from ../libtcc.c:21:

In file included from ../tcc.h:29:

../include/stdarg.h:19: error: incompatible redefinition of 'va_list'

make[1]: *** [dlltest] Error 1

gcc -o abitest-cc abitest.c ../libtcc.a -D_FORTIFY_SOURCE=0 -I.. -I.. -Wl,-flat_namespace,-undefined,warning -lm -ldl -w

../tcc -B.. -I../include -I.. -I.. -D_ANSI_SOURCE -o abitest-tcc abitest.c ../libtcc.c -DTCC_TARGET_X86_64 -DONE_SOURCE -lm -ldl

/usr/lib/crt1.o: error: unrecognized file type

tcc: error: file 'crt1.o' not found

tcc: error: file 'crti.o' not found

In file included from abitest.c:2:

In file included from /usr/include/stdlib.h:63:

In file included from /usr/include/_types.h:27:

In file included from /usr/include/sys/_types.h:32:

/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

In file included from abitest.c:5:

../include/stdarg.h:19: error: incompatible redefinition of 'va_list'

make[1]: *** [abitest-tcc] Error 1

../tcc -B.. -I../include -I.. -I.. -D_ANSI_SOURCE -o vla_test vla_test.c

/usr/lib/crt1.o: error: unrecognized file type

tcc: error: file 'crt1.o' not found

tcc: error: file 'crti.o' not found

In file included from vla_test.c:6:

In file included from /usr/include/stdlib.h:63:

In file included from /usr/include/_types.h:27:

In file included from /usr/include/sys/_types.h:32:

/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

tcc: error: library 'c' not found

tcc: error: file 'crtn.o' not found

tcc: error: undefined symbol 'memset'

tcc: error: undefined symbol 'strcmp'

tcc: error: undefined symbol '__stdoutp'

tcc: error: undefined symbol '_fputs'

tcc: error: undefined symbol 'fflush'

make[1]: *** [vla_test] Error 1

------------ tests2-dir ------------

/Library/Developer/CommandLineTools/usr/bin/make -k -C tests2

Test: 00_assignment...

--- ../../tests/tests2/00_assignment.expect     2017-02-25 15:17:36.000000000 +0100

+++ 00_assignment.output        2017-02-26 07:43:35.000000000 +0100

@@ -1,3 +1,4 @@

-42

-64

-12, 34

+In file included from 00_assignment.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [00_assignment.test] Error 1

Test: 01_comment...

--- ../../tests/tests2/01_comment.expect        2017-02-25 15:17:36.000000000 +0100

+++ 01_comment.output   2017-02-26 07:43:35.000000000 +0100

@@ -1,5 +1,4 @@

-Hello

-Hello

-Hello

-Hello

-Hello

+In file included from 01_comment.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [01_comment.test] Error 1

Test: 02_printf...

--- ../../tests/tests2/02_printf.expect 2017-02-25 15:17:36.000000000 +0100

+++ 02_printf.output    2017-02-26 07:43:35.000000000 +0100

@@ -1,15 +1,4 @@

-Hello world

-Count = -5

-Count = -4

-Count = -3

-Count = -2

-Count = -1

-Count = 0

-Count = 1

-Count = 2

-Count = 3

-Count = 4

-Count = 5

-String 'hello', 'there' is 'hello', 'there'

-Character 'A' is 'A'

-Character 'a' is 'a'

+In file included from 02_printf.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [02_printf.test] Error 1

Test: 03_struct...

--- ../../tests/tests2/03_struct.expect 2017-02-25 15:17:36.000000000 +0100

+++ 03_struct.output    2017-02-26 07:43:35.000000000 +0100

@@ -1,6 +1,4 @@

-12

-34

-12

-34

-56

-78

+In file included from 03_struct.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [03_struct.test] Error 1

Test: 04_for...

--- ../../tests/tests2/04_for.expect    2017-02-25 15:17:36.000000000 +0100

+++ 04_for.output       2017-02-26 07:43:35.000000000 +0100

@@ -1,10 +1,4 @@

-1

-2

-3

-4

-5

-6

-7

-8

-9

-10

+In file included from 04_for.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [04_for.test] Error 1

Test: 05_array...

--- ../../tests/tests2/05_array.expect  2017-02-25 15:17:36.000000000 +0100

+++ 05_array.output     2017-02-26 07:43:35.000000000 +0100

@@ -1,10 +1,4 @@

-1

-4

-9

-16

-25

-36

-49

-64

-81

-100

+In file included from 05_array.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [05_array.test] Error 1

Test: 06_case...

--- ../../tests/tests2/06_case.expect   2017-02-25 15:17:36.000000000 +0100

+++ 06_case.output      2017-02-26 07:43:35.000000000 +0100

@@ -1,8 +1,4 @@

-0

-0

-1

-1

-2

-2

-3

-0

+In file included from 06_case.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [06_case.test] Error 1

Test: 07_function...

--- ../../tests/tests2/07_function.expect       2017-02-25 15:17:36.000000000 +0100

+++ 07_function.output  2017-02-26 07:43:35.000000000 +0100

@@ -1,4 +1,4 @@

-9

-16

-a=1234

-qfunc()

+In file included from 07_function.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [07_function.test] Error 1

Test: 08_while...

--- ../../tests/tests2/08_while.expect  2017-02-25 15:17:36.000000000 +0100

+++ 08_while.output     2017-02-26 07:43:35.000000000 +0100

@@ -1,11 +1,4 @@

-1

-1

-2

-3

-5

-8

-13

-21

-34

-55

-89

+In file included from 08_while.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [08_while.test] Error 1

Test: 09_do_while...

--- ../../tests/tests2/09_do_while.expect       2017-02-25 15:17:36.000000000 +0100

+++ 09_do_while.output  2017-02-26 07:43:35.000000000 +0100

@@ -1,11 +1,4 @@

-1

-1

-2

-3

-5

-8

-13

-21

-34

-55

-89

+In file included from 09_do_while.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [09_do_while.test] Error 1

Test: 10_pointer...

--- ../../tests/tests2/10_pointer.expect        2017-02-25 15:17:36.000000000 +0100

+++ 10_pointer.output   2017-02-26 07:43:35.000000000 +0100

@@ -1,8 +1,4 @@

-a = 42

-bolshevic.a = 12

-bolshevic.b = 34

-bolshevic.c = 56

-tsar->a = 12

-tsar->b = 34

-tsar->c = 56

-bolshevic.b = 34

+In file included from 10_pointer.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [10_pointer.test] Error 1

Test: 11_precedence...

--- ../../tests/tests2/11_precedence.expect     2017-02-25 15:17:36.000000000 +0100

+++ 11_precedence.output        2017-02-26 07:43:35.000000000 +0100

@@ -1,15 +1,4 @@

-134

-134

-0

-1

-1

-1

-1

-46

-1, 0

-0, 1

-1

-1916

-1916

-64

-4

+In file included from 11_precedence.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [11_precedence.test] Error 1

Test: 12_hashdefine...

--- ../../tests/tests2/12_hashdefine.expect     2017-02-25 15:17:36.000000000 +0100

+++ 12_hashdefine.output        2017-02-26 07:43:35.000000000 +0100

@@ -1,2 +1,4 @@

-12

-12, 24, 36

+In file included from 12_hashdefine.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [12_hashdefine.test] Error 1

Test: 13_integer_literals...

--- ../../tests/tests2/13_integer_literals.expect       2017-02-25 15:17:36.000000000 +0100

+++ 13_integer_literals.output  2017-02-26 07:43:35.000000000 +0100

@@ -1,5 +1,4 @@

-24680

-342391

-2386092

-2386092

-1365

+In file included from 13_integer_literals.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [13_integer_literals.test] Error 1

Test: 14_if...

--- ../../tests/tests2/14_if.expect     2017-02-25 15:17:36.000000000 +0100

+++ 14_if.output        2017-02-26 07:43:35.000000000 +0100

@@ -1,2 +1,4 @@

-a is true

-b is false

+In file included from 14_if.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [14_if.test] Error 1

Test: 15_recursion...

--- ../../tests/tests2/15_recursion.expect      2017-02-25 15:17:36.000000000 +0100

+++ 15_recursion.output 2017-02-26 07:43:35.000000000 +0100

@@ -1,10 +1,4 @@

-1

-2

-6

-24

-120

-720

-5040

-40320

-362880

-3628800

+In file included from 15_recursion.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

make[2]: *** [15_recursion.test] Error 1

Test: 16_nesting...

--- ../../tests/tests2/16_nesting.expect        2017-02-25 15:17:36.000000000 +0100

+++ 16_nesting.output   2017-02-26 07:43:35.000000000 +0100

@@ -1,18 +1,4 @@

-0 0 0

-0 0 1

-0 0 2

-0 1 0

-0 1 1

-0 1 2

-0 2 0

-0 2 1

-0 2 2

-1 0 0

-1 0 1

-1 0 2

-1 1 0

-1 1 1

-1 1 2

-1 2 0

-1 2 1

-1 2 2

+In file included from 16_nesting.c:1:

+In file included from /usr/include/stdio.h:64:

+/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"

+tcc: error: library 'c' not found

 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]