Commit 6447f715 authored by Patryk Sondej's avatar Patryk Sondej
Browse files

gdb: fix build on Apple Silicon

parent 02032da4
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -117,7 +117,10 @@ stdenv.mkDerivation rec {

  env.NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";

  configurePlatforms = [
  # Workaround for Apple Silicon, configurePlatforms must be disabled
  configurePlatforms =
    lib.optionals (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64))
      [
        "build"
        "host"
        "target"
@@ -170,7 +173,11 @@ stdenv.mkDerivation rec {
    ++ lib.optional stdenv.hostPlatform.isMusl "--disable-nls"
    ++ lib.optional stdenv.hostPlatform.isStatic "--disable-inprocess-agent"
    ++ lib.optional enableDebuginfod "--with-debuginfod=yes"
    ++ lib.optional (!enableSim) "--disable-sim";
    ++ lib.optional (!enableSim) "--disable-sim"
    # Workaround for Apple Silicon, "--target" must be "faked", see eg: https://github.com/Homebrew/homebrew-core/pull/209753
    ++ lib.optional (
      stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
    ) "--target=x86_64-apple-darwin";

  postInstall = ''
    # Remove Info files already provided by Binutils and other packages.
@@ -210,9 +217,6 @@ stdenv.mkDerivation rec {
    license = lib.licenses.gpl3Plus;

    platforms = with lib.platforms; linux ++ cygwin ++ freebsd ++ darwin;
    # upstream does not support targeting aarch64-darwin;
    # see https://inbox.sourceware.org/gdb/3185c3b8-8a91-4beb-a5d5-9db6afb93713@Spark/
    badPlatforms = lib.optionals (stdenv.targetPlatform.system == "aarch64-darwin") meta.platforms;
    maintainers = with lib.maintainers; [
      pierron
      globin