Skip to content

Commit

Permalink
dub.sdl: Use compiler specific -preview=in. Disable it for GDC.
Browse files Browse the repository at this point in the history
Having `-preview=in` in dflags without a platform specification
leads to errors with gdc:
```
gdc: error: unrecognized command-line option ‘-preview=in’; did you mean ‘-fpreview=in’?
```

However, using the proper `-fpreview=in` for gdc causes an ICE:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/d/std/math/exponential.d:587:30: internal compiler error: in layout_aggregate_type, at d/types.cc:562
  587 |             enum maxOdd = pow(2.0L, real.mant_dig) - 1.0L;
```

Leave `-preview=in` enabled for dmd and ldc and wait for a fix
before enabling it for gdc.

Signed-off-by: Andrei Horodniceanu <[email protected]>
  • Loading branch information
the-horo committed Jan 13, 2024
1 parent a59e456 commit 1cef6e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ license "MIT"

targetPath "bin"

dflags "-preview=in"
dflags "-preview=in" platform="dmd"
dflags "-preview=in" platform="ldc"
//Disabled due to ICEs in gdc.
//dflags "-fpreview=in" platform="gdc"
// Deprecated module(s)
excludedSourceFiles "source/dub/packagesupplier.d"

Expand Down

0 comments on commit 1cef6e5

Please sign in to comment.