0

我目前使用 arm env 在 Intel x118 平台上工作。我发现我必须强制打开这个选项以确保链接没有问题,否则会出现如下错误:

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.

谁能告诉我,如果此--enum_is_int选项对我的目标文件产生重大影响?

更多的信息:

我发现了一些关于 ARM 的评论:

--enum_is_int

此选项强制所有枚举类型的大小至少为四个字节。

默认情况下关闭此选项,并使用可以保存所有枚举器值的最小数据类型。

如果在命令行中指定 ARM Linux 配置文件,则默认开启此选项。

注意--enum_is_int不建议 将该选项用于一般用途。

4

1 回答 1

1

该选项可能会略微增加代码的内存占用量,但可能不会显着增加。它可以安全使用,并且在这种情况下是必需的,因为链接器不会链接对象被认为是不兼容的。

也就是说,您可以使用 --diag-warning=6242 命令行选项覆盖链接器错误,但生成的图像可能无法正常工作。

于 2012-09-17T17:42:05.940 回答