0

I currently working on Intel x118 platform using arm env. I found I must force to open this option to ensure link has no problem, otherwise, it will occur errors like:

Error: L6242E: Cannot link object iui_os_irq_msk.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object iui_os.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_critical_section.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_thread.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_event.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_event_group.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_queue.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_sem.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_common.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_mem.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 13 information, 0 warning and 11 error messages.

can anybody tell me, if this --enum_is_int option make significant influence on my target file?

further information:

I found some comment on ARM:

--enum_is_int

This option forces the size of all enumeration types to be at least four bytes.

This option is switched off by default and the smallest data type is used that can hold the values of all enumerators.

If you specify an ARM Linux configuration file on the command line, this option is switched on by default.

Note The --enum_is_int option is not recommended for general use.

How Chen
  • 1,340
  • 2
  • 17
  • 37
  • If you can rebuild those object files yourself, then *you* can tell... Build the project (including all those object files) both ways and compare. If you can't rebuild those object files for some reason (like you don't have source), then it looks like you may not have much choice. There's not much point in comparing something that works with something that doesn't. – Michael Burr Sep 17 '12 at 06:55
  • yes, i can rebuild this objs, i only want to know, if this `--enum_is_int` option is enable, what influence on my target file – How Chen Sep 17 '12 at 07:12
  • I assume it makes enums take an `int` type instead of something smaller, like a `char` if all the values you define for the enum are within that range (which is a common C extension for embedded targets). Presumably it will make some of your data structures a bit larger, and it may have some effect on code size but it's hard to guess exactly what (it's possible it could decrease code size). Without more information, any analysis more detailed than this is probably just guesswork. Your best bet is to just build both ways and compare. – Michael Burr Sep 17 '12 at 07:27
  • I'll add that it may be more important to set the enum size option according to how any runtime library you're using wants it set. – Michael Burr Sep 17 '12 at 07:38
  • I only can build the objs and link with `--enum_is_int`, if I disable this flags, compile obj from c file is OK, but can not link, I can NOT test the target file without this flag...T_T – How Chen Sep 17 '12 at 07:50

1 Answers1

1

The option might increase the memory foot print of your code slightly but probably not significantly. It's safe to use and is required in this case since the linker will not link objects is deems incompatible.

That said, you might be able to override the linker error using the --diag-warning=6242 command line option but the resulting image may not work properly.

Pete Fordham
  • 2,278
  • 16
  • 25
  • Thanks, I found when linking the objs and LIBs, the libs file, which provide by Intel, it enabled `--enum_is_int` option, I think this is problem that make my objs are incompatible. However, I can do nothing with the Intel provided LIBs file, maybe to enable `--enum_is_int` is the best option currently, otherwise, I should ask Intel to re-compile its LIBs file – How Chen Sep 18 '12 at 01:42
  • @HowChen how did you fix the error, .\_build\ble_app_template.axf: Error: L6242E: Cannot link object rt_cmsis.o as its attributes are incompatible with the image attributes. ... packed-enum clashes with enum_is_int. – Hanuman Jan 06 '16 at 19:08