You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
driver: Pick a better default C cross compiler on non-Apple Posix (#4983)
Try to pick a better default instead of `cc` when
cross-compiling. When targeting Linux on a non-Linux build machine,
for example, try to pick `cc` from:
- `<triple>-gcc`
- `<triple>-clang`
- `clang --target=<triple>`
This should be a better UX when cross-compiling with simpler build
systems like `dub` or even without one at all, offering a
out-of-the-box functional setup, on most systems.
The advantage to performing this check in the compiler code as opposed
to hardcoding a default value in the config file is that:
1. Multiple programs can be searched, instead of just one
2. The `$CC` value continues to be respected, which keeps more
advanced cross-compiling setups working (for example Meson)
Signed-off-by: Andrei Horodniceanu <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,12 @@
6
6
- ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
7
7
- Running `ldc-build-runtime --installWithSuffix` now includes installing a target-specific .conf file to that directory. (#4978)
8
8
-**Breaking change for ldc2.conf cmake generation**: The `cmake` build process now generates the `ldc2.conf` and `ldc2_install.conf` as directories. `ldc2*.conf.in` and `ADDITIONAL_DEFAULT_LDC_SWITCHES` have been removed, if you need to add switches check out `makeConfSection` in `LdcConfig.cmake`. (#4954)
9
+
- When cross-compiling, the fallback value for the (cross) C compiler will be picked based on some heuristics.
10
+
The old behavior was to default to `cc`.
11
+
As an example, when cross-compiling for `aarch64-linux-gnu` the compilers that are checked are:
12
+
-`aarch64-linux-gnu-gcc`
13
+
-`aarch64-linux-gnu-clang`
14
+
-`clang --target=aarch64-linux-gnu`
9
15
- The prebuilt arm64/universal macOS packages additionally bundle the arm64 iOS-*simulator* libraries, for out-of-the-box cross-compilation support via e.g. `-mtriple=arm64-apple-ios12.0-simulator`. (#4974)
0 commit comments