This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 54fe063f740f0f8ba4b1169bf88bc8278d92d389
Author: Marco Casaroli <[email protected]>
AuthorDate: Wed Oct 21 02:24:35 2026 +0200

    tools/mkexport.sh: Remove only the -T options from LDELFFLAGS.
    
    mkexport.sh removed the linker script from LDELFFLAGS with
    "sed -e 's:-T.*ld::'".  The pattern is greedy: it removed everything
    from the first -T to the last "ld" in the string.  On xtensa, crt0.o
    comes after the -T option, so when the path of the tree contains "ld"
    (for example ".../build/nuttx"), the export got a broken path.
    esp32s3-devkit:nsh in .../wt-w2/build-mkexport exported
    "LDELFFLAGS = -e _start -r -mkexport/arch/xtensa/src/crt0.o".
    
    Remove only the -T options whose argument ends in ".ld".  The same
    build now exports the full path of crt0.o.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 tools/mkexport.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/mkexport.sh b/tools/mkexport.sh
index 27b3db7917b..3171330dbe0 100755
--- a/tools/mkexport.sh
+++ b/tools/mkexport.sh
@@ -234,9 +234,10 @@ if [ "X${USRONLY}" != "Xy" ]; then
   done
 fi
 
-# Drop kernel folder elf/gnu-elf.ld as the exported script shall suffice
+# Drop kernel folder elf/gnu-elf.ld as the exported script shall suffice.
+# Remove only the -T options, not the options after them.
 
-LDELFFLAGS=$(echo "$LDELFFLAGS" | sed -e 's:-T.*ld::')
+LDELFFLAGS=$(echo "$LDELFFLAGS" | sed -e 's:-T *[^ ]*\.ld::g')
 
 # Set LDMODULEFLAGS so that kernel modules can build in kernel mode
 

Reply via email to