Unverified Commit 911e7465 authored by Philip Taron's avatar Philip Taron
Browse files

squeak: fix build with LLVM 16

Part of ZHF for 23.11: https://hydra.nixos.org/build/241300457

I bisected this failure to this first bad commit: [9ed7bfe4] llvmPackages: 11 -> 16 on Linux,
then looked around for other repairs made to assuage LLVM's errors. This appears to be the pattern.
parent 19e27c35
Loading
Loading
Loading
Loading
+42 −9
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, fetchurl, fetchzip
, autoconf, automake, autoreconfHook, clang, dos2unix, file, perl
{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, fetchzip
, autoconf
, automake
, autoreconfHook
, dos2unix
, file
, perl
, pkg-config
, alsa-lib, coreutils, freetype, glib, glibc, gnugrep, libGL, libpulseaudio
, libtool, libuuid, openssl, pango, xorg
, squeakImageHash ? null, squeakSourcesHash ? null, squeakSourcesVersion ? null
, squeakVersion ? null, squeakVmCommitHash ? null, squeakVmCommitHashHash ? null
, alsa-lib
, coreutils
, freetype
, glib
, glibc
, gnugrep
, libGL
, libpulseaudio
, libtool
, libuuid
, openssl
, pango
, xorg
, squeakImageHash ? null
, squeakSourcesHash ? null
, squeakSourcesVersion ? null
, squeakVersion ? null
, squeakVmCommitHash ? null
, squeakVmCommitHashHash ? null
, squeakVmVersion ? null
} @ args:

let
  inherit (builtins) elemAt;
  inherit (builtins) elemAt toString;

  nullableOr = o: default: if o == null then default else o;

  bits = stdenv.hostPlatform.parsed.cpu.bits;
@@ -75,7 +100,6 @@ in stdenv.mkDerivation {
    autoconf
    automake
    autoreconfHook
    clang
    dos2unix
    file
    perl
@@ -140,7 +164,16 @@ in stdenv.mkDerivation {
  # Workaround build failure on -fno-common toolchains:
  #   ld: vm/vm.a(cogit.o):spur64src/vm/cogitX64SysV.c:2552: multiple definition of
  #       `traceStores'; vm/vm.a(gcc3x-cointerp.o):spur64src/vm/cogit.h:140: first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";
  env.NIX_CFLAGS_COMPILE = toString (
    [ "-fcommon" ]
    ++ (lib.optionals stdenv.cc.isClang [
      # LLVM 16 turned these into errors (rightly, perhaps.)
      # Allow this package to continue to build despite this change.
      "-Wno-error=int-conversion"
      "-Wno-error=implicit-function-declaration"
      "-Wno-error=incompatible-function-pointer-types"
    ])
  );

  preAutoreconf = ''
    pushd ./platforms/unix/config > /dev/null
+3 −1
Original line number Diff line number Diff line
@@ -17287,7 +17287,9 @@ with pkgs;
    inherit (darwin.apple_sdk.frameworks) SystemConfiguration CoreFoundation Security;
  };
  squeak = callPackage ../development/compilers/squeak { };
  squeak = callPackage ../development/compilers/squeak {
    stdenv = clangStdenv;
  };
  squirrel-sql = callPackage ../development/tools/database/squirrel-sql {
    drivers = [ jtds_jdbc mssql_jdbc mysql_jdbc postgresql_jdbc ];