libunwind: add support for loongarch64
authorWeijie Gao <hackpascal@gmail.com>
Thu, 14 Mar 2024 16:44:06 +0000 (00:44 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 4 May 2024 06:14:24 +0000 (14:14 +0800)
Modify package depends to allow building for loongarch64.
Also fix for building with musl.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
package/libs/libunwind/Makefile
package/libs/libunwind/patches/005-loongarch64-musl.pattch [new file with mode: 0644]

index 7a82d76663e22ea2f7b7345e09875f2fe2cd8add..7bd3c5ac176a84b79258caaf1ffb04ed72110ed3 100644 (file)
@@ -32,7 +32,7 @@ define Package/libunwind
   CATEGORY:=Libraries
   TITLE:=The libunwind project
   URL:=http://www.nongnu.org/libunwind/
-  DEPENDS:=@((mips||mipsel||mips64||powerpc64||x86_64||arm||aarch64)||(USE_GLIBC&&(powerpc||i386))) +zlib
+  DEPENDS:=@((mips||mipsel||mips64||powerpc64||x86_64||arm||aarch64||loongarch64)||(USE_GLIBC&&(powerpc||i386))) +zlib
   ABI_VERSION:=8
 endef
 
diff --git a/package/libs/libunwind/patches/005-loongarch64-musl.pattch b/package/libs/libunwind/patches/005-loongarch64-musl.pattch
new file mode 100644 (file)
index 0000000..bb961bd
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/loongarch64/getcontext.S
++++ b/src/loongarch64/getcontext.S
+@@ -25,7 +25,9 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
+ #include "offsets.h"
++#ifdef __GLIBC__
+ #include <endian.h>
++#endif
+       .text
+ #define SREG(X) st.d $r##X, $r4, (LINUX_UC_MCONTEXT_GREGS + 8 * X)