Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion arm-software/embedded/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,11 @@ set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL)
set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${LLVM_TOOLCHAIN_C_LIBRARY}-overlay-${PACKAGE_VERSION})
else()
set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${CPACK_SYSTEM_NAME})
if(LLVM_TOOLCHAIN_C_LIBRARY EQUAL "picolibc")
set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${CPACK_SYSTEM_NAME})
else()
set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${LLVM_TOOLCHAIN_C_LIBRARY}-${CPACK_SYSTEM_NAME})
endif()
endif()
set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME})

Expand Down
26 changes: 26 additions & 0 deletions arm-software/embedded/scripts/build_llvmlibc_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Copyright (c) 2025, Arm Limited and affiliates.
# Part of the Arm Toolchain project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Build Arm Toolchain for Embedded with llvmlibc as the default C library

# The script creates a build of the toolchain in the 'build_llvmlibc_toolchain'
# directory, inside the repository tree.

set -ex

export CC=clang
export CXX=clang++

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPO_ROOT=$( git -C ${SCRIPT_DIR} rev-parse --show-toplevel )
Copy link
Contributor

Choose a reason for hiding this comment

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

Shell quoting nits: ${SCRIPT_DIR} in this line should be double-quoted. So should ${BUILD_DIR} in the mkdir and cd commands below.

(But it's OK not to quote these $(...) constructs on the RHS of an assignment, or the ${REPO_ROOT} in the assignment to BUILD_DIR, because in that context, the shell decides what's the RHS of a variable assignment before expanding those things into stuff that might contain spaces.)

BUILD_DIR=${REPO_ROOT}/build_llvmlibc_toolchain

mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}

cmake ../arm-software/embedded -GNinja -DFETCHCONTENT_QUIET=OFF -DLLVM_TOOLCHAIN_C_LIBRARY=llvmlibc
ninja package-llvm-toolchain