casaroli commented on code in PR #3882:
URL: https://github.com/apache/nuttx-apps/pull/3882#discussion_r4329029500


##########
Make.defs:
##########
@@ -23,6 +23,12 @@
 TOPDIR ?= $(APPDIR)/import
 -include $(TOPDIR)/Make.defs
 
+# Send the emulated TLS calls of loadable modules and of the programs of a
+# kernel build to libc (EMUTLS_LDFLAGS: see tools/Config.mk of NuttX)
+
+LDELFFLAGS += $(EMUTLS_LDFLAGS)

Review Comment:
   `EMUTLS_LDFLAGS` comes from `tools/Config.mk`, but `Config.mk` is included 
before the arch `Toolchain.defs`, which sets `LDELFFLAGS` and `LDMODULEFLAGS` 
with `=`, so `Config.mk` cannot add to them. After `Toolchain.defs`, 28 board 
`Make.defs` files set them again with `=` (for example 
`boards/arm/stm32h7/openh743i/scripts/Make.defs:49`, 
`boards/arm/samv7/samv71-xult/configs/knsh/Make.defs:59`, 
`boards/arm64/imx9/imx95-a55-evk/scripts/Make.defs:45`, 
`boards/renesas/rx65n/rx65n/scripts/Make.defs:59`, 
`boards/sim/sim/sim/scripts/Make.defs:273,304`), and `tools/mkexport.sh:243` 
sets `LDMODULEFLAGS="-r"` for the export. To do it in NuttX, I must change the 
`Toolchain.defs` of every arch that can use emulated TLS, these board files and 
`mkexport.sh`. apps `Make.defs` is the first place after all of them, so the 
two lines here cover every board and the export.
   
   If you prefer the NuttX side, I can first remove the board lines that only 
repeat the arch values (some point to `binfmt/elf/gnu-elf.ld`, which is gone) 
in a separate PR, and then add `$(EMUTLS_LDFLAGS)` where `Toolchain.defs` sets 
the two variables. Is this what you want?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to