Rev 33 | Rev 35 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 33 | Rev 34 | ||
|---|---|---|---|
| Line 254... | Line 254... | ||
| 254 | # that branch into FreeBSD APIs (which ones *are* exposed in the QNX libc since QNX largely shares FreeBSD code) are about to be patched right now to accept __QNXNTO__ too. |
254 | # that branch into FreeBSD APIs (which ones *are* exposed in the QNX libc since QNX largely shares FreeBSD code) are about to be patched right now to accept __QNXNTO__ too. |
| 255 | # Additionally, support for statfs()/fstatfs() has been restored in the QNX8 platform SDK in /usr/include/devs/sys/mount.h where it was claimed but absent from the QNX8 libc. |
255 | # Additionally, support for statfs()/fstatfs() has been restored in the QNX8 platform SDK in /usr/include/devs/sys/mount.h where it was claimed but absent from the QNX8 libc. |
| 256 | # FIXME: these hacks should be moved elsewhere not to pollute the QNX8 platform SDK -- it *SHOULD* be possible to build without devs |
256 | # FIXME: these hacks should be moved elsewhere not to pollute the QNX8 platform SDK -- it *SHOULD* be possible to build without devs |
| 257 | backup_and_patch_if_necessary "llvm/lib/Support/Unix/Path.inc" __QNXNTO__ \ |
257 | backup_and_patch_if_necessary "llvm/lib/Support/Unix/Path.inc" __QNXNTO__ \ |
| 258 | 's@defined\(__FreeBSD_kernel__\)@\(defined\(__FreeBSD_kernel__\) \|\| \defined\(__QNXNTO__\)\)@g' |
258 | 's@defined\(__FreeBSD_kernel__\)@\(defined\(__FreeBSD_kernel__\) \|\| \defined\(__QNXNTO__\)\)@g' |
| 259 | - | ||
| 260 | # -- 20240621 -- DISABLED -- the only other place (aside from llvm/lib/Support) where getMainExecutable() is defined is in ClangLinkerWrapper.cpp which is the LLD wrapper frontend. |
- | |
| 261 | # -- 20240621 -- DISABLED -- actually llvm/lib/Support/Unix/Path.inc defines *getMainExecutableImpl* and not getMainExecutable, despite what the function comments say. So the code is right. |
- | |
| 262 | # -- 20240621 -- DISABLED -- This block can be removed after a few successful thorough rebuilds. |
- | |
| 263 | ## LLVM 16: patch llvm/lib/Support/Path.cpp if not done yet |
- | |
| 264 | ## replace: |
- | |
| 265 | ## std::string getMainExecutable |
- | |
| 266 | ## with: |
- | |
| 267 | ## #if 0 |
- | |
| 268 | ## std::string getMainExecutable |
- | |
| 269 | ## and: |
- | |
| 270 | ## TempFile::TempFile(StringRef Name, int FD) |
- | |
| 271 | ## with: |
- | |
| 272 | ## #endif |
- | |
| 273 | ## TempFile::TempFile(StringRef Name, int FD) |
- | |
| 274 | ## RATIONALE: std::string getMainExecutable(const char *Argv0, void *MainAddr) is already defined in llvm/lib/Support/Unix/Path.inc, this looks like a LLVM bug? |
- | |
| 275 | ## 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. |
- | |
| 276 | ## This patch restores a working state (ante D109977). |
- | |
| 277 | #test "$(echo "${LLVM_VERSION}"|cut -d . -f 1)" -lt 17 && backup_and_patch_if_necessary "llvm/lib/Support/Path.cpp" "#if 0" \ |
- | |
| 278 | # 's@std::string getMainExecutable@#if 0\nstd::string getMainExecutable@' \ |
- | |
| 279 | # 's@TempFile::TempFile\(StringRef Name, int FD\)@#endif\nTempFile::TempFile\(StringRef Name, int FD\)@' |
- | |
| 280 | 259 | ||
| 281 | # Clang front-end patches |
260 | # Clang front-end patches |
| 282 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "clang"; then |
261 | if echo "${LLVM_PROJECTS_TO_BUILD}"|tr ';' '\n'|grep -q "clang"; then |
| 283 | 262 | ||
| 284 | # patch clang/lib/Frontend/InitPreprocessor.cpp |
263 | # patch clang/lib/Frontend/InitPreprocessor.cpp |