compilers: Don't use -I=path in TI toolchains#15696
Open
gpollo wants to merge 1 commit intomesonbuild:masterfrom
Open
compilers: Don't use -I=path in TI toolchains#15696gpollo wants to merge 1 commit intomesonbuild:masterfrom
gpollo wants to merge 1 commit intomesonbuild:masterfrom
Conversation
Contributor
|
@gpollo can you link to online documentation for these three compilers? |
9a93b36 to
7a95e9f
Compare
Author
|
@bonzini I linked documentation on most TI compilers found here. Additional TestsI've a made a simple Docker image that installs all TI compilers from this page and tested them using FROM ubuntu:24.04
ENV TI_BASE_URL="https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/"
ENV CGT_ARM_URL="${TI_BASE_URL}/MD-sDOoXkUcde/20.2.7.LTS/ti_cgt_tms470_20.2.7.LTS_linux-x64_installer.bin"
ENV CGT_MSP_URL="${TI_BASE_URL}/MD-p4jWEYpR8n/21.6.2.LTS/ti_cgt_msp430_21.6.2.LTS_linux-x64_installer.bin"
ENV CGT_C2000_URL="${TI_BASE_URL}/MD-xqxJ05PLfM/25.11.0.LTS/ti_cgt_c2000_25.11.0.LTS_linux-x64_installer.bin"
ENV CGT_C6000_URL="${TI_BASE_URL}/MD-vqU2jj6ibH/8.5.0.LTS/ti_cgt_c6000_8.5.0.LTS_linux-x64_installer.bin"
ENV CGT_C7000_URL="${TI_BASE_URL}/MD-707zYe3Rik/5.0.1.LTS/ti_cgt_c7000_5.0.1.LTS_linux-x64_installer.bin"
ENV PRU_CGT_URL="${TI_BASE_URL}/MD-FaNNGkDH7s/2.3.3/ti_cgt_pru_2.3.3_linux_installer_x86.bin"
ENV TIMEZONE="America/Montreal"
########################
# Install requirements #
########################
RUN export DEBIAN_FRONTEND=noninteractive \
&& ln -s "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime \
&& apt update -y \
&& apt install -y \
build-essential \
clangd \
curl \
file \
git \
ninja-build \
pipx \
xz-utils
###################
# Install ARM-CGT #
###################
RUN cd /tmp \
&& curl "${CGT_ARM_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.bin
###################
# Install MSP-CGT #
###################
RUN cd /tmp \
&& curl "${CGT_MSP_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.bin
#####################
# Install C2000-CGT #
#####################
RUN cd /tmp \
&& curl "${CGT_C2000_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.bin
#####################
# Install C6000-CGT #
#####################
RUN cd /tmp \
&& curl "${CGT_C6000_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.bin
#####################
# Install C7000-CGT #
#####################
RUN cd /tmp \
&& curl "${CGT_C7000_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.bin
###################
# Install PRU-CGT #
###################
RUN cd /tmp \
&& curl "${PRU_CGT_URL}" -o toolchain.bin \
&& chmod +x toolchain.bin \
&& ./toolchain.bin --mode unattended --prefix /opt/ \
&& rm -v toolchain.binInside the container, I used this script to test the arguments and they all worked. #/bin/bash
/opt/ti-cgt-arm_20.2.7.LTS/bin/armcl -Itest -DDEFINED_VALUE=12 foo.c -o foo1.o
/opt/ti-cgt-c2000_25.11.0.LTS/bin/cl2000 -Itest -DDEFINED_VALUE=12 foo.c -o foo2.o
/opt/ti-cgt-c6000_8.5.0.LTS/bin/cl6x -Itest -DDEFINED_VALUE=12 foo.c -o foo3.o
/opt/ti-cgt-c7000_5.0.1.LTS/bin/cl7x -Itest -DDEFINED_VALUE=12 foo.c -o foo4.o
/opt/ti-cgt-msp430_21.6.2.LTS/bin/cl430 -Itest -DDEFINED_VALUE=12 foo.c -o foo5.o
/opt/ti-cgt-pru_2.3.3/bin/clpru -Itest -DDEFINED_VALUE=12 foo.c -o foo6.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meson currently uses the syntax
-I=pathinstead of-Ipathwhen using Texas Instruments compilers.This is problematic because it generates a
compile_commands.jsonusing this syntax and tools such asclangdwill fail to use thecompile_commands.json.Now, I tried checking if there was TI compilers that only supported
-I=pathsyntax and I couldn't find any. I checked TI CGT, TI MSP430 and TI C2000 compilers, which were the compilers that were initially supported by Meson. I also did a deep research with Gemini and it couldn't find a TI compiler that required-I=pathand even discouraged it (not perfect tools, to take with a grain of salt).Additional Changes
I've found out that the same can be said of
--define=foo. It should be-Dfoo.Related Documentation