Rev 17 | Rev 19 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 17 | Rev 18 | ||
|---|---|---|---|
| Line 14... | Line 14... | ||
| 14 | export LLVM_VERSION="16.0.6" # version of LLVM that will be built (ideally the same version as the libc++ supplied by QNX in their platform SDK) |
14 | export LLVM_VERSION="16.0.6" # version of LLVM that will be built (ideally the same version as the libc++ supplied by QNX in their platform SDK) |
| 15 | export LLVM_SOURCES_FILE="llvmorg-${LLVM_VERSION}.tar.gz" # name of the file containing LLVM version LLVM_VERSION sources |
15 | export LLVM_SOURCES_FILE="llvmorg-${LLVM_VERSION}.tar.gz" # name of the file containing LLVM version LLVM_VERSION sources |
| 16 | export LLVM_SOURCES_URL="https://github.com/llvm/llvm-project/archive/refs/tags/${LLVM_SOURCES_FILE}" # download URL of LLVM_SOURCES_FILE |
16 | export LLVM_SOURCES_URL="https://github.com/llvm/llvm-project/archive/refs/tags/${LLVM_SOURCES_FILE}" # download URL of LLVM_SOURCES_FILE |
| 17 | export LLVM_SOURCES_DIR="llvm-project-llvmorg-${LLVM_VERSION}" # name of directory created when extracting LLVM_SOURCES_FILE |
17 | export LLVM_SOURCES_DIR="llvm-project-llvmorg-${LLVM_VERSION}" # name of directory created when extracting LLVM_SOURCES_FILE |
| 18 | 18 | ||
| 19 | export LLVM_PROJECTS_TO_BUILD="clang;polly;lld" # semicolon-separated list of LLVM projects to build (full list: "clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl") |
19 | export LLVM_PROJECTS_TO_BUILD="clang;polly;lld;lldb" # semicolon-separated list of LLVM projects to build (full list: "clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl") |
| 20 | export LLVM_RUNTIMES_TO_BUILD="compiler-rt" # semicolon-separated list of LLVM runtimes to build (full list: "compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp") |
20 | export LLVM_RUNTIMES_TO_BUILD="compiler-rt" # semicolon-separated list of LLVM runtimes to build (full list: "compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp") |
| 21 | export LLVM_BUILD_CONFIGURATION_TYPE="MinSizeRel" # build configuration, one of "Debug", "Release", "RelWithDebugInfo" or "MinSizeRel" |
21 | export LLVM_BUILD_CONFIGURATION_TYPE="MinSizeRel" # build configuration, one of "Debug", "Release", "RelWithDebugInfo" or "MinSizeRel" |
| 22 | 22 | ||
| 23 | export REQUIRED_TOOLS="wget python3 cmake gcc g++ ninja ccache" # list of build tools required to build all this on the build host |
23 | export REQUIRED_TOOLS="wget python3 cmake gcc g++ ninja ccache" # list of build tools required to build all this on the build host |
| 24 | 24 | ||
| Line 280... | Line 280... | ||
| 280 | # with: |
280 | # with: |
| 281 | # TI.getTargetDefines(LangOpts, Builder); |
281 | # TI.getTargetDefines(LangOpts, Builder); |
| 282 | # #ifdef __QNXNTO__ |
282 | # #ifdef __QNXNTO__ |
| 283 | # Builder.defineMacro("__QNXNTO__", "1"); |
283 | # Builder.defineMacro("__QNXNTO__", "1"); |
| 284 | # Builder.defineMacro("__QNX__", "800"); // <-- set to QNX SDK version, without the intermediary dots |
284 | # Builder.defineMacro("__QNX__", "800"); // <-- set to QNX SDK version, without the intermediary dots |
| 285 | # #ifdef __x86_64__ |
- | |
| 286 | # Builder.defineMacro("__X86_64__", "1"); |
285 | # Builder.defineMacro("__X86_64__", "1"); // <-- set to either __X86_64__ or __AARCH64EL__ depending on the build target |
| 287 | # #else |
- | |
| 288 | # Builder.defineMacro("__AARCH64EL__", "1"); |
- | |
| 289 | # #endif |
- | |
| 290 | # Builder.defineMacro("__LITTLEENDIAN__", "1"); |
286 | # Builder.defineMacro("__LITTLEENDIAN__", "1"); |
| 291 | # Builder.defineMacro("__ELF__", "1"); |
287 | # Builder.defineMacro("__ELF__", "1"); |
| 292 | # #endif |
288 | # #endif |
| 293 | # RATIONALE: this adds the QNX-specific implicit preprocessor definitions. This is not the orthodox way of doing it. But we're in a hurry. |
289 | # RATIONALE: this adds the QNX-specific implicit preprocessor definitions. This is not the orthodox way of doing it. But we're in a hurry. |
| - | 290 | test "${BUILD_TARGET_ARCH}" = "x86_64" && PLATORM_NATIVE_ARCH_DEFINE="__X86_64__" || PLATORM_NATIVE_ARCH_DEFINE="__AARCH64EL__" |
|
| 294 | backup_and_patch_if_necessary "clang/lib/Frontend/InitPreprocessor.cpp" __QNXNTO__ \ |
291 | backup_and_patch_if_necessary "clang/lib/Frontend/InitPreprocessor.cpp" __QNXNTO__ \ |
| 295 | 's@TI\.getTargetDefines\(LangOpts, Builder\);@TI\.getTargetDefines\(LangOpts, Builder\);\n#ifdef __QNXNTO__\n Builder.defineMacro\("__QNXNTO__", "1"\);\n Builder.defineMacro("__QNX__", "'$(echo "${QNXSDK_VERSION}"|tr -d '.')'"); |
292 | 's@TI\.getTargetDefines\(LangOpts, Builder\);@TI\.getTargetDefines\(LangOpts, Builder\);\n#ifdef __QNXNTO__\n Builder.defineMacro\("__QNXNTO__", "1"\);\n Builder.defineMacro("__QNX__", "'$(echo "${QNXSDK_VERSION}"|tr -d '.')'");\n Builder.defineMacro\("'${PLATORM_NATIVE_ARCH_DEFINE}'", "1"\);\n Builder.defineMacro\("__LITTLEENDIAN__", "1"\);\n Builder.defineMacro\("__ELF__", "1"\);\n#endif@' |
| 296 | fi |
293 | fi |
| 297 | 294 | ||
| 298 | # LLDB patches |
295 | # LLDB patches |
| 299 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "lldb"; then |
296 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "lldb"; then |
| 300 | 297 | ||