[lld] efbf5f5 - [lld] Prefer printf over echo -e
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 18:39:59 PDT 2025
Author: Aiden Grossman
Date: 2025-09-04T01:38:46Z
New Revision: efbf5f50f45c744922207d6ea692745d6c14599f
URL: https://github.com/llvm/llvm-project/commit/efbf5f50f45c744922207d6ea692745d6c14599f
DIFF: https://github.com/llvm/llvm-project/commit/efbf5f50f45c744922207d6ea692745d6c14599f.diff
LOG: [lld] Prefer printf over echo -e
Otherwise we break some MacOS bots when using the lit internal shell
because /bin/echo on MacOS does not support -e. Using the external shell
we end up using the echo builtin to /bin/bash, which does support this.
The echo builtin implementation in lit does support this, but that is
currently not enabled in pipelines. Might be worth looking into fixing
at some point.
Added:
Modified:
lld/test/COFF/reloc-discarded.s
lld/test/ELF/msp430.s
lld/test/ELF/weak-shared-gc.s
lld/test/ELF/weak-undef-lib.s
Removed:
################################################################################
diff --git a/lld/test/COFF/reloc-discarded.s b/lld/test/COFF/reloc-discarded.s
index 667df0faeb5a8..404f7978f726f 100644
--- a/lld/test/COFF/reloc-discarded.s
+++ b/lld/test/COFF/reloc-discarded.s
@@ -1,5 +1,5 @@
# REQUIRES: x86
-# RUN: echo -e '.section .bss,"bw",discard,main_global\n.global main_global\n main_global:\n .long 0' | \
+# RUN: printf '.section .bss,"bw",discard,main_global\n.global main_global\n main_global:\n .long 0' | \
# RUN: llvm-mc - -filetype=obj -o %t1.obj -triple x86_64-windows-msvc
# RUN: llvm-mc %s -filetype=obj -o %t2.obj -triple x86_64-windows-msvc
diff --git a/lld/test/ELF/msp430.s b/lld/test/ELF/msp430.s
index 39079ed596977..732af387d2619 100644
--- a/lld/test/ELF/msp430.s
+++ b/lld/test/ELF/msp430.s
@@ -1,6 +1,6 @@
; REQUIRES: msp430
; RUN: llvm-mc -filetype=obj -triple=msp430-elf -o %t1.o %s
-; RUN: echo -e '.global _start\n _start: nop' | llvm-mc -filetype=obj -triple=msp430-elf -o %t2.o -
+; RUN: printf '.global _start\n _start: nop' | llvm-mc -filetype=obj -triple=msp430-elf -o %t2.o -
; RUN: ld.lld -o %t.exe --image-base=0x1000 --Tdata=0x2000 --Ttext=0x8000 --defsym=_byte=0x21 -z separate-code %t2.o %t1.o
; RUN: llvm-objdump -s -d %t.exe | FileCheck %s
diff --git a/lld/test/ELF/weak-shared-gc.s b/lld/test/ELF/weak-shared-gc.s
index 833d7b7ab4095..2bba6341d750e 100644
--- a/lld/test/ELF/weak-shared-gc.s
+++ b/lld/test/ELF/weak-shared-gc.s
@@ -1,6 +1,6 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
-# RUN: echo -e '.globl __cxa_finalize\n__cxa_finalize:' | \
+# RUN: printf '.globl __cxa_finalize\n__cxa_finalize:' | \
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t2.o
# RUN: ld.lld %t2.o -o %t2.so -shared
# RUN: ld.lld %t1.o --as-needed --gc-sections %t2.so -o %t
diff --git a/lld/test/ELF/weak-undef-lib.s b/lld/test/ELF/weak-undef-lib.s
index 0ff1bc755f075..8f89c6f421ad0 100644
--- a/lld/test/ELF/weak-undef-lib.s
+++ b/lld/test/ELF/weak-undef-lib.s
@@ -1,6 +1,6 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
-# RUN: echo -e '.globl foo\nfoo: ret' | \
+# RUN: printf '.globl foo\nfoo: ret' | \
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t2.o
# RUN: ld.lld -shared -o %t.so %t1.o --start-lib %t2.o
More information about the llvm-commits
mailing list