我目前正在使用arm env的英特爾x118平臺上工作。我發現我必須強制打開這個選項,以確保鏈路沒有問題,否則會出現像錯誤:enum_is_int選項
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
此選項強制所有枚舉類型的大小至少爲4個字節。
默認情況下關閉此選項,並且使用可以容納所有枚舉數值的最小數據類型。
如果在命令行上指定ARM Linux配置文件,則默認情況下打開此選項。
備註 --enum_is_int
選項不建議用於一般用途。
如果您可以自己重建這些對象文件,那麼*您*可以告訴......兩種方式構建項目(包括所有這些對象文件)並進行比較。如果由於某種原因(如沒有源代碼)無法重建這些目標文件,那麼看起來你可能沒有多少選擇。比較某些不適用的東西並沒有太多意義。 –
是的,我可以重建這個objs,我只想知道,如果這個'--enum_is_int'選項被啓用,對我的目標文件有什麼影響 –
我認爲它使枚舉採用'int'類型而不是更小的東西,比如如果您爲枚舉定義的所有值都在該範圍內(這是嵌入式目標的常見C擴展),則爲'char'。據推測,它會讓你的一些數據結構更大一些,並且可能會對代碼大小產生一些影響,但是很難準確猜測(可能會減小代碼大小)。沒有更多的信息,任何比這更詳細的分析可能只是猜測。你最好的選擇就是建立兩種方式並進行比較。 –