Unverified Commit 4666287d authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #229519 from wegank/gnum4-loongarch

gnum4: fix build on loongarch64-linux
parents 9ed6cf95 6efe86c5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -14,6 +14,13 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-swapHA/ZO8QoDPwumMt6s5gf91oYe+oyk4EfRSyJqMg=";
  };

  # https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/m4/m4-1.4.19-r1.ebuild
  patches = lib.optional stdenv.hostPlatform.isLoongArch64 ./loong-fix-build.patch;
  postPatch = if stdenv.hostPlatform.isLoongArch64 then ''
    touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die
    find . -name Makefile.in -exec touch {} + || die
  '' else null;

  strictDeps = true;
  enableParallelBuilding = true;

+30 −0
Original line number Diff line number Diff line
[xen0n: this is https://github.com/sunhaiyong1978/CLFS-for-LoongArch/blob/1.0/patches/stack-direction-add-loongarch.patch with line number tweak, and change to generated file added as well.]
From: Sun Haiyong <youbest@sina.com>
Date: Tue, 31 Aug 2021 11:11:52 +0800
Subject: [PATCH] stack-direction: Add support for loongarch CPU

* m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
set "sv_cv_stack_direction" to "-1" .
--- a/m4/stack-direction.m4
+++ b/m4/stack-direction.m4
@@ -31,6 +31,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
       i?86 | x86_64 | \
       i860 | \
       ia64 | \
+      loongarch* | \
       m32r | \
       m68* | \
       m88k | \
--- a/configure
+++ b/configure
@@ -46399,6 +46399,7 @@ else $as_nop
       i?86 | x86_64 | \
       i860 | \
       ia64 | \
+      loongarch* | \
       m32r | \
       m68* | \
       m88k | \
-- 
2.17.2