Open inochisa opened 1 week ago
@lupyuen any idea?
@acassis Sorry I'm not sure how we might fix this
@lupyuen Is it possible to always enable "--whole-archive" for all library? As DEBUG_OPT_UNUSED_SECTIONS
is enabled by default, it may have no change for the final binary.
Is it possible to always enable "--whole-archive" for all library? As
DEBUG_OPT_UNUSED_SECTIONS
is enabled by default, it may have no change for the final binary.
@xiaoxiang781216 and @tmedicci would you know about "--whole-archive" and DEBUG_OPT_UNUSED_SECTIONS
? Sorry I'm not sure about this.
It seems that only using --whole-archive"
for kernel library is better idea. I found an example in zephyr.
https://github.com/zephyrproject-rtos/zephyr/blob/main/cmake/linker/ld/target.cmake#L127-L143
Is it possible to always enable "--whole-archive" for all library? As
DEBUG_OPT_UNUSED_SECTIONS
is enabled by default, it may have no change for the final binary.@xiaoxiang781216 and @tmedicci would you know about "--whole-archive" and
DEBUG_OPT_UNUSED_SECTIONS
? Sorry I'm not sure about this.
--whole-archive will pack all library into one before linking.
Is it possible to always enable "--whole-archive" for all library? As
DEBUG_OPT_UNUSED_SECTIONS
is enabled by default, it may have no change for the final binary.@xiaoxiang781216 and @tmedicci would you know about "--whole-archive" and
DEBUG_OPT_UNUSED_SECTIONS
? Sorry I'm not sure about this.--whole-archive will pack all library into one before linking.
The man says it changes the symbol searching, not packing archive.
When enabling
CONFIG_DEBUG_LINK_WHOLE_ARCHIVE
, building flat mode nuttx with qemu-rv core always failed.This is the log when building
flats64
I have added
weak_function
to the definition of the functionup_allocate_heap
in riscv_allocateheap.c, but it may selected wrong symbol without enablingCONFIG_DEBUG_LINK_WHOLE_ARCHIVE
. After googling, I found that ld only uses the first matched symbol in the archive (whether it is strong or weak). Is there any suggestion about how to fix this?