Skip to content

compilers: Don't use -I=path in TI toolchains#15696

Open
gpollo wants to merge 1 commit intomesonbuild:masterfrom
gpollo:ti-compiler-include-path
Open

compilers: Don't use -I=path in TI toolchains#15696
gpollo wants to merge 1 commit intomesonbuild:masterfrom
gpollo:ti-compiler-include-path

Conversation

@gpollo
Copy link
Copy Markdown

@gpollo gpollo commented Apr 9, 2026

Meson currently uses the syntax -I=path instead of -Ipath when using Texas Instruments compilers.

This is problematic because it generates a compile_commands.json using this syntax and tools such as clangd will fail to use the compile_commands.json.

Now, I tried checking if there was TI compilers that only supported -I=path syntax 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=path and 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

@gpollo gpollo requested a review from dcbaker as a code owner April 9, 2026 20:01
@bonzini
Copy link
Copy Markdown
Contributor

bonzini commented Apr 13, 2026

@gpollo can you link to online documentation for these three compilers?

@gpollo gpollo force-pushed the ti-compiler-include-path branch from 9a93b36 to 7a95e9f Compare April 13, 2026 18:33
@gpollo
Copy link
Copy Markdown
Author

gpollo commented Apr 13, 2026

@bonzini I linked documentation on most TI compilers found here.

Additional Tests

I've a made a simple Docker image that installs all TI compilers from this page and tested them using -Ipath and also -Dkey=value (rather than -D=key=value, also Meson's current behavior) and they work.

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.bin

Inside 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants