[clang] [flang] [flang][driver] Add support for -isysroot in the frontend (PR #77365)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 9 07:41:07 PST 2024


================
@@ -220,6 +220,13 @@ static or shared library, the generated library does not need a `main`
 function, as a final link stage will occur that will provide the `Fortran_main`
 library when creating the final executable.
 
+On Darwin, the logical root where the system libraries are located (sysroot)
+must be specified. This can be done with the cmake build flag `DEFAULT_SYSROOT`
+or by using the `-isysroot` flag when linking a binary. On other targets
+`-isysroot` doesn't change the linker command line. While with Clang
+`-isysroot` also changes the sysroot for includes, with Flang it only affects
+Darwin libraries' sysroot.
----------------
banach-space wrote:

This is worth expanding. Feel free to re-use.

```suggestion
On Darwin, the logical root where the system libraries are located (sysroot)
must be specified. This can be done with the CMake build flag `DEFAULT_SYSROOT`
or by using the `-isysroot` flag when linking a binary. On other targets
`-isysroot` doesn't change the linker command line (it only affects the header search path). While with Clang
`-isysroot` also changes the sysroot for includes, with Flang (and Fortran in general)
it only affects Darwin libraries' sysroot.
```

https://github.com/llvm/llvm-project/pull/77365


More information about the cfe-commits mailing list