X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail.wilcox-tech.com (mail.wilcox-tech.com [45.32.83.9]) by lists.alpinelinux.org (Postfix) with ESMTP id B46CD5C4CAD for ; Sat, 26 Aug 2017 23:11:07 +0000 (GMT) Received: (qmail 27703 invoked from network); 26 Aug 2017 23:11:04 -0000 Received: from ip68-13-242-69.ok.ok.cox.net (HELO ?10.1.1.57?) (awilcox@wilcox-tech.com@68.13.242.69) by mail.wilcox-tech.com with ESMTPA; 26 Aug 2017 23:11:04 -0000 To: alpine-dev From: "A. Wilcox" Subject: [alpine-devel] GCC stuff and porting Alpine to MIPS X-Enigmail-Draft-Status: N1110 Organization: =?UTF-8?Q?Ad=c3=a9lie_Linux?= Message-ID: <59A1FFFF.8030903@adelielinux.org> Date: Sat, 26 Aug 2017 18:10:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uPo1mJ5FAOnHkWE70jE5Kn51c4kxtXidF" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uPo1mJ5FAOnHkWE70jE5Kn51c4kxtXidF Content-Type: multipart/mixed; boundary="------------030009090207010007020006" This is a multi-part message in MIME format. --------------030009090207010007020006 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi there Alpinists, One of Ad=C3=A9lie's goal architectures (and one that musl libc supports well, from experience) is MIPS. Both the 32-bit and 64-bit varieties of MIPS would ideally be supported. I've made some patches to abuild and the musl/gcc/binutils APKBUILD files that allow MIPS support to be somewhat created. However, there are a few issues that I am seeing. I am not sure the best way to proceed with fixing them. 1) binutils ld.gold does not support MIPS architecture. This necessitated a special case of $subpackages in the binutils APKBUILD and moving --enable-gold=3D[yes/no] to _arch_configure. An example patch is attached, but I am not convinced this is the best way. In particular, the subpackages conditional feels ugly to me. 2) MIPS ABI does not support GNU-style hash in ld. Since having default --hash-style=3Dgnu in binutils build broke its test suite, we no longer ship that patch in Ad=C3=A9lie binutils APK. However= , gcc still has --with-linker-hash-style=3Dgnu. This caused the musl bootstrap package to fail with: /usr/lib/gcc/mips-foxkit-linux-musl/6.4.0/../../../../mips-foxkit-linux-m= usl/bin/ld: =2Egnu.hash is incompatible with the MIPS ABI An example patch for the GCC APKBUILD to conditionalise the specified hash style is therefore also attached. This one seems much less ugly to me and might be acceptable. 3) libgcc in final cross build stage requires linux-headers. The libunwind shipped in libgcc, on mips*-*-linux targets, has #include It seems to specifically need the kernel header version and not the version musl ships with, but as I was unable to find exactly where the file was generated (it 'appears' in build-final-cross/mips-foxkit-linux-musl/libgcc/) I cannot be sure. The linux-headers package wouldn't cooperate in generating an early arch-specific package for gcc to depend on (the package itself built, but adding 'linux-headers' to EXTRADEPENDS_TARGET in bootstrap.sh errored with missing dependency). I'm not sure where to even start to make a worthwhile patch for this. Any comments on the patches, and a solution to #3, would be greatly appreciated. Thanks so much. Best to you and yours, --arw --=20 A. Wilcox (awilfox) Project Lead, Ad=C3=A9lie Linux http://adelielinux.org --------------030009090207010007020006 Content-Type: text/x-patch; name="gcc-apkbuild.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gcc-apkbuild.patch" diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index 7a0633a..ad64f8f 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -227,6 +227,7 @@ build() { local _libc_configure=3D local _cross_configure=3D local _bootstrap_configure=3D + local _hash_style=3Dgnu local _symvers=3D =20 cd "$_gccdir" @@ -237,6 +238,8 @@ build() { armv6-*-*-*eabihf) _arch_configure=3D"--with-arch=3Darmv6zk --with-tune= =3Darm1176jzf-s --with-fpu=3Dvfp --with-float=3Dhard --with-abi=3Daapcs-l= inux";; armv7-*-*-*eabihf) _arch_configure=3D"--with-arch=3Darmv7-a --with-tune= =3Dgeneric-armv7-a --with-fpu=3Dvfpv3-d16 --with-float=3Dhard --with-abi=3D= aapcs-linux --with-mode=3Dthumb";; mipsel-*-*-*) _arch_configure=3D"--with-arch-32=3Dmips2 --with-tune-32= =3Dmips32 --with-fp-32=3D32 --with-mips-plt --with-float=3Dhard --with-ab= i=3D32";; + mips-*-*-*) _arch_configure=3D"--with-arch=3Dmips3 --with-mips-plt --w= ith-abi=3D32"; _hash_style=3D"sysv";; + mips32el-*-*-*) _arch_configure=3D"--with-arch=3Dmips32 --with-mips-pl= t --with-abi=3D32"; _hash_style=3D"sysv";; powerpc-*-*-*) _arch_configure=3D"--enable-secureplt --enable-decimal-= float=3Dno";; powerpc64*-*-*-*) _arch_configure=3D"--with-abi=3Delfv2 --enable-secure= plt --enable-decimal-float=3Dno";; powerpc64le*-*-*-*) _arch_configure=3D"--with-abi=3Delfv2 --enable-secu= replt --enable-decimal-float=3Dno";; @@ -282,6 +285,7 @@ build() { echo " libc_configure=3D$_libc_configure" echo " cross_configure=3D$_cross_configure" echo " bootstrap_configure=3D$_bootstrap_configure" + echo " hash_style=3D$_hash_style" echo "" =20 mkdir -p "$_builddir" @@ -310,7 +314,7 @@ build() { $_cross_configure \ $_bootstrap_configure \ --with-system-zlib \ - --with-linker-hash-style=3Dgnu + --with-linker-hash-style=3D$_hash_style make } =20 --------------030009090207010007020006 Content-Type: text/x-patch; name="binutils-apkbuild.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="binutils-apkbuild.patch" diff --git a/main/binutils/APKBUILD b/main/binutils/APKBUILD index 34e12c3..ea27f01 100644 --- a/main/binutils/APKBUILD +++ b/main/binutils/APKBUILD @@ -11,12 +11,14 @@ makedepends=3D"$makedepends_build $makedepends_host" checkdepends=3D"dejagnu" arch=3D"all" license=3D"GPL2 GPL3+ LGPL2 BSD" -subpackages=3D"$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-gold" +subpackages=3D"$pkgname-dev $pkgname-doc $pkgname-libs" +[ "${CARCH}" !=3D "mips" ] && subpackages=3D"$subpackages $pkgname-gold"= source=3D"http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2 binutils-ld-fix-static-linking.patch disable-gnu-mbind.patch disable-preinit-array-tests.patch fix-plt-main-bnd-test.patch + mips-illegal-memcpy.patch remove-no-static-plt-test.patch remove-pr2404-tests.patch remove-pr19553c-test.patch @@ -26,6 +28,7 @@ builddir=3D"$srcdir/$pkgname-$pkgver" if [ "$CHOST" !=3D "$CTARGET" ]; then pkgname=3D"$pkgname-$CTARGET_ARCH" subpackages=3D"" + options=3D"!check" sonameprefix=3D"$pkgname:" fi =20 @@ -47,6 +50,11 @@ build() { _arch_configure=3D"--enable-targets=3Dx86_64-pep" fi =20 + case "$CTARGET_ARCH" in + mips*) _arch_configure=3D"$_arch_configure --enable-gold=3Dno" ;; + *) _arch_configure=3D"$_arch_configure --enable-gold=3Dyes" ;; + esac + cd "$builddir" ./configure \ --build=3D$CBUILD \ @@ -60,7 +68,6 @@ build() { --disable-multilib \ --enable-shared \ --enable-ld=3Ddefault \ - --enable-gold=3Dyes \ --enable-64-bit-bfd \ --enable-plugins \ --enable-relro \ @@ -121,6 +128,7 @@ ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a7= 2f7c9b46f85fbb227af5748e735 d378fdf1964f8f2bd0b1e62827ac5884bdf943aa435ec89c29fc84bb045d406b733fffaf= f8fdd8bd1cba8ddea7701c4cf6ccf3ed76a8a3df9c72b447737575a6 disable-gnu-mbi= nd.patch 3537752e63cef0b5ef136d003ff7e814ba66b12624d817430112d0f291a792e8960fa69a= 78036f526af835441b3ee483d6a53d55c7b3dd8ee96f0399682dbcbe disable-preinit= -array-tests.patch 01149e3b772c92783048cc65a4fe6d63770c9f8351ff087901679ba886ccad0bdaeec830= 33be4537651570de0b042f2cb8e2fad0bcab70afae773053dfda11be fix-plt-main-bn= d-test.patch +06422157349abf02e79a5ef8bd9f51100e7e996aab65250d518e0cf0d7ac8ed922d3bf16= 03c4f5b4fd8fb179266b7b4c41db32dcb241d60a7f1c21d1df0c36dd mips-illegal-me= mcpy.patch b40f9a3841a7af8fc12e8a4044cd672df5614bfda8461b0ca45efa57a42c3bc8490e491e= a490c6c05d319a52d69993c4fca33a0aeb044090e7b7f4e4e30c6517 remove-no-stati= c-plt-test.patch 32ab4215669c728648179c124632467573a3d4675e79f0f0d221c22eb2ec1ca5488b7991= 0bd09142f90a1e0d0b81d99ca4846297f4f9561f158db63745facb66 remove-pr2404-t= ests.patch 39ef9c76dd5db6b15f11ffa8061f7ca844fb79c3fb9879c3b1466eef332a28b833597c87= 003ab9f260b1b85023fae264659088aee27cad7e5aa77b2d58b9a3f6 remove-pr19553c= -test.patch" --------------030009090207010007020006-- --uPo1mJ5FAOnHkWE70jE5Kn51c4kxtXidF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZogAAAAoJEMspy1GSK50UhcAQAIRwJbvodW+OTDTEQ76jWJ4F 2ZC71RMRSmUNJC66YLE99epc8tkJcCVHDhXCd2chuz382aPajHPZyEYyYW3FMNN/ Ps6+4E9eYVzCzGeAfnDQg2sZUviY65NcKt6Ey9SwIlYyVAjibvop+y7XB6ma/I9q WLGKA2VbHtPtunbrfVZt4/1k/CnIvi+G5sNs0NUHCEpBWKCbKgZZV1iqQrPkWDFS GuPgphnO5m/BquARwYIWIyyMkQKgGb/TP5dqRO9xKy8pDJ9g3Usa7apaFgZpr6z4 R6F5H7YzVH+284SCgK8Uz8El4QEmR/aJVsek7AgyL8KBhTrgsnx8z5toX0nSBgxw FYgCg6jHh4MXs0eo9pFHeqGo5m6q5x73C8mTLrfcZ64l0HKc4ijxno/seKaB7czg fE/P9sNUG40zzVtTn8nAbclUZJoDIde14Y5nUbqoX/kkbKEjDCmnGs/js98OOD1I F82I5f5Qn7q2dF93QMSFiw6gu6ILmiWb1g3A6fmOLf1Ry5DB1CoPTTSiY3Er9uUe JDMYO+gFImORYjPjV7gM4NT9Qda36/DA6h0ZJVjy8INPNe5krfQVey4xlNCmQ4w2 G0NPZwmG5eYjjEzo2RXDz7jktOGArNB4kXpOqp90TjUrJ1rQMlggviBlTEzCaJGh w0dRp1ECdWzKFZVdJqeG =si4k -----END PGP SIGNATURE----- --uPo1mJ5FAOnHkWE70jE5Kn51c4kxtXidF-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---