Skip to content

Conversation

@ZivLow
Copy link
Contributor

@ZivLow ZivLow commented Nov 19, 2025

  • add linker option --whole-archive so that all the symbols inside static libaries will be looked through
  • during linking stage, will encounter undefined reference to pmu_yield_os_check, pmu_acquire_wakelock, pmu_release_wakelock when using linker option --whole-archive on EXTRA_LIBS, because linker will looking through all the symbols
  • remove rtw_timer.c, rtw_wakelock.c, rtw_atomic.c from lib_wifi_com_sec.a, so that linker will use the customized rtw_timer.c, rtw_wakelock.c, rtw_atomic.c source files compiled directly at TizenRT, instead of using the definitions from lib_wifi_com_sec.a
  • in order to make linker prefer the rtw_timer, rtw_wakelock, rtw_atomic symbols compiled directly at TizenRT, these symbols have been changed to weak inside the wifi static libraries lib_wifi_inic_ap.a, lib_wpa_lite.a, lib_wps.a

…TRA_LIBS

- add linker option --whole-archive so that all the symbols inside static libaries will be looked through
- from linux man pages for ld (linker)
   --whole-archive
       For each archive mentioned on the command line after the
       --whole-archive option, include every object file in the archive in
       the link, rather than searching the archive for the required object
       files.  This is normally used to turn an archive file into a shared
       library, forcing every object to be included in the resulting
       shared library.  This option may be used more than once.

       Two notes when using this option from gcc: First, gcc doesn't know
       about this option, so you have to use -Wl,-whole-archive.  Second,
       don't forget to use -Wl,-no-whole-archive after your list of
       archives, because gcc will add its own list of archives to your
       link and you may not want this flag to affect those as well.
…rom lib_wifi_com_sec.a

- during linking stage, will encounter undefined reference to pmu_yield_os_check, pmu_acquire_wakelock, pmu_release_wakelock when using linker option --whole-archive on EXTRA_LIBS, because linker will looking through all the symbols
- remove rtw_timer.c, rtw_wakelock.c, rtw_atomic.c from lib_wifi_com_sec.a, so that linker will use the customized rtw_timer.c, rtw_wakelock.c, rtw_atomic.c source files compiled directly at TizenRT, instead of using the definitions from lib_wifi_com_sec.a
- in order to make linker prefer the rtw_timer, rtw_wakelock, rtw_atomic symbols compiled directly at TizenRT, these symbols have been changed to weak inside the wifi static libraries lib_wifi_inic_ap.a, lib_wpa_lite.a, lib_wps.a
@ZivLow ZivLow force-pushed the ailite_undefined_reference_pmu_function branch from 08fa4cb to 71be477 Compare November 19, 2025 10:24
Copy link
Contributor

@ewoodev ewoodev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rtw_timer.c, rtw_wakelock.c, rtw_atomic.c was moved out of lib_wifi_com_sec.a

63dfbc6

@sunghan-chang sunghan-chang requested a review from hk-gwak December 5, 2025 11:50
@sunghan-chang
Copy link
Contributor

@hk-gwak This is the PR for wifi. Please review and merge this.

@hk-gwak
Copy link
Collaborator

hk-gwak commented Dec 7, 2025

Why rtw_timer.c, rtw_wakelock.c, rtw_atomic.c is moved out of lib_wifi_com_sec.a?

@@ -1,5 +1,9 @@
/* == "version" + "Realtek git version" + "compile date" + "compile time" == */

== version 8382ffd8 2025/11/19-17:07:47 ==
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are OK

@ZivLow
Copy link
Contributor Author

ZivLow commented Dec 8, 2025

Why rtw_timer.c, rtw_wakelock.c, rtw_atomic.c is moved out of lib_wifi_com_sec.a?

Samsung product code seems to have different build process compared to public github TizenRT, and will look through the symbols like at lib_wifi_com_sec.a, instead of the normal default gcc linker behaviour of finding the first symbol definition, and then ignore the rest of symbol definitions in other libraries.

Technically, I think it is possible to have the compiled customized rtw_timer.c, rtw_wakelock.c, rtw_atomic.c inside lib_wifi_com_sec.a, and then remove the rtw_timer.c, rtw_wakelock.c, rtw_atomic.c source files in TizenRT.

But leaving the source code open in github TizenRT may be helpful when using debugger on CA32.

Copy link
Collaborator

@hk-gwak hk-gwak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment and mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants