[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-13 Thread Aaron Siddhartha Mondal via Phabricator via cfe-commits
aaronmondal added a subscriber: aaron.ballman. aaronmondal added a comment. Ok so I went over https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#testing-for-the-presence-of-a-header-__has_include (thanks, @aaron.ballman 😊) and through the commit history for the amdg

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-11 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. FWIW, there are methods in CMake to check if features (such as if a struct contains specific data member, or if a library contains APIs). I think that would be the right way to fix the issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Actually, I might want to optionally link this stuff in the `libc` project in the future as well. That would be a dependency only required for tests but it might be compelling then. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Like I said, the difference between these dependencies and something like `libxml2` or `libz` is that the presence of the libraries doesn't guard any features. We can build the application both ways, the only difference is runtime cost if we don't link the library direc

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Aaron Siddhartha Mondal via Phabricator via cfe-commits
aaronmondal added a comment. This would also allow e.g. the ROCm packages to `FORCE_ON` hsa and enjoy the benefits of the LLVM configuration 😊 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143768/new/ https://reviews.llvm.org/D143768

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Aaron Siddhartha Mondal via Phabricator via cfe-commits
aaronmondal added a comment. Fun fact I now know that libxml2 also struggles with this 😆 The following would roughly be how zlib and others handle it: if (CLANG_ENABLE_HSA) if (CLANG_ENABLE_HSA STREQUAL FORCE_ON) find_package(hsa-runtime... REQUIRED) else() find_package

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Aaron Siddhartha Mondal via Phabricator via cfe-commits
aaronmondal added a comment. Ah yeah my bad 😅 Hmm somehow I keep getting confused by this. I'll check how other deps handle this, maybe there is a better way. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143768/new/ https://reviews.llvm.org/D143

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D143768#4119021 , @aaronmondal wrote: > Does this address the case where we have HSA headers present on the system? > > Since this only seems to modify link time behavior, I think building with > this flag would still include

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Aaron Siddhartha Mondal via Phabricator via cfe-commits
aaronmondal added a comment. Does this address the case where we have HSA headers present on the system? Since this only seems to modify link time behavior, I think building with this flag would still include "hsa/hsa.h" if they were present. Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: aaronmondal, JonChesterfield, tra, jdoerfert, tianshilei1992. Herald added subscribers: kosarev, mattd, asavonic, kerbowa, tpr, jvesely. Herald added a project: All. jhuber6 requested review of this revision. Herald added a project: clang. He