From dc7ee520ecb3b2082255cc87f4ebe6ef18b4ae5a Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 25 Jun 2026 00:06:17 -0500 Subject: [PATCH 1/2] ld_bfd.py compiler argument should be C++ not C --- src/trusted/service_runtime/build.scons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trusted/service_runtime/build.scons b/src/trusted/service_runtime/build.scons index 085d948378..8d92add4d7 100644 --- a/src/trusted/service_runtime/build.scons +++ b/src/trusted/service_runtime/build.scons @@ -417,7 +417,7 @@ if (env.Bit('linux') and not env.Bit('built_elsewhere')): elif env.Bit('build_arm'): ld_emul = 'armelf_linux_eabi' reserve_top = '0x40002000' - compiler_override = '--compiler arm-linux-gnueabihf-gcc' + compiler_override = '--compiler arm-linux-gnueabihf-g++' elif env.Bit('build_mips32'): ld_emul = 'elf32ltsmip' reserve_top = '0x40008000' From 353552cffb5e99b7e7a450e9b372c862a304c3e2 Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 25 Jun 2026 00:07:04 -0500 Subject: [PATCH 2/2] Don't use GCC to find ld.bfd Now when building with Clang, you only have to install GNU binutils, not the whole GCC. --- src/trusted/service_runtime/linux/ld_bfd.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/trusted/service_runtime/linux/ld_bfd.py b/src/trusted/service_runtime/linux/ld_bfd.py index 7385e28c86..e477efbdaa 100755 --- a/src/trusted/service_runtime/linux/ld_bfd.py +++ b/src/trusted/service_runtime/linux/ld_bfd.py @@ -69,10 +69,15 @@ def main(args): else: cxx_bin = os.getenv('CXX', 'g++') - args = [FindLDBFD(cxx_bin)] + args - libgcc = FindLibgcc(cxx_bin) - if libgcc is not None: - args.append(libgcc) + if 0: + args = [FindLDBFD(cxx_bin)] + args + libgcc = FindLibgcc(cxx_bin) + if libgcc is not None: + args.append(libgcc) + else: + assert cxx_bin.endswith("g++") + ld = cxx_bin[:-3] + "ld.bfd" + args = [ld] + args return subprocess.call(args) if __name__ == "__main__":