Subject: [alpine-aports] [PATCH] community/gcc6: fix build on mips*

From: alpine-mips-patches <[email-masked]>
Date: Thu, 20 Dec 2018 14:06:55 +0000

---
 community/gcc6/APKBUILD                 |  2 ++
 community/gcc6/boehm-gc-musl-mips.patch | 27 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 community/gcc6/boehm-gc-musl-mips.patch

diff --git a/community/gcc6/APKBUILD b/community/gcc6/APKBUILD
index f078bef06c..4e9918603f 100644
--- a/community/gcc6/APKBUILD
+++ b/community/gcc6/APKBUILD
@@ -48,6 +48,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgba
 	gcc-4.9-musl-fortify.patch
 	gcc-6.1-musl-libssp.patch
 	boehm-gc-musl.patch
+	boehm-gc-musl-mips.patch
 	gcc-pure64.patch
 	fix-gcj-stdgnu14-link.patch
 	fix-gcj-musl.patch
@@ -336,6 +337,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2
 600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d  gcc-4.9-musl-fortify.patch
 dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4  gcc-6.1-musl-libssp.patch
 bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7  boehm-gc-musl.patch
+c3afce4ce61c8de4e8dc3844516950a993ee6256323cf6e6aa1cc2b0ad9fa34f2a8da3eb73a4a48b2fd5968f41e582f68ef7281ee7c1d5c78724cee8e21990af  boehm-gc-musl-mips.patch
 fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7  gcc-pure64.patch
 2253941f3d19b6d08801d3782f5f5ed56c3b73fbc9d3561a8f01c702963ac4fab91599c686076e7081eb6a80c37ccd33591ae978996d6eee1dc0ce0f1c50259a  fix-gcj-stdgnu14-link.patch
 f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b  fix-gcj-musl.patch
diff --git a/community/gcc6/boehm-gc-musl-mips.patch b/community/gcc6/boehm-gc-musl-mips.patch
new file mode 100644
index 0000000000..6085419140
--- /dev/null
+++ b/community/gcc6/boehm-gc-musl-mips.patch
@@ -0,0 +1,27 @@
+--- a/boehm-gc/include/private/gc_locks.h
++++ b/boehm-gc/include/private/gc_locks.h
+@@ -282,7 +282,9 @@
+ #    define GC_TEST_AND_SET_DEFINED
+ #  endif
+ #  ifdef MIPS
+-#    ifdef LINUX
++#    if (__GNUC__>4)||((__GNUC__==4)&&(__GNUC_MINOR__>=4))
++#      define GC_test_and_set(addr) __sync_lock_test_and_set (addr, 1)
++#    elif defined(LINUX)
+ #      include <sys/tas.h>
+ #      define GC_test_and_set(addr) _test_and_set((int *) addr,1)
+ #      define GC_TEST_AND_SET_DEFINED
+--- a/boehm-gc/include/private/gcconfig.h
++++ b/boehm-gc/include/private/gcconfig.h
+@@ -1373,10 +1373,9 @@
+       /* needs to be tweaked for workstation class machines.		*/
+ #     define OS_TYPE "LINUX"
+ #     define DYNAMIC_LOADING
++#     define SEARCH_FOR_DATA_START
+       extern int _end[];
+ #     define DATAEND (_end)
+-      extern int __data_start[];
+-#     define DATASTART ((ptr_t)(__data_start))
+ #     ifdef _MIPS_SZPTR
+ #	define CPP_WORDSZ _MIPS_SZPTR
+ #	define ALIGNMENT (_MIPS_SZPTR/8)
-- 
2.20.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---