Rev 14 | Rev 17 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 14 | Rev 16 | ||
|---|---|---|---|
| Line 258... | Line 258... | ||
| 258 | # Specifically read the following patch list: https://reviews.llvm.org/D109977 -- it looks like the implementation of this diff in LLVM 16.0.6 is incomplete. |
258 | # Specifically read the following patch list: https://reviews.llvm.org/D109977 -- it looks like the implementation of this diff in LLVM 16.0.6 is incomplete. |
| 259 | # This patch restores a working state (ante D109977). |
259 | # This patch restores a working state (ante D109977). |
| 260 | test "$(echo "${LLVM_VERSION}"|cut -d . -f 1)" -lt 17 && backup_and_patch_if_necessary "llvm/lib/Support/Path.cpp" "#if 0" \ |
260 | test "$(echo "${LLVM_VERSION}"|cut -d . -f 1)" -lt 17 && backup_and_patch_if_necessary "llvm/lib/Support/Path.cpp" "#if 0" \ |
| 261 | 's@std::string getMainExecutable@#if 0\nstd::string getMainExecutable@' \ |
261 | 's@std::string getMainExecutable@#if 0\nstd::string getMainExecutable@' \ |
| 262 | 's@TempFile::TempFile\(StringRef Name, int FD\)@#endif\nTempFile::TempFile\(StringRef Name, int FD\)@' |
262 | 's@TempFile::TempFile\(StringRef Name, int FD\)@#endif\nTempFile::TempFile\(StringRef Name, int FD\)@' |
| - | 263 | ||
| - | 264 | # Clang front-end patches |
|
| - | 265 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "clang"; then |
|
| - | 266 | ||
| - | 267 | # patch clang/lib/Frontend/InitPreprocessor.cpp |
|
| - | 268 | # replace: |
|
| - | 269 | # TI.getTargetDefines(LangOpts, Builder); |
|
| - | 270 | # with: |
|
| - | 271 | # TI.getTargetDefines(LangOpts, Builder); |
|
| - | 272 | # #ifdef __QNXNTO__ |
|
| - | 273 | # Builder.defineMacro("__QNXNTO__", "1"); |
|
| - | 274 | # Builder.defineMacro("__QNX__", "800"); // <-- set to QNX SDK version, without the intermediary dots |
|
| - | 275 | # #ifdef __x86_64__ |
|
| - | 276 | # Builder.defineMacro("__X86_64__", "1"); |
|
| - | 277 | # #else |
|
| - | 278 | # Builder.defineMacro("__AARCH64EL__", "1"); |
|
| - | 279 | # #endif |
|
| - | 280 | # Builder.defineMacro("__LITTLEENDIAN__", "1"); |
|
| - | 281 | # Builder.defineMacro("__ELF__", "1"); |
|
| - | 282 | # #endif |
|
| - | 283 | # RATIONALE: this adds the QNX-specific implicit preprocessor definitions. This is not the orthodox way of doing it. But we're in a hurry. |
|
| - | 284 | backup_and_patch_if_necessary "clang/lib/Frontend/InitPreprocessor.cpp" __QNXNTO__ \ |
|
| - | 285 | '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#ifdef __x86_64__\n Builder.defineMacro\("__X86_64__", "1"\);\n#else\n Builder.defineMacro("__AARCH64EL__", "1");\n#endif\n Builder.defineMacro\("__LITTLEENDIAN__", "1"\);\n Builder.defineMacro\("__ELF__", "1"\);\n#endif@' |
|
| - | 286 | fi |
|
| 263 | 287 | ||
| 264 | # LLDB patches |
288 | # LLDB patches |
| 265 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "lldb"; then |
289 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "lldb"; then |
| 266 | 290 | ||
| 267 | # patch lldb/Source/Host/common/Host.cpp if not done yet |
291 | # patch lldb/Source/Host/common/Host.cpp if not done yet |
| Line 461... | Line 485... | ||
| 461 | -D CMAKE_CXX_COMPILER_LAUNCHER="ccache" \ |
485 | -D CMAKE_CXX_COMPILER_LAUNCHER="ccache" \ |
| 462 | -D LLVM_HOST_TRIPLE="${TARGET_TRIPLE}" \ |
486 | -D LLVM_HOST_TRIPLE="${TARGET_TRIPLE}" \ |
| 463 | -D LLVM_ENABLE_PROJECTS="${LLVM_PROJECTS_TO_BUILD}" \ |
487 | -D LLVM_ENABLE_PROJECTS="${LLVM_PROJECTS_TO_BUILD}" \ |
| 464 | -D LLVM_ENABLE_RUNTIMES="${LLVM_RUNTIMES_TO_BUILD}" \ |
488 | -D LLVM_ENABLE_RUNTIMES="${LLVM_RUNTIMES_TO_BUILD}" \ |
| 465 | -D LLVM_TARGETS_TO_BUILD="AArch64;X86" \ |
489 | -D LLVM_TARGETS_TO_BUILD="AArch64;X86" \ |
| - | 490 | -D DEFAULT_SYSROOT="../../../../../${QNXSDK_TARGETPATH}/${BUILD_TARGET_ARCH}" \ |
|
| - | 491 | -D CLANG_DEFAULT_LINKER="lld" \ |
|
| - | 492 | -D CLANG_DEFAULT_CXX_STDLIB="libc++" \ |
|
| 466 | -D COMPILER_RT_BUILD_SANITIZERS="OFF" \ |
493 | -D COMPILER_RT_BUILD_SANITIZERS="OFF" \ |
| 467 | -D COMPILER_RT_BUILD_XRAY="OFF" \ |
494 | -D COMPILER_RT_BUILD_XRAY="OFF" \ |
| 468 | -D COMPILER_RT_BUILD_MEMPROF="OFF" \ |
495 | -D COMPILER_RT_BUILD_MEMPROF="OFF" \ |
| 469 | -D COMPILER_RT_BUILD_LIBFUZZER="OFF" \ |
496 | -D COMPILER_RT_BUILD_LIBFUZZER="OFF" \ |
| 470 | -D COMPILER_RT_BUILD_PROFILE="OFF" \ |
497 | -D COMPILER_RT_BUILD_PROFILE="OFF" \ |