build: do not include debug symbols in release

On M1 Macs, the compiler seems to infinite-loop, consuming ever more RAM
and CPU, while trying to build `noun/allocate.c` with `-O3 -g`. `-O3` is
fine, `-g` is fine. Both at once seems to try to summon demons.

Other possible solutions aside from this:

- try lower levels of optimization until we find one that doesn't hang,
  and ship that.

- do not support M1 Mac until the underlying issue here is fixed.

- ship debug binaries on M1 for now.

The path of least resistance is of course the second option, as that's
what is already tacitly happening.
This commit is contained in:
Jōshin 2022-01-24 12:30:46 -08:00
parent 13bdfe26aa
commit ba1d5024a8
No known key found for this signature in database
GPG Key ID: A8BE5A9A521639D0

View File

@ -59,7 +59,7 @@ in stdenv.mkDerivation {
then [ "--disable-shared" "--enable-static" ]
else [];
CFLAGS = [ (if enableDebug then "-O0" else "-O3") "-g" ]
CFLAGS = (if enableDebug then [ "-O0" "-g" ] else [ "-O3" ])
++ lib.optionals (!enableDebug) [ "-Werror" ];
MEMORY_DEBUG = enableDebug;