Part 1
요약·해설
Xtensa Xplorer와 SoC add-on 설치, XCC·Clang compiler 선택, license와 네 가지 환경 변수, 오래된 LLVM assembler 오류 우회를 설명합니다.
SDK
Xplorer · SoC add-on
Compiler
xcc · xt-clang
Target
core · version
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
2D7A5B3B96457D4A82F93770E1FDED54FD645878C5D0761893BCA5C8E4CFD01B
.. _toolchain_cadence_xcc:
Cadence Tensilica Xtensa C/C++ Compiler (XCC)
#############################################
#. Obtain Tensilica Software Development Toolkit targeting the specific SoC
on hand. This usually contains two parts:
* The Xtensa Xplorer which contains the necessary executables and
libraries.
* A SoC-specific add-on to be installed on top of Xtensa Xplorer.
* This add-on allows the compiler to generate code for the SoC on hand.
#. Install Xtensa Xplorer and then the SoC add-on.
* Follow the instruction from Cadence on how to install the SDK.
* Depending on the SDK, there are two set of compilers:
* GCC-based compiler: ``xt-xcc`` and its friends.
* Clang-based compiler: ``xt-clang`` and its friends.
#. Make sure you have obtained a license to use the SDK, or has access to
a remote licensing server.
#. :ref:`Set these environment variables <env_vars>`:
* Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``xcc`` or ``xt-clang``.
* Set :envvar:`XTENSA_TOOLCHAIN_PATH` to the toolchain installation
directory.
* Set :envvar:`XTENSA_CORE` to the SoC ID where application is being
targeting.
* Set :envvar:`TOOLCHAIN_VER` to the Xtensa SDK version.
#. For example, assuming the SDK is installed in ``/opt/xtensa``, and
using the SDK for application development on ``intel_adsp_cavs15``,
setup the environment using:
.. code-block:: console
# Linux
export ZEPHYR_TOOLCHAIN_VARIANT=xcc
export XTENSA_TOOLCHAIN_PATH=/opt/xtensa/XtDevTools/install/tools/
export XTENSA_CORE=X6H3SUE_RI_2018_0
export TOOLCHAIN_VER=RI-2018.0-linux
#. To use Clang-based compiler:
* Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``xt-clang``.
* Note that the Clang-based compiler may contain an old LLVM bug which
results in the following error:
.. code-block:: console
/tmp/file.s: Assembler messages:
/tmp/file.s:20: Error: file number 1 already allocated
clang-3.9: error: Xtensa-as command failed with exit code 1
If this happens, set :envvar:`XCC_NO_G_FLAG` to ``1``.
* For example:
.. code-block:: console
# Linux
export XCC_NO_G_FLAG=1
Part 3
한국어 전문 번역
Cadence Tensilica XCC 설정
- 대상 SoC용 Tensilica Software Development Toolkit을 준비합니다. 보통 필요한 executable과 library를 담은 Xtensa Xplorer, 그리고 그 위에 설치해 compiler가 해당 SoC code를 생성하게 하는 SoC 전용 add-on의 두 부분으로 구성됩니다.
- Cadence 안내에 따라 Xtensa Xplorer와 SoC add-on을 차례로 설치합니다. SDK에 따라 GCC 기반
xt-xcc계열 또는 Clang 기반xt-clang계열 compiler가 제공됩니다. - SDK 사용 license를 확보하거나 remote license server에 접근할 수 있어야 합니다.
- 환경 변수 설정 안내에 따라
ZEPHYR_TOOLCHAIN_VARIANT를xcc또는xt-clang으로,XTENSA_TOOLCHAIN_PATH를 설치 directory로,XTENSA_CORE를 대상 SoC ID로,TOOLCHAIN_VER을 Xtensa SDK version으로 설정합니다.
/opt/xtensa에 SDK를 설치하고 intel_adsp_cavs15용 application을 개발하는 Linux 예:
# Linux
export ZEPHYR_TOOLCHAIN_VARIANT=xcc
export XTENSA_TOOLCHAIN_PATH=/opt/xtensa/XtDevTools/install/tools/
export XTENSA_CORE=X6H3SUE_RI_2018_0
export TOOLCHAIN_VER=RI-2018.0-linuxClang 기반 compiler
xt-clang을 사용하려면 ZEPHYR_TOOLCHAIN_VARIANT=xt-clang으로 설정합니다. 다만 SDK의 Clang에 오래된 LLVM bug가 포함되어 다음 오류가 발생할 수 있습니다.
/tmp/file.s: Assembler messages:
/tmp/file.s:20: Error: file number 1 already allocated
clang-3.9: error: Xtensa-as command failed with exit code 1이 오류가 발생하면 debug 정보용 -g option을 억제하도록 XCC_NO_G_FLAG=1을 설정합니다.
# Linux
export XCC_NO_G_FLAG=1
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.