Compiling with ARMCC instead of GCC

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
pbk
Posts: 1
Joined: Sun Aug 03, 2014 11:15 pm

Compiling with ARMCC instead of GCC

Post by pbk » Mon Aug 04, 2014 12:25 am

Using µPython, targeting a Cortex-M4 with ARMCC instead of GCC here. It compiles out of the box with minimal modifications. Some notes and compiler warning are attached in case they are useful to someone and the warnings may be addressed.
  • ARMCC needs to be in C99 mode and use GNU extensions (--c99 --gnu). Mostly for variable declaration inside frames and dotted struct initialization.
  • Tweaked the Makefiles to generate the genhdr/qstrdefs.generated.h and genhdr/py-version.h header files as usual. Port header files needed are mpconfigport.h and qstrdefsport.h.
  • Code is assuming alloca.h is included in mpconfigport.h. As GCC, ARMCC supports alloca, but it's not part of ANSI C so it may break other compilers. Actually, it didn't work using the native MinGW GCC preprocessor in my machine to generate the header files above.
  • modmath.c expects M_PI and M_E to be defined by math.h. Again, these are not ANSI C. I strongly suggest providing own definitions for them in case the macros are not previously defined, i.e.:

    Code: Select all

    // Math defines
    #ifndef M_E
    #define M_E 2.718281828 // e
    #endif
    #ifndef M_LOG2E
    #define M_LOG2E 1.442695041 // log2(e)
    #endif
    #ifndef M_LOG10E
    #define M_LOG10E 0.434294482 // log10(e)
    #endif
    #ifndef M_LN2
    #define M_LN2 0.693147181 // ln(2)
    #endif
    #ifndef M_LN10
    #define M_LN10 2.302585093 // ln(10)
    #endif
    #ifndef M_PI
    #define M_PI 3.141592654 // pi
    #endif
    #ifndef M_PI_2
    #define M_PI_2 1.570796327 // pi/2
    #endif
    #ifndef M_PI_4
    #define M_PI_4 0.785398163 // pi/4
    #endif
    #ifndef M_1_PI
    #define M_1_PI 0.318309886 // 1/pi
    #endif
    #ifndef M_2_PI
    #define M_2_PI 0.636619772 // 2/pi
    #endif
    #ifndef M_2_SQRTPI
    #define M_2_SQRTPI 1.128379167 // 2/sqrt(pi)
    #endif
    #ifndef M_SQRT2
    #define M_SQRT2 1.414213562 // sqrt(2)
    #endif
    #ifndef M_SQRT1_2
    #define M_SQRT1_2 0.707106781 // 1/sqrt(2)
    #endif
    
  • Code needs at least Q(help), Q(pyb) and Q(input) to be declared in the qstrdefsport.h, and implemented by the port.
  • Here is a translation of the py-version.sh shell script to Python:

    Code: Select all

    #!python
    """Create the py-version.h header file using Git repository information"""
    
    output = """// This file was generated by py/py-version.py
    #define MICROPY_GIT_TAG "{0}"
    #define MICROPY_GIT_HASH "{1}"
    #define MICROPY_BUILD_DATE "{2}"
    """
    
    if __name__ == '__main__':
    	try:
    		from subprocess import check_output, CalledProcessError
    		from time import strftime
    
    		# Note: git describe doesn't work if no tag is available
    		git_tag = str(check_output(["git", "describe", "--dirty", "--always"]).strip(), encoding="UTF-8")
    		try:
    			git_hash = str(check_output(["git", "rev-parse", "--short", "HEAD"]).strip(), encoding="UTF-8")
    		except CalledProcessError:
    			git_hash = "unknown"
    
    		try:
    			# Check if there are any modified files
    			check_output(["git", "diff", "--no-ext-diff", "--quiet", "--exit-code"])
    			# Check if there are any staged files
    			check_output(["git", "diff-index", "--cached", "--quiet", "HEAD", "--"])
    		except CalledProcessError:
    			git_hash += "-dirty"
    
    		print(output.format(git_tag, git_hash, strftime('%Y-%m-%d')))
    
    	except:
    		from traceback import print_exc
    		print_exc()
    		exit(-1)
    
Compiler warnings follow:

Code: Select all

Rebuild target 'MicroPython'
compiling argcheck.c...
compiling asmthumb.c...
compiling binary.c...
compiling builtin.c...
compiling builtinevex.c...
compiling builtinimport.c...
C:\Source\micropython\py\builtinimport.c(327): warning:  #2532-D: support for trigraphs is disabled
                      // that would be (??) object path within module, not modules path within FS.
C:\Source\micropython\py\builtinimport.c: 1 warning, 0 errors
compiling builtintables.c...
compiling compile.c...
C:\Source\micropython\py\compile.c(885): warning:  #111-D: statement is unreachable
                  break;
C:\Source\micropython\py\compile.c(2880): warning:  #188-D: enumerated type mixed with another type
                    EMIT_ARG(load_const_tok, arg);
C:\Source\micropython\py\compile.c(3264): warning:  #188-D: enumerated type mixed with another type
          EMIT_INLINE_ASM_ARG(start_pass, comp->pass, comp->scope_cur);
C:\Source\micropython\py\compile.c: 3 warnings, 0 errors
compiling emitbc.c...
C:\Source\micropython\py\emitbc.c(410): warning:  #68-D: integer conversion resulted in a change of sign
          assert(emit->label_offsets[l] == -1);
C:\Source\micropython\py\emitbc.c(410): warning:  #68-D: integer conversion resulted in a change of sign
          assert(emit->label_offsets[l] == -1);
C:\Source\micropython\py\emitbc.c(810): warning:  #68-D: integer conversion resulted in a change of sign
          emit_bc_pre(emit, -2 - n_closed_over + 1);
C:\Source\micropython\py\emitbc.c: 3 warnings, 0 errors
compiling emitcommon.c...
compiling emitcpy.c...
compiling emitglue.c...
compiling emitinlinethumb.c...
C:\Source\micropython\py\emitinlinethumb.c(201): warning:  #546-D: transfer of control bypasses initialization of:
            variable "pns" (declared at line 203)
          goto bad_arg;
          ^
C:\Source\micropython\py\emitinlinethumb.c(288): warning:  #68-D: integer conversion resulted in a change of sign
              uint cc = -1;
C:\Source\micropython\py\emitinlinethumb.c(294): warning:  #68-D: integer conversion resulted in a change of sign
              if (cc == -1) {
C:\Source\micropython\py\emitinlinethumb.c: 3 warnings, 0 errors
compiling emitnative.c...
C:\Source\micropython\py\emitnative.c(691): warning:  #188-D: enumerated type mixed with another type
      emit_post_push_imm(emit, vtype, val);
C:\Source\micropython\py\emitnative.c(728): warning:  #188-D: enumerated type mixed with another type
              emit_call_with_imm_arg(emit, 0, mp_load_const_bytes, qstr, REG_ARG_1); // TODO need to add function to runtime table
C:\Source\micropython\py\emitnative.c(1075): warning:  #188-D: enumerated type mixed with another type
      emit_call(emit, 0, nlr_push); // TODO need to add function to runtime table
C:\Source\micropython\py\emitnative.c(1131): warning:  #188-D: enumerated type mixed with another type
      emit_call(emit, 0, nlr_pop); // TODO need to add function to runtime table
C:\Source\micropython\py\emitnative.c(1416): warning:  #188-D: enumerated type mixed with another type
      emit_call(emit, 0, mp_make_raise_obj); // TODO need to add function to runtime table
C:\Source\micropython\py\emitnative.c(1419): warning:  #188-D: enumerated type mixed with another type
      emit_call(emit, 0, nlr_jump); // TODO need to add function to runtime table
C:\Source\micropython\py\emitnative.c: 6 warnings, 0 errors
compiling emitpass1.c...
C:\Source\micropython\py\emitpass1.c(133): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, _Bool)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(137): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(138): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(144): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(145): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(146): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(147): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(148): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, mp_token_kind_t)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(149): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, mp_int_t)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(150): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(151): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(152): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, _Bool)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(153): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(154): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, uint, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(155): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(156): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(157): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(158): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(159): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(160): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(161): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(162): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(163): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(164): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(165): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(166): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(167): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(168): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(169): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(170): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(171): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(172): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, qstr)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(173): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(174): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(175): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(176): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(177): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(178): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(179): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(180): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(181): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(182): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(183): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(184): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(185): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(186): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(187): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(188): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(189): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(190): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(191): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(192): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(193): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(194): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(195): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(196): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, mp_unary_op_t)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(197): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, mp_binary_op_t)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(198): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(199): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(200): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(201): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(202): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(203): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(204): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(205): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(206): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(207): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(208): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(209): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, scope_t *, uint, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(210): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, scope_t *, uint, uint, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(211): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int, int, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(212): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int, int, uint)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(213): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(214): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *, int)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(215): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(216): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(218): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c(219): warning:  #144-D: a value of type "void *" cannot be used to initialize an entity of type "void (*)(emit_t *)"
      (void*)emit_pass1_dummy,
C:\Source\micropython\py\emitpass1.c: 78 warnings, 0 errors
compiling formatfloat.c...
compiling gc.c...
compiling lexer.c...
C:\Source\micropython\py\lexer.c(695): warning:  #188-D: enumerated type mixed with another type
              tok->kind = tok_enc_kind[tok_enc_index];
C:\Source\micropython\py\lexer.c(725): warning:  #188-D: enumerated type mixed with another type
                      tok->kind = MP_TOKEN_KW_FALSE + i;
C:\Source\micropython\py\lexer.c: 2 warnings, 0 errors
compiling lexerstr.c...
C:\Source\micropython\py\lexerstr.c(43): warning:  #68-D: integer conversion resulted in a change of sign
          return MP_LEXER_EOF;
C:\Source\micropython\py\lexerstr.c: 1 warning, 0 errors
compiling lexerunix.c...
compiling malloc.c...
compiling map.c...
compiling modarray.c...
compiling modcmath.c...
C:\Source\micropython\py\modcmath.c(78): warning:  #1035-D: single-precision operand implicitly converted to double-precision
      return mp_obj_new_complex(0.5 * MICROPY_FLOAT_C_FUN(log)(real*real + imag*imag), MICROPY_FLOAT_C_FUN(atan2)(imag, real));
C:\Source\micropython\py\modcmath.c(85): warning:  #1035-D: single-precision operand implicitly converted to double-precision
      return mp_obj_new_complex(0.5 * MICROPY_FLOAT_C_FUN(log10)(real*real + imag*imag), MICROPY_FLOAT_C_FUN(atan2)(imag, real));
C:\Source\micropython\py\modcmath.c(93): warning:  #1035-D: single-precision operand implicitly converted to double-precision
      mp_float_t theta = 0.5 * MICROPY_FLOAT_C_FUN(atan2)(imag, real);
C:\Source\micropython\py\modcmath.c: 3 warnings, 0 errors
compiling modcollections.c...
compiling modgc.c...
compiling modio.c...
compiling modmath.c...
C:\Source\micropython\py\modmath.c(117): warning:  #1035-D: single-precision operand implicitly converted to double-precision
      return mp_obj_new_float(mp_obj_get_float(x_obj) * M_PI / 180.0);
C:\Source\micropython\py\modmath.c(122): warning:  #1035-D: single-precision operand implicitly converted to double-precision
      return mp_obj_new_float(mp_obj_get_float(x_obj) * 180.0 / M_PI);
C:\Source\micropython\py\modmath.c: 2 warnings, 0 errors
compiling modmicropython.c...
compiling modstruct.c...
compiling modsys.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\modsys.c: 1 warning, 0 errors
compiling mpz.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\mpz.c(1262): warning:  #68-D: integer conversion resulted in a change of sign
          if (val > ((~0) >> DIG_SIZE)) {
C:\Source\micropython\py\mpz.c: 2 warnings, 0 errors
compiling nlrsetjmp.c...
compiling obj.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\stackctrl.h(27): warning:  #1295-D: Deprecated declaration mp_stack_ctrl_init - give arg types
  void mp_stack_ctrl_init();
C:\Source\micropython\py\stackctrl.h(28): warning:  #1295-D: Deprecated declaration mp_stack_usage - give arg types
  uint mp_stack_usage();
C:\Source\micropython\py\stackctrl.h(33): warning:  #1295-D: Deprecated declaration mp_stack_check - give arg types
  void mp_stack_check();
C:\Source\micropython\py\obj.c: 4 warnings, 0 errors
compiling objarray.c...
C:\Source\micropython\py\objarray.c(207): warning:  #940-D: missing return statement at end of non-void function "array_subscr"
  }
C:\Source\micropython\py\objarray.c: 1 warning, 0 errors
compiling objbool.c...
compiling objboundmeth.c...
compiling objcell.c...
compiling objclosure.c...
compiling objcomplex.c...
compiling objdict.c...
C:\Source\micropython\py\objdict.c(257): warning:  #191-D: type qualifier is meaningless on cast type
  STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(dict_fromkeys_obj, (const mp_obj_t)&dict_fromkeys_fun_obj);
C:\Source\micropython\py\objdict.c: 1 warning, 0 errors
compiling objenumerate.c...
compiling objexcept.c...
C:\Source\micropython\py\objexcept.c(111): warning:  #188-D: enumerated type mixed with another type
      mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS;
C:\Source\micropython\py\objexcept.c: 1 warning, 0 errors
compiling objfilter.c...
compiling objfloat.c...
compiling objfun.c...
C:\Source\micropython\py\stackctrl.h(27): warning:  #1295-D: Deprecated declaration mp_stack_ctrl_init - give arg types
  void mp_stack_ctrl_init();
C:\Source\micropython\py\stackctrl.h(28): warning:  #1295-D: Deprecated declaration mp_stack_usage - give arg types
  uint mp_stack_usage();
C:\Source\micropython\py\stackctrl.h(33): warning:  #1295-D: Deprecated declaration mp_stack_check - give arg types
  void mp_stack_check();
C:\Source\micropython\py\objfun.c(563): warning:  #940-D: missing return statement at end of non-void function "convert_obj_for_inline_asm"
  }
C:\Source\micropython\py\objfun.c: 4 warnings, 0 errors
compiling objgenerator.c...
C:\Source\micropython\py\objgenerator.c(110): warning:  #170-D: pointer points outside of underlying object
      if (self->code_state.sp == self->code_state.state - 1) {
C:\Source\micropython\py\objgenerator.c: 1 warning, 0 errors
compiling objgetitemiter.c...
compiling objint.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\objint.c(320): warning:  #191-D: type qualifier is meaningless on cast type
  STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, (const mp_obj_t)&int_from_bytes_fun_obj);
C:\Source\micropython\py\objint.c: 2 warnings, 0 errors
compiling objint_longlong.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\objint_longlong.c: 1 warning, 0 errors
compiling objint_mpz.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\objint_mpz.c(269): warning:  #940-D: missing return statement at end of non-void function "mp_obj_int_binary_op"
  }
C:\Source\micropython\py\objint_mpz.c: 2 warnings, 0 errors
compiling objlist.c...
compiling objmap.c...
compiling objmodule.c...
compiling objnamedtuple.c...
compiling objnone.c...
compiling objobject.c...
C:\Source\micropython\py\objobject.c(64): warning:  #191-D: type qualifier is meaningless on cast type
  STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, (const mp_obj_t)&object___new___fun_obj);
C:\Source\micropython\py\objobject.c: 1 warning, 0 errors
compiling objproperty.c...
compiling objrange.c...
compiling objset.c...
C:\Source\micropython\py\objset.c(433): warning:  #188-D: enumerated type mixed with another type
          mp_set_lookup(&self->set, next, MP_MAP_LOOKUP_REMOVE_IF_FOUND | MP_MAP_LOOKUP_ADD_IF_NOT_FOUND);
C:\Source\micropython\py\objset.c: 1 warning, 0 errors
compiling objslice.c...
compiling objstr.c...
C:\Source\micropython\py\objstr.c(50): warning:  #1295-D: Deprecated declaration arg_type_mixup - give arg types
  STATIC NORETURN void arg_type_mixup();
C:\Source\micropython\py\objstr.c(165): warning:  #546-D: transfer of control bypasses initialization of:
            variable "vstr" (declared at line 190)
            variable "o" (declared at line 191)
            variable "len_in" (declared at line 193)
            variable "iterable" (declared at line 202)
              goto wrong_args;
              ^
C:\Source\micropython\py\objstr.c(176): warning:  #546-D: transfer of control bypasses initialization of:
            variable "vstr" (declared at line 190)
            variable "o" (declared at line 191)
            variable "len_in" (declared at line 193)
            variable "iterable" (declared at line 202)
          goto wrong_args;
          ^
C:\Source\micropython\py\objstr.c(1199): warning:  #546-D: transfer of control bypasses initialization of:
            variable "prec" (declared at line 1209)
                      goto not_enough_args;
                      ^
C:\Source\micropython\py\objstr.c: 4 warnings, 0 errors
compiling objstringio.c...
compiling objstrunicode.c...
compiling objtuple.c...
compiling objtype.c...
C:\Source\micropython\py\objtype.c(222): warning:  #188-D: enumerated type mixed with another type
              mp_obj_print_helper(print, env, self->subobj[0], kind | PRINT_EXC_SUBCLASS);
C:\Source\micropython\py\objtype.c: 1 warning, 0 errors
compiling objzip.c...
compiling opmethods.c...
compiling parse.c...
C:\Source\micropython\py\parse.c(456): warning:  #188-D: enumerated type mixed with another type
                              if (mp_lexer_is_kind(lex, rule->arg[i] & RULE_ARG_ARG_MASK)) {
C:\Source\micropython\py\parse.c(471): warning:  #188-D: enumerated type mixed with another type
                      if (mp_lexer_is_kind(lex, rule->arg[i] & RULE_ARG_ARG_MASK)) {
C:\Source\micropython\py\parse.c(508): warning:  #188-D: enumerated type mixed with another type
                              tok_kind = rule->arg[i] & RULE_ARG_ARG_MASK;
C:\Source\micropython\py\parse.c(546): warning:  #188-D: enumerated type mixed with another type
                          tok_kind = rule->arg[x] & RULE_ARG_ARG_MASK;
C:\Source\micropython\py\parse.c(659): warning:  #188-D: enumerated type mixed with another type
                                  if (mp_lexer_is_kind(lex, arg & RULE_ARG_ARG_MASK)) {
C:\Source\micropython\py\parse.c(446): warning:  #546-D: transfer of control bypasses initialization of:
            variable "num_not_nil" (declared at line 592)
          switch (rule->act & RULE_ACT_KIND_MASK) {
          ^
C:\Source\micropython\py\parse.c(406): warning:  #546-D: transfer of control bypasses initialization of:
            variable "backtrack" (declared at line 422)
            variable "rule" (declared at line 423)
          goto memory_error;
          ^
C:\Source\micropython\py\parse.c: 7 warnings, 0 errors
compiling parsehelper.c...
compiling parsenum.c...
C:\Source\micropython\py\parsenum.c(239): warning:  #1035-D: single-precision operand implicitly converted to double-precision
              dec_val *= 0.1;
C:\Source\micropython\py\parsenum.c: 1 warning, 0 errors
compiling parsenumbase.c...
compiling pfenv.c...
C:\Source\micropython\py\mpz.h(51): warning:  #1295-D: Deprecated declaration mpz_zero - give arg types
  mpz_t *mpz_zero();
C:\Source\micropython\py\pfenv.c: 1 warning, 0 errors
compiling pfenv_printf.c...
compiling qstr.c...
compiling repl.c...
compiling runtime.c...
C:\Source\micropython\py\stackctrl.h(27): warning:  #1295-D: Deprecated declaration mp_stack_ctrl_init - give arg types
  void mp_stack_ctrl_init();
C:\Source\micropython\py\stackctrl.h(28): warning:  #1295-D: Deprecated declaration mp_stack_usage - give arg types
  uint mp_stack_usage();
C:\Source\micropython\py\stackctrl.h(33): warning:  #1295-D: Deprecated declaration mp_stack_check - give arg types
  void mp_stack_check();
C:\Source\micropython\py\runtime.c(349): warning:  #111-D: statement is unreachable
                      break;
C:\Source\micropython\py\runtime.c(410): warning:  #111-D: statement is unreachable
                  case MP_BINARY_OP_LESS: return MP_BOOL(lhs_val < rhs_val); break;
C:\Source\micropython\py\runtime.c(411): warning:  #111-D: statement is unreachable
                  case MP_BINARY_OP_MORE: return MP_BOOL(lhs_val > rhs_val); break;
C:\Source\micropython\py\runtime.c(412): warning:  #111-D: statement is unreachable
                  case MP_BINARY_OP_LESS_EQUAL: return MP_BOOL(lhs_val <= rhs_val); break;
C:\Source\micropython\py\runtime.c(413): warning:  #111-D: statement is unreachable
                  case MP_BINARY_OP_MORE_EQUAL: return MP_BOOL(lhs_val >= rhs_val); break;
C:\Source\micropython\py\runtime.c: 8 warnings, 0 errors
compiling scope.c...
compiling sequence.c...
compiling showbc.c...
compiling smallint.c...
compiling stackctrl.c...
C:\Source\micropython\py\stackctrl.h(27): warning:  #1295-D: Deprecated declaration mp_stack_ctrl_init - give arg types
  void mp_stack_ctrl_init();
C:\Source\micropython\py\stackctrl.h(28): warning:  #1295-D: Deprecated declaration mp_stack_usage - give arg types
  uint mp_stack_usage();
C:\Source\micropython\py\stackctrl.h(33): warning:  #1295-D: Deprecated declaration mp_stack_check - give arg types
  void mp_stack_check();
C:\Source\micropython\py\stackctrl.c: 3 warnings, 0 errors
compiling stream.c...
C:\Source\micropython\py\stream.c(172): warning:  #68-D: integer conversion resulted in a change of sign
      if (out_sz == MP_STREAM_ERROR) {
C:\Source\micropython\py\stream.c(198): warning:  #68-D: integer conversion resulted in a change of sign
      if (out_sz == MP_STREAM_ERROR) {
C:\Source\micropython\py\stream.c(234): warning:  #68-D: integer conversion resulted in a change of sign
          if (out_sz == MP_STREAM_ERROR) {
C:\Source\micropython\py\stream.c(296): warning:  #68-D: integer conversion resulted in a change of sign
          if (out_sz == MP_STREAM_ERROR) {
C:\Source\micropython\py\stream.c: 4 warnings, 0 errors
compiling unicode.c...
compiling vm.c...
C:\Source\micropython\py\vm.c(551): warning:  #188-D: enumerated type mixed with another type
                          mp_unwind_reason_t reason = MP_OBJ_SMALL_INT_VALUE(POP());
C:\Source\micropython\py\vm.c(935): warning:  #1293-D: assignment in condition
                      while ((c = *ci)) {
C:\Source\micropython\py\vm.c: 2 warnings, 0 errors
compiling vstr.c...
C:\Source\micropython\py\vstr.c(164): warning:  #68-D: integer conversion resulted in a change of sign
          int new_alloc = ROUND_ALLOC((vstr->len + size + 1) * 2);
C:\Source\micropython\py\vstr.c: 1 warning, 0 errors
compiling moductypes.c...
creating Library...
".\obj\MicroPython.lib" - 0 Error(s), 156 Warning(s).
Cheers.

igorgatis
Posts: 21
Joined: Thu Nov 19, 2015 1:10 pm

Re: Compiling with ARMCC instead of GCC

Post by igorgatis » Sat Nov 21, 2015 4:15 pm

Did you derived from an existing port (eg bare-arm)? If yes, which one?

Did you use --translate_gcc and --translate_gld?

Did you publish your code somewhere?

I'm targeting arm920t, big endian mode. I used the --translate_gcc plus -Warm,--c99,--gnu according to ARM documentation. I'm having trouble with .d files which are being placed on current directory rather than into build folder. Did you run into that too?

Post Reply