Merge pull request #229519 from wegank/gnum4-loongarch

gnum4: fix build on loongarch64-linux

authored by

Weijia Wang and committed by
GitHub
4666287d 9ed6cf95

+37
+7
pkgs/development/tools/misc/gnum4/default.nix
··· 14 14 sha256 = "sha256-swapHA/ZO8QoDPwumMt6s5gf91oYe+oyk4EfRSyJqMg="; 15 15 }; 16 16 17 + # https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/m4/m4-1.4.19-r1.ebuild 18 + patches = lib.optional stdenv.hostPlatform.isLoongArch64 ./loong-fix-build.patch; 19 + postPatch = if stdenv.hostPlatform.isLoongArch64 then '' 20 + touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die 21 + find . -name Makefile.in -exec touch {} + || die 22 + '' else null; 23 + 17 24 strictDeps = true; 18 25 enableParallelBuilding = true; 19 26
+30
pkgs/development/tools/misc/gnum4/loong-fix-build.patch
··· 1 + [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.] 2 + From: Sun Haiyong <youbest@sina.com> 3 + Date: Tue, 31 Aug 2021 11:11:52 +0800 4 + Subject: [PATCH] stack-direction: Add support for loongarch CPU 5 + 6 + * m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch, 7 + set "sv_cv_stack_direction" to "-1" . 8 + --- a/m4/stack-direction.m4 9 + +++ b/m4/stack-direction.m4 10 + @@ -31,6 +31,7 @@ AC_DEFUN([SV_STACK_DIRECTION], 11 + i?86 | x86_64 | \ 12 + i860 | \ 13 + ia64 | \ 14 + + loongarch* | \ 15 + m32r | \ 16 + m68* | \ 17 + m88k | \ 18 + --- a/configure 19 + +++ b/configure 20 + @@ -46399,6 +46399,7 @@ else $as_nop 21 + i?86 | x86_64 | \ 22 + i860 | \ 23 + ia64 | \ 24 + + loongarch* | \ 25 + m32r | \ 26 + m68* | \ 27 + m88k | \ 28 + -- 29 + 2.17.2 30 +