Merge pull request #1242 from chneukirchen/aarch64
Add support for AArch64/ARMv8/ARM64 These patches add support for AArch64/ARMv8/ARM64 64-bit ARM processor. base-system, base-chroot{,-musl} and base-devel cross-compiled successfully at once (given coreutils-doc has been added to the repo already). Both glibc and musl are supported. Uncommented lines of common/environment/configure/autoconf_cache/aarch64-linux have not yet been verified/needed. Light testing has been performed on Linaro QEMU "genericarmv8" with Kernel 3.19, due to lack of real hardware.
This commit is contained in:
commit
b03de9bc1c
23 changed files with 5276 additions and 75 deletions
3
common/build-profiles/aarch64-musl.sh
Normal file
3
common/build-profiles/aarch64-musl.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv8-a"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_CXXFLAGS"
|
||||
XBPS_TRIPLET="aarch64-unknown-linux-musl"
|
3
common/build-profiles/aarch64.sh
Normal file
3
common/build-profiles/aarch64.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv8-a"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_CXXFLAGS"
|
||||
XBPS_TRIPLET="aarch64-unknown-linux-gnu"
|
8
common/cross-profiles/aarch64-musl.sh
Normal file
8
common/cross-profiles/aarch64-musl.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for ARMv8.
|
||||
|
||||
XBPS_TARGET_ARCH="aarch64-musl"
|
||||
XBPS_CROSS_TRIPLET="aarch64-linux-musl"
|
||||
XBPS_CFLAGS="-O2 -pipe" # XXX not yet supported: -fstack-protector-strong
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=armv8-a"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
8
common/cross-profiles/aarch64.sh
Normal file
8
common/cross-profiles/aarch64.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for ARMv8.
|
||||
|
||||
XBPS_TARGET_ARCH="aarch64"
|
||||
XBPS_CROSS_TRIPLET="aarch64-linux-gnu"
|
||||
XBPS_CFLAGS="-O2 -pipe" # XXX not yet supported: -fstack-protector-strong
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=armv8-a"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
1421
common/cross-profiles/config.guess
vendored
Executable file
1421
common/cross-profiles/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load diff
183
common/cross-profiles/config.sub
vendored
183
common/cross-profiles/config.sub
vendored
|
@ -1,38 +1,31 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2011-03-23'
|
||||
timestamp='2014-12-03'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
|
@ -75,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
@ -125,14 +116,17 @@ esac
|
|||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-musl* | \
|
||||
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
android-linux)
|
||||
os=-linux-android
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
|
@ -155,7 +149,7 @@ case $os in
|
|||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
|
@ -224,6 +218,12 @@ case $os in
|
|||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*178)
|
||||
os=-lynxos178
|
||||
;;
|
||||
-lynx*5)
|
||||
os=-lynxos5
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
|
@ -248,20 +248,28 @@ case $basic_machine in
|
|||
# Some are omitted here because they have special meanings below.
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
|
@ -275,24 +283,27 @@ case $basic_machine in
|
|||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or32 \
|
||||
| open8 | or1k | or1knd | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
| rx \
|
||||
| riscv32 | riscv64 \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
|
@ -301,7 +312,8 @@ case $basic_machine in
|
|||
| spu \
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| visium \
|
||||
| we32k \
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
|
@ -316,8 +328,10 @@ case $basic_machine in
|
|||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
|
||||
# Motorola 68HC11/12.
|
||||
leon|leon[3-9])
|
||||
basic_machine=sparc-$basic_machine
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
|
@ -330,7 +344,10 @@ case $basic_machine in
|
|||
strongarm | thumb | xscale)
|
||||
basic_machine=arm-unknown
|
||||
;;
|
||||
|
||||
xgate)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
xscaleeb)
|
||||
basic_machine=armeb-unknown
|
||||
;;
|
||||
|
@ -353,25 +370,31 @@ case $basic_machine in
|
|||
# Recognize the basic CPU types with company name.
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| k1om-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
|
@ -385,23 +408,27 @@ case $basic_machine in
|
|||
| mips64vr5900-* | mips64vr5900el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| or1k*-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* | rx-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
|
@ -409,10 +436,12 @@ case $basic_machine in
|
|||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile-* | tilegx-* \
|
||||
| tile*-* \
|
||||
| tron-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| visium-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
|
@ -712,7 +741,6 @@ case $basic_machine in
|
|||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
|
@ -751,6 +779,9 @@ case $basic_machine in
|
|||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
leon-*|leon[3-9]-*)
|
||||
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
|
@ -770,11 +801,15 @@ case $basic_machine in
|
|||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
|
@ -802,6 +837,10 @@ case $basic_machine in
|
|||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
moxiebox)
|
||||
basic_machine=moxie-unknown
|
||||
os=-moxiebox
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
|
@ -809,10 +848,18 @@ case $basic_machine in
|
|||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
nacl)
|
||||
basic_machine=le32-unknown
|
||||
os=-nacl
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
|
@ -993,7 +1040,11 @@ case $basic_machine in
|
|||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
|
@ -1121,13 +1172,8 @@ case $basic_machine in
|
|||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
# This must be matched before tile*.
|
||||
tilegx*)
|
||||
basic_machine=tilegx-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
|
@ -1325,30 +1371,29 @@ case $os in
|
|||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-uclibc* \
|
||||
| -linux-musl* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
@ -1472,9 +1517,6 @@ case $os in
|
|||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
|
@ -1523,6 +1565,12 @@ case $basic_machine in
|
|||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=-coff
|
||||
;;
|
||||
|
@ -1550,9 +1598,6 @@ case $basic_machine in
|
|||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
|
|
146
common/environment/configure/autoconf_cache/aarch64-linux
Normal file
146
common/environment/configure/autoconf_cache/aarch64-linux
Normal file
|
@ -0,0 +1,146 @@
|
|||
## # general
|
||||
ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
|
||||
ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
|
||||
## ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
|
||||
## ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
|
||||
## ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
|
||||
## ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
|
||||
## ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
|
||||
## ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
|
||||
## ac_cv_linux_vers=${ac_cv_linux_vers=2}
|
||||
## ac_cv_need_trio=${ac_cv_need_trio=no}
|
||||
ac_cv_sizeof___int64=0
|
||||
ac_cv_sizeof_char=1
|
||||
ac_cv_sizeof_int=4
|
||||
ac_cv_sizeof_long=8
|
||||
ac_cv_sizeof_long_long=8
|
||||
ac_cv_sizeof_short=2
|
||||
ac_cv_sizeof_size_t=8
|
||||
ac_cv_sizeof_ssize_t=8
|
||||
ac_cv_sizeof_void_p=8
|
||||
ac_cv_sizeof_unsigned_int=4
|
||||
ac_cv_sizeof_unsigned_long=8
|
||||
## ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
|
||||
## ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
|
||||
## ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
|
||||
## ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
|
||||
ac_cv_sizeof_unsigned_short=2
|
||||
## ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
|
||||
## ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8}
|
||||
## ac_cv_sizeof_uid_t=${ac_cv_sizeof_uid_t=4}
|
||||
## ac_cv_sizeof_gid_t=${ac_cv_sizeof_gid_t=4}
|
||||
## ac_cv_sizeof_ino_t=${ac_cv_sizeof_ino_t=8}
|
||||
## ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
|
||||
## ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
|
||||
## ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
|
||||
## db_cv_alignp_t=${db_cv_alignp_t='unsigned long long'}
|
||||
## db_cv_align_t=${db_cv_align_t='unsigned long long'}
|
||||
## db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
|
||||
## db_cv_sprintf_count=${db_cv_sprintf_count=yes}
|
||||
## ac_cv_sizeof_struct_iovec=16
|
||||
|
||||
# glib
|
||||
glib_cv_hasinline=${glib_cv_hasinline=yes}
|
||||
glib_cv_has__inline=${glib_cv_has__inline=yes}
|
||||
glib_cv_has__inline__=${glib_cv_has__inline__=yes}
|
||||
glib_cv_long_long_format=${glib_cv_long_long_format=ll}
|
||||
glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
|
||||
glib_cv_stack_grows=${glib_cv_stack_grows=no}
|
||||
glib_cv_uscore=${glib_cv_uscore=no}
|
||||
glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
|
||||
ac_cv_alignof_guint32=4
|
||||
ac_cv_alignof_guint64=8
|
||||
ac_cv_alignof_unsigned_long=8
|
||||
ac_cv_alignof_char=1
|
||||
ac_cv_alignof_double=8
|
||||
|
||||
## nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
|
||||
## samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
|
||||
## utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
|
||||
|
||||
# gettext
|
||||
am_cv_func_working_getline=${am_cv_func_working_getline=yes}
|
||||
|
||||
#gcc
|
||||
ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
|
||||
|
||||
#orbit
|
||||
libIDL_cv_long_long_format=ll
|
||||
|
||||
## # ORBit2
|
||||
## ac_cv_alignof_CORBA_boolean=1
|
||||
## ac_cv_alignof_CORBA_char=1
|
||||
## ac_cv_alignof_CORBA_double=8
|
||||
## ac_cv_alignof_CORBA_float=4
|
||||
## ac_cv_alignof_CORBA_long=4
|
||||
## ac_cv_alignof_CORBA_long_double=8
|
||||
## ac_cv_alignof_CORBA_long_long=8
|
||||
## ac_cv_alignof_CORBA_octet=1
|
||||
## ac_cv_alignof_CORBA_pointer=8
|
||||
## ac_cv_alignof_CORBA_short=2
|
||||
## ac_cv_alignof_CORBA_struct=1
|
||||
## ac_cv_alignof_CORBA_wchar=2
|
||||
##
|
||||
## lf_cv_sane_realloc=yes
|
||||
## as_cv_unaligned_access=${as_cv_unaligned_access=yes}
|
||||
##
|
||||
## #unfs3
|
||||
## nfsd_cv_broken_setfsuid=${nfsd_cv_broken_setfsuid=0}
|
||||
## nfsd_cv_func_statfs=${nfsd_cv_func_statfs=statfs2_bsize}
|
||||
## nfsd_cv_bsd_signals=${nfsd_cv_bsd_signals=yes}
|
||||
|
||||
#apr
|
||||
apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
|
||||
|
||||
# lftp
|
||||
lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
|
||||
|
||||
# slrn
|
||||
slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
|
||||
|
||||
# cvs
|
||||
cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
|
||||
|
||||
## # at-spi2-core
|
||||
ac_cv_alignof_dbind_pointer=8
|
||||
ac_cv_alignof_dbind_struct=1
|
||||
ac_cv_alignof_dbus_bool_t=4
|
||||
ac_cv_alignof_dbus_int16_t=2
|
||||
ac_cv_alignof_dbus_int32_t=4
|
||||
ac_cv_alignof_dbus_int64_t=8
|
||||
|
||||
## # socat
|
||||
sc_cv_type_dev_basic='6 /* unsigned long */'
|
||||
sc_cv_type_gidt_basic='4 /* unsigned int */'
|
||||
sc_cv_type_longlong=yes
|
||||
sc_cv_type_modet_basic='4 /* unsigned int */'
|
||||
sc_cv_type_off64=yes
|
||||
sc_cv_type_off64_basic='5 /* long */'
|
||||
sc_cv_type_off_basic='5 /* long */'
|
||||
sc_cv_type_pidt_basic='3 /* int */'
|
||||
sc_cv_type_rlimit_rlimmax_basic='6 /* unsigned long */'
|
||||
sc_cv_type_sa_family_t=yes
|
||||
sc_cv_type_sighandler=yes
|
||||
sc_cv_type_sizet_basic='6 /* unsigned long */'
|
||||
sc_cv_type_socklen=yes
|
||||
sc_cv_type_socklent_basic='4 /* unsigned int */'
|
||||
sc_cv_type_stat64=yes
|
||||
sc_cv_type_stat64_stblksize_basic='3 /* int */'
|
||||
sc_cv_type_stat64_stblocks_basic='5 /* long */'
|
||||
sc_cv_type_stat64_stdev_basic='6 /* unsigned long */'
|
||||
sc_cv_type_stat64_stino_basic='6 /* unsigned long */'
|
||||
sc_cv_type_stat64_stnlink_basic='4 /* unsigned int */'
|
||||
sc_cv_type_stat64_stsize_basic='5 /* long */'
|
||||
sc_cv_type_stat_stblksize_basic='3 /* int */'
|
||||
sc_cv_type_stat_stblocks_basic='5 /* long */'
|
||||
sc_cv_type_stat_stino_basic='6 /* unsigned long */'
|
||||
sc_cv_type_stat_stnlink_basic='4 /* unsigned int */'
|
||||
sc_cv_type_stat_stsize_basic='5 /* long */'
|
||||
sc_cv_type_struct_timeval_tv_usec='5 /* long */'
|
||||
sc_cv_type_timet_basic='5 /* long */'
|
||||
sc_cv_type_uidt_basic='4 /* unsigned int */'
|
||||
sc_cv_type_uint16=yes
|
||||
sc_cv_type_uint32=yes
|
||||
sc_cv_type_uint64=yes
|
||||
sc_cv_type_uint8=yes
|
||||
sc_cv_typeof_struct_cmsghdr_cmsg_len='6 /* unsigned long */'
|
|
@ -45,6 +45,11 @@ case "$XBPS_TARGET_MACHINE" in
|
|||
. ${_AUTOCONFCACHEDIR}/arm-linux
|
||||
;;
|
||||
|
||||
aarch64*)
|
||||
. ${_AUTOCONFCACHEDIR}/endian-little
|
||||
. ${_AUTOCONFCACHEDIR}/aarch64-linux
|
||||
;;
|
||||
|
||||
i686*) . ${_AUTOCONFCACHEDIR}/endian-little
|
||||
. ${_AUTOCONFCACHEDIR}/ix86-common
|
||||
;;
|
||||
|
|
16
common/hooks/pre-configure/01-aarch64-override-config.sh
Normal file
16
common/hooks/pre-configure/01-aarch64-override-config.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
# This hook overrides config.sub and config.guess for aarch64 builds.
|
||||
|
||||
hook() {
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
aarch64*);;
|
||||
*) return 0;;
|
||||
esac
|
||||
if [ -z "$build_style" -o "$build_style" = "gnu-configure" ]; then
|
||||
for f in $(find ${wrksrc} -type f -name "*config*.sub"); do
|
||||
cp -f ${XBPS_CROSSPFDIR}/config.sub ${f}
|
||||
done
|
||||
for f in $(find ${wrksrc} -type f -name "*config*.guess"); do
|
||||
cp -f ${XBPS_CROSSPFDIR}/config.guess ${f}
|
||||
done
|
||||
fi
|
||||
}
|
|
@ -25,6 +25,7 @@ libdl.so.2 glibc-2.8_1
|
|||
ld-linux-x86-64.so.2 glibc-2.8_1 x86_64
|
||||
ld-linux.so.2 glibc-2.8_1 i686
|
||||
ld-linux.so.3 glibc-2.17_1 armv5tel
|
||||
ld-linux-aarch64.so.1 glibc-2.19_1 aarch64
|
||||
ld.so.1 glibc-2.17_1 mips
|
||||
ld-linux-armhf.so.3 glibc-2.17_1
|
||||
libresolv.so.2 glibc-2.8_1
|
||||
|
|
|
@ -11,7 +11,7 @@ license="Public domain"
|
|||
|
||||
conflicts="base-chroot>=0"
|
||||
provides="base-chroot-${version}_${revision}"
|
||||
only_for_archs="i686-musl x86_64-musl armv6l-musl armv7l-musl"
|
||||
only_for_archs="i686-musl x86_64-musl armv6l-musl armv7l-musl aarch64-musl"
|
||||
|
||||
depends="
|
||||
base-files>=0.92 kernel-libc-headers>=3.17 musl gcc gcc-c++
|
||||
|
|
1
srcpkgs/cross-aarch64-linux-gnu-libc
Symbolic link
1
srcpkgs/cross-aarch64-linux-gnu-libc
Symbolic link
|
@ -0,0 +1 @@
|
|||
cross-aarch64-linux-gnu
|
294
srcpkgs/cross-aarch64-linux-gnu/template
Normal file
294
srcpkgs/cross-aarch64-linux-gnu/template
Normal file
|
@ -0,0 +1,294 @@
|
|||
# Template build file for 'cross-aarch64-linux-gnu'
|
||||
#
|
||||
_binutils_version=2.25
|
||||
_gcc_version=4.9.2
|
||||
_glibc_version=2.21
|
||||
_linux_version=3.14.34
|
||||
|
||||
_triplet=aarch64-linux-gnu
|
||||
_archflags="-march=armv8-a"
|
||||
_CROSS_SYSROOT="/usr/${_triplet}"
|
||||
|
||||
pkgname=cross-${_triplet}
|
||||
version=0.19
|
||||
revision=1
|
||||
short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
|
||||
maintainer="Christian Neukirchen <chneukirchen@gmail.com>"
|
||||
homepage="http://www.voidlinux.eu"
|
||||
license="Public Domain"
|
||||
distfiles="
|
||||
http://ftp.gnu.org/pub/gnu/binutils/binutils-${_binutils_version}.tar.bz2
|
||||
http://ftp.gnu.org/pub/gnu/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.bz2
|
||||
http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
|
||||
http://www.kernel.org/pub/linux/kernel/v3.x/linux-${_linux_version}.tar.xz"
|
||||
checksum="22defc65cfa3ef2a3395faaea75d6331c6e62ea5dfacfed3e2ec17b08c882923
|
||||
2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd
|
||||
aeeb362437965a5d3f40b151094ca79def04a115bd363fdd4a9a0c69482923b8
|
||||
041e2a65565dc93bb5f64422c56d3ca11057b0a2ac2287f04fe9ee9aa1ae0da2"
|
||||
|
||||
lib32disabled=yes
|
||||
nocross=yes
|
||||
create_wrksrc=yes
|
||||
hostmakedepends="perl flex"
|
||||
makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel"
|
||||
depends="${pkgname}-libc-${version}_${revision}"
|
||||
nostrip_files="libgcc.a libgcov.a libgcc_eh.a"
|
||||
only_for_archs="i686 x86_64"
|
||||
|
||||
_apply_patch() {
|
||||
local pname="$(basename $1)"
|
||||
|
||||
if [ ! -f ".${pname}_done" ]; then
|
||||
patch -Np0 -i ${1}
|
||||
touch .${pname}_done
|
||||
fi
|
||||
}
|
||||
|
||||
_linux_headers() {
|
||||
[ -f ${wrksrc}/.linux_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building Linux API headers for ARM\n"
|
||||
|
||||
cd linux-${_linux_version}
|
||||
|
||||
make ARCH=arm64 headers_check
|
||||
make ARCH=arm64 INSTALL_HDR_PATH=${_CROSS_SYSROOT}/usr headers_install
|
||||
|
||||
touch ${wrksrc}/.linux_build_done
|
||||
}
|
||||
|
||||
_binutils_build() {
|
||||
[ -f ${wrksrc}/.binutils_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross binutils\n"
|
||||
[ ! -d binutils-build ] && mkdir binutils-build
|
||||
cd binutils-build
|
||||
|
||||
../binutils-${_binutils_version}/configure \
|
||||
--prefix=/usr --target=${_triplet} \
|
||||
--with-sysroot=${_CROSS_SYSROOT} --disable-nls --disable-shared \
|
||||
--disable-multilib --disable-werror --enable-gold
|
||||
|
||||
make configure-host && make ${makejobs}
|
||||
make install
|
||||
|
||||
touch ${wrksrc}/.binutils_build_done
|
||||
}
|
||||
|
||||
_gcc_bootstrap() {
|
||||
[ -f ${wrksrc}/.gcc_bootstrap_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross gcc bootstrap\n"
|
||||
|
||||
cd gcc-${_gcc_version}
|
||||
|
||||
[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap
|
||||
cd ../gcc-bootstrap
|
||||
|
||||
../gcc-${_gcc_version}/configure --prefix=/usr \
|
||||
--target=${_triplet} --without-headers \
|
||||
--disable-nls --disable-shared --disable-libquadmath \
|
||||
--disable-decimal-float --disable-libgomp --disable-libmudflap \
|
||||
--disable-libssp --disable-libitm --disable-libatomic \
|
||||
--disable-threads --enable-languages=c \
|
||||
--disable-sjlj-exceptions --disable-multilib \
|
||||
--with-gnu-ld --with-gnu-as
|
||||
|
||||
make ${makejobs}
|
||||
make install
|
||||
|
||||
touch ${wrksrc}/.gcc_bootstrap_done
|
||||
}
|
||||
|
||||
_glibc_headers() {
|
||||
[ -f ${wrksrc}/.glibc_headers_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross glibc headers\n"
|
||||
|
||||
[ ! -d glibc-headers ] && mkdir glibc-headers
|
||||
cd glibc-headers
|
||||
|
||||
echo "libc_cv_forced_unwind=yes" > config.cache
|
||||
echo "libc_cv_c_cleanup=yes" >> config.cache
|
||||
|
||||
export CC="${_triplet}-gcc" LD="${_triplet}-ld" \
|
||||
AS="${_triplet}-as" CPP="${_triplet}-cpp"
|
||||
|
||||
../glibc-${_glibc_version}/configure \
|
||||
--host=${_triplet} --prefix=/usr \
|
||||
--with-headers=${_CROSS_SYSROOT}/usr/include \
|
||||
--config-cache \
|
||||
--enable-obsolete-rpc \
|
||||
--enable-kernel=2.6.27
|
||||
|
||||
make -k install-headers cross_compiling=yes \
|
||||
install_root=${_CROSS_SYSROOT}
|
||||
|
||||
touch ${wrksrc}/.glibc_headers_done
|
||||
}
|
||||
|
||||
_glibc_build() {
|
||||
[ -f ${wrksrc}/.glibc_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross glibc\n"
|
||||
|
||||
[ ! -d glibc-build ] && mkdir glibc-build
|
||||
cd glibc-build
|
||||
|
||||
echo "libc_cv_forced_unwind=yes" > config.cache
|
||||
echo "libc_cv_c_cleanup=yes" >> config.cache
|
||||
|
||||
export CC="${_triplet}-gcc" LD="${_triplet}-ld" \
|
||||
AS="${_triplet}-as" CPP="${_triplet}-cpp"
|
||||
export CFLAGS="-Os -pipe -Wno-error ${_archflags}"
|
||||
|
||||
../glibc-${_glibc_version}/configure \
|
||||
--host=${_triplet} --prefix=/usr --libdir=/usr/lib \
|
||||
--with-headers=${_CROSS_SYSROOT}/usr/include \
|
||||
--config-cache \
|
||||
--enable-obsolete-rpc --disable-profile \
|
||||
--enable-kernel=2.6.27
|
||||
|
||||
make ${makejobs}
|
||||
make install_root=${_CROSS_SYSROOT} install
|
||||
|
||||
touch ${wrksrc}/.glibc_build_done
|
||||
}
|
||||
|
||||
_gcc_build() {
|
||||
[ -f ${wrksrc}/.gcc_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross gcc final\n"
|
||||
|
||||
[ ! -d gcc-build ] && mkdir gcc-build
|
||||
cd gcc-build
|
||||
|
||||
export CC="gcc" CFLAGS="-Os -pipe"
|
||||
unset LD AS
|
||||
|
||||
# Make this link to target libs.
|
||||
if [ ! -f .sed_subst_done ]; then
|
||||
sed -e "s, /lib/, ${_CROSS_SYSROOT}/lib/,g;s, /usr/lib/, ${_CROSS_SYSROOT}/usr/lib/,g" \
|
||||
-i ${_CROSS_SYSROOT}/lib/libc.so ${_CROSS_SYSROOT}/lib/libpthread.so
|
||||
sed -e "s, /lib64/, ${_CROSS_SYSROOT}/lib64/,g;s, /usr/lib/, ${_CROSS_SYSROOT}/usr/lib/,g" \
|
||||
-i ${_CROSS_SYSROOT}/lib/libc.so ${_CROSS_SYSROOT}/lib/libpthread.so
|
||||
touch .sed_subst_done
|
||||
fi
|
||||
|
||||
../gcc-${_gcc_version}/configure \
|
||||
--target=${_triplet} --prefix=/usr --libdir=/usr/lib \
|
||||
--with-sysroot=${_CROSS_SYSROOT} --enable-languages=c,c++,lto \
|
||||
--with-gnu-as --with-gnu-ld --disable-multilib \
|
||||
--disable-nls --disable-sjlj-exceptions \
|
||||
--enable-threads=posix --enable-long-longx \
|
||||
--enable-shared --enable-linker-build-id \
|
||||
--enable-gnu-unique-object --enable-lto \
|
||||
--disable-libquadmath --disable-libatomic \
|
||||
--disable-libssp --disable-libmudflap \
|
||||
--disable-libsanitizer --disable-libcilkrts \
|
||||
--disable-libitm --disable-libvtv --disable-libstdcxx-pch \
|
||||
--enable-libstdcxx-time --with-linker-hash-style=gnu
|
||||
|
||||
make ${makejobs}
|
||||
|
||||
touch ${wrksrc}/.gcc_build_done
|
||||
}
|
||||
|
||||
do_build() {
|
||||
unset LDFLAGS
|
||||
export CFLAGS="-Os" CXXFLAGS="-Os"
|
||||
|
||||
for f in include lib libexec bin sbin; do
|
||||
if [ ! -d ${_CROSS_SYSROOT}/usr/${f} ]; then
|
||||
mkdir -p ${_CROSS_SYSROOT}/usr/${f}
|
||||
fi
|
||||
if [ ! -h ${_CROSS_SYSROOT}/${f} ]; then
|
||||
ln -sfr ${_CROSS_SYSROOT}/usr/${f} ${_CROSS_SYSROOT}/${f}
|
||||
fi
|
||||
done
|
||||
|
||||
_binutils_build
|
||||
_gcc_bootstrap
|
||||
_linux_headers
|
||||
_glibc_headers
|
||||
_glibc_build
|
||||
_gcc_build
|
||||
}
|
||||
|
||||
do_install() {
|
||||
for f in include lib libexec bin sbin; do
|
||||
if [ ! -d ${DESTDIR}/${_CROSS_SYSROOT}/usr/${f} ]; then
|
||||
mkdir -p ${DESTDIR}/${_CROSS_SYSROOT}/usr/${f}
|
||||
fi
|
||||
if [ ! -h ${DESTDIR}/${_CROSS_SYSROOT}/${f} ]; then
|
||||
ln -sfr ${DESTDIR}/${_CROSS_SYSROOT}/usr/${f} \
|
||||
${DESTDIR}/${_CROSS_SYSROOT}/${f}
|
||||
fi
|
||||
done
|
||||
|
||||
# install cross binutils
|
||||
cd ${wrksrc}/binutils-build
|
||||
make DESTDIR=${DESTDIR} install
|
||||
|
||||
# install cross gcc
|
||||
cd ${wrksrc}/gcc-build
|
||||
make DESTDIR=${DESTDIR} install
|
||||
|
||||
# install linux API headers for ARM64
|
||||
cd ${wrksrc}/linux-${_linux_version}
|
||||
make ARCH=arm64 INSTALL_HDR_PATH=${DESTDIR}/${_CROSS_SYSROOT}/usr headers_install
|
||||
rm -f $(find ${DESTDIR}/${_CROSS_SYSROOT}/usr/include -name .install -or -name ..install.cmd)
|
||||
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/usr/include/drm
|
||||
|
||||
# install glibc for target
|
||||
cd ${wrksrc}/glibc-build
|
||||
make install_root=${DESTDIR}/${_CROSS_SYSROOT} install install-headers
|
||||
|
||||
# Move files to /usr/lib (lib64).
|
||||
if [ -d ${DESTDIR}/${_sysroot}/usr/lib64 ]; then
|
||||
mv ${DESTDIR}/${_sysroot}/usr/lib64/* ${DESTDIR}/${_sysroot}/usr/lib/
|
||||
rmdir ${DESTDIR}/${_sysroot}/usr/lib64
|
||||
fi
|
||||
|
||||
# Remove unnecessary stuff
|
||||
rm -f ${DESTDIR}/usr/lib*/libiberty.a
|
||||
rm -rf ${DESTDIR}/usr/share
|
||||
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/{etc,var}
|
||||
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/usr/{sbin,share,libexec}
|
||||
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/usr/lib/gconv
|
||||
rm -f ${DESTDIR}/${_CROSS_SYSROOT}/libexec
|
||||
|
||||
for f in sprof localedef gencat pldd sotruss tzselect iconv mtrace \
|
||||
catchsegv xtrace makedb pcprofiledump locale rpcgen getconf \
|
||||
getent ldd; do
|
||||
rm -f ${DESTDIR}/${_CROSS_SYSROOT}/usr/bin/${f}
|
||||
done
|
||||
}
|
||||
|
||||
do_clean() {
|
||||
# Remove temporary stuff from masterdir
|
||||
rm -rf ${_CROSS_SYSROOT}
|
||||
rm -f /usr/bin/${_triplet}*
|
||||
rm -rf /usr/lib/gcc/${_triplet}
|
||||
rm -rf /usr/libexec/gcc/${_triplet}
|
||||
}
|
||||
|
||||
cross-aarch64-linux-gnu-libc_package() {
|
||||
short_desc+=" - glibc files"
|
||||
noarch=yes
|
||||
nostrip=yes
|
||||
noverifyrdeps=yes
|
||||
|
||||
pkg_install() {
|
||||
vmove usr/${_triplet}
|
||||
mkdir -p ${DESTDIR}/usr/${_triplet}/usr/
|
||||
mv ${PKGDESTDIR}/usr/${_triplet}/usr/bin \
|
||||
${DESTDIR}/usr/${_triplet}/usr
|
||||
}
|
||||
}
|
1
srcpkgs/cross-aarch64-linux-musl-libc
Symbolic link
1
srcpkgs/cross-aarch64-linux-musl-libc
Symbolic link
|
@ -0,0 +1 @@
|
|||
cross-aarch64-linux-musl
|
719
srcpkgs/cross-aarch64-linux-musl/files/gcc-4.9.2-musl.diff
Normal file
719
srcpkgs/cross-aarch64-linux-musl/files/gcc-4.9.2-musl.diff
Normal file
|
@ -0,0 +1,719 @@
|
|||
# HG changeset patch
|
||||
# Parent 1f830bec5a3f04b2718ce1395743d8e35c26341c
|
||||
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
|
||||
|
||||
diff -r 1f830bec5a3f libstdc++-v3/configure.host
|
||||
--- a/libstdc++-v3/configure.host Thu Jan 29 14:04:56 2015 -0500
|
||||
+++ b/libstdc++-v3/configure.host Thu Jan 29 14:06:11 2015 -0500
|
||||
@@ -264,6 +264,13 @@
|
||||
os_include_dir="os/bsd/freebsd"
|
||||
;;
|
||||
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
||||
+ # check for musl by target
|
||||
+ case "${host_os}" in
|
||||
+ *-musl*)
|
||||
+ os_include_dir="os/generic"
|
||||
+ ;;
|
||||
+ *)
|
||||
+
|
||||
if [ "$uclibc" = "yes" ]; then
|
||||
os_include_dir="os/uclibc"
|
||||
elif [ "$bionic" = "yes" ]; then
|
||||
@@ -272,6 +279,9 @@
|
||||
os_include_dir="os/gnu-linux"
|
||||
fi
|
||||
;;
|
||||
+
|
||||
+ esac
|
||||
+ ;;
|
||||
hpux*)
|
||||
os_include_dir="os/hpux"
|
||||
;;
|
||||
# HG changeset patch
|
||||
# Parent fc7bb9343dcd071463a63dfc1b356d579eb0872f
|
||||
Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
|
||||
|
||||
diff -r fc7bb9343dcd gcc/config.gcc
|
||||
--- a/gcc/config.gcc Thu Jan 29 14:06:11 2015 -0500
|
||||
+++ b/gcc/config.gcc Thu Jan 29 14:06:13 2015 -0500
|
||||
@@ -594,7 +594,7 @@
|
||||
esac
|
||||
|
||||
# Common C libraries.
|
||||
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
|
||||
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
|
||||
|
||||
# 32-bit x86 processors supported by --with-arch=. Each processor
|
||||
# MUST be separated by exactly one space.
|
||||
@@ -719,6 +719,9 @@
|
||||
*-*-*uclibc*)
|
||||
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
|
||||
;;
|
||||
+ *-*-*musl*)
|
||||
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
|
||||
+ ;;
|
||||
*)
|
||||
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
|
||||
;;
|
||||
diff -r fc7bb9343dcd gcc/config/linux.h
|
||||
--- a/gcc/config/linux.h Thu Jan 29 14:06:11 2015 -0500
|
||||
+++ b/gcc/config/linux.h Thu Jan 29 14:06:13 2015 -0500
|
||||
@@ -32,10 +32,12 @@
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
|
||||
@@ -53,18 +55,21 @@
|
||||
uClibc or Bionic is the default C library and whether
|
||||
-muclibc or -mglibc or -mbionic has been passed to change the default. */
|
||||
|
||||
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
|
||||
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
|
||||
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
|
||||
|
||||
#if DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
|
||||
#elif DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
|
||||
#elif DEFAULT_LIBC == LIBC_BIONIC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif /* DEFAULT_LIBC */
|
||||
@@ -84,21 +89,92 @@
|
||||
|
||||
#define GNU_USER_DYNAMIC_LINKER \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
|
||||
- BIONIC_DYNAMIC_LINKER)
|
||||
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
||||
#define GNU_USER_DYNAMIC_LINKER32 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
|
||||
- BIONIC_DYNAMIC_LINKER32)
|
||||
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
||||
#define GNU_USER_DYNAMIC_LINKER64 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
|
||||
- BIONIC_DYNAMIC_LINKER64)
|
||||
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
||||
#define GNU_USER_DYNAMIC_LINKERX32 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
|
||||
- BIONIC_DYNAMIC_LINKERX32)
|
||||
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
|
||||
|
||||
/* Whether we have Bionic libc runtime */
|
||||
#undef TARGET_HAS_BIONIC
|
||||
#define TARGET_HAS_BIONIC (OPTION_BIONIC)
|
||||
|
||||
+/* musl avoids problematic includes by rearranging the include directories.
|
||||
+ * Unfortunately, this is mostly duplicated from cppdefault.c */
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define INCLUDE_DEFAULTS_MUSL_GPP \
|
||||
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
|
||||
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
|
||||
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
|
||||
+
|
||||
+#ifdef LOCAL_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
|
||||
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
|
||||
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+#endif
|
||||
+
|
||||
+#ifdef PREFIX_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
|
||||
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_PREFIX
|
||||
+#endif
|
||||
+
|
||||
+#ifdef CROSS_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_CROSS \
|
||||
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+#endif
|
||||
+
|
||||
+#ifdef TOOL_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_TOOL \
|
||||
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_TOOL
|
||||
+#endif
|
||||
+
|
||||
+#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+#endif
|
||||
+
|
||||
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+# define INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+# define INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+#else
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+# define INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+#endif
|
||||
+
|
||||
+#undef INCLUDE_DEFAULTS
|
||||
+#define INCLUDE_DEFAULTS \
|
||||
+ { \
|
||||
+ INCLUDE_DEFAULTS_MUSL_GPP \
|
||||
+ INCLUDE_DEFAULTS_MUSL_PREFIX \
|
||||
+ INCLUDE_DEFAULTS_MUSL_CROSS \
|
||||
+ INCLUDE_DEFAULTS_MUSL_TOOL \
|
||||
+ INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
|
||||
+ { 0, 0, 0, 0, 0, 0 } \
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
|
||||
/* This is a *uclinux* target. We don't define below macros to normal linux
|
||||
versions, because doing so would require *uclinux* targets to include
|
||||
diff -r fc7bb9343dcd gcc/config/linux.opt
|
||||
--- a/gcc/config/linux.opt Thu Jan 29 14:06:11 2015 -0500
|
||||
+++ b/gcc/config/linux.opt Thu Jan 29 14:06:13 2015 -0500
|
||||
@@ -30,3 +30,7 @@
|
||||
muclibc
|
||||
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
|
||||
Use uClibc C library
|
||||
+
|
||||
+mmusl
|
||||
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
|
||||
+Use musl C library
|
||||
diff -r fc7bb9343dcd gcc/ginclude/stddef.h
|
||||
--- a/gcc/ginclude/stddef.h Thu Jan 29 14:06:11 2015 -0500
|
||||
+++ b/gcc/ginclude/stddef.h Thu Jan 29 14:06:13 2015 -0500
|
||||
@@ -181,6 +181,7 @@
|
||||
#ifndef _GCC_SIZE_T
|
||||
#ifndef _SIZET_
|
||||
#ifndef __size_t
|
||||
+#ifndef __DEFINED_size_t /* musl */
|
||||
#define __size_t__ /* BeOS */
|
||||
#define __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#define _SIZE_T
|
||||
@@ -197,6 +198,7 @@
|
||||
#define ___int_size_t_h
|
||||
#define _GCC_SIZE_T
|
||||
#define _SIZET_
|
||||
+#define __DEFINED_size_t /* musl */
|
||||
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|
||||
|| defined(__FreeBSD_kernel__)
|
||||
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
|
||||
@@ -214,6 +216,7 @@
|
||||
typedef long ssize_t;
|
||||
#endif /* __BEOS__ */
|
||||
#endif /* !(defined (__GNUG__) && defined (size_t)) */
|
||||
+#endif /* __DEFINED_size_t */
|
||||
#endif /* __size_t */
|
||||
#endif /* _SIZET_ */
|
||||
#endif /* _GCC_SIZE_T */
|
||||
# HG changeset patch
|
||||
# Parent ad6952ac547606025a6fb8496584cbfe1b73a8b7
|
||||
A fix for libgomp to correctly request a POSIX version for time support.
|
||||
|
||||
diff -r ad6952ac5476 libgomp/config/posix/time.c
|
||||
--- a/libgomp/config/posix/time.c Thu Jan 29 14:06:13 2015 -0500
|
||||
+++ b/libgomp/config/posix/time.c Thu Jan 29 14:06:16 2015 -0500
|
||||
@@ -28,6 +28,8 @@
|
||||
The following implementation uses the most simple POSIX routines.
|
||||
If present, POSIX 4 clocks should be used instead. */
|
||||
|
||||
+#define _POSIX_C_SOURCE 199309L /* for clocks */
|
||||
+
|
||||
#include "libgomp.h"
|
||||
#include <unistd.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
diff -r ffa879f29d52 libgcc/unwind-dw2-fde-dip.c
|
||||
--- a/libgcc/unwind-dw2-fde-dip.c Thu Jan 29 14:06:15 2015 -0500
|
||||
+++ b/libgcc/unwind-dw2-fde-dip.c Thu Jan 29 14:06:18 2015 -0500
|
||||
@@ -46,33 +46,13 @@
|
||||
#include "unwind-compat.h"
|
||||
#include "gthr.h"
|
||||
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
|
||||
# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__BIONIC__)
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
-# define ElfW __ElfN
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__OpenBSD__)
|
||||
-# define ElfW(type) Elf_##type
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(TARGET_DL_ITERATE_PHDR) \
|
||||
- && defined(__sun__) && defined(__svr4__)
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
+# ifdef __OpenBSD__
|
||||
+# define ElfW(type) Elf_##type
|
||||
+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
+# define ElfW __ElfN
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_PT_GNU_EH_FRAME)
|
||||
diff -r b35df09b819f gcc/configure
|
||||
--- a/gcc/configure Thu Jan 29 14:06:18 2015 -0500
|
||||
+++ b/gcc/configure Thu Jan 29 14:06:20 2015 -0500
|
||||
@@ -27356,6 +27356,9 @@
|
||||
else
|
||||
gcc_cv_libc_provides_ssp=no
|
||||
case "$target" in
|
||||
+ *-*-musl*)
|
||||
+ # All versions of musl provide stack protector
|
||||
+ gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
||||
# glibc 2.4 and later provides __stack_chk_fail and
|
||||
# either __stack_chk_guard, or TLS access to stack guard canary.
|
||||
@@ -27388,6 +27391,7 @@
|
||||
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
||||
# simply assert that glibc does provide this, which is true for all
|
||||
# realistically usable GNU/Hurd configurations.
|
||||
+ # All supported versions of musl provide it as well
|
||||
gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-darwin* | *-*-freebsd*)
|
||||
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
|
||||
@@ -27477,6 +27481,9 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
+ *-linux-musl*)
|
||||
+ gcc_cv_target_dl_iterate_phdr=yes
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
||||
diff -r b35df09b819f gcc/configure.ac
|
||||
--- a/gcc/configure.ac Thu Jan 29 14:06:18 2015 -0500
|
||||
+++ b/gcc/configure.ac Thu Jan 29 14:06:20 2015 -0500
|
||||
@@ -5039,6 +5039,9 @@
|
||||
gcc_cv_libc_provides_ssp,
|
||||
[gcc_cv_libc_provides_ssp=no
|
||||
case "$target" in
|
||||
+ *-*-musl*)
|
||||
+ # All versions of musl provide stack protector
|
||||
+ gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
||||
# glibc 2.4 and later provides __stack_chk_fail and
|
||||
# either __stack_chk_guard, or TLS access to stack guard canary.
|
||||
@@ -5065,6 +5068,7 @@
|
||||
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
||||
# simply assert that glibc does provide this, which is true for all
|
||||
# realistically usable GNU/Hurd configurations.
|
||||
+ # All supported versions of musl provide it as well
|
||||
gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-darwin* | *-*-freebsd*)
|
||||
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
|
||||
@@ -5131,6 +5135,9 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
+ *-linux-musl*)
|
||||
+ gcc_cv_target_dl_iterate_phdr=yes
|
||||
+ ;;
|
||||
esac
|
||||
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
|
||||
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
||||
# HG changeset patch
|
||||
# Parent b6a339cae9f0607a291a2fe8de80caecd48f1ebd
|
||||
Get rid of ever-broken fixincludes on musl.
|
||||
|
||||
diff -r b6a339cae9f0 fixincludes/mkfixinc.sh
|
||||
--- a/fixincludes/mkfixinc.sh Thu Jan 29 14:06:20 2015 -0500
|
||||
+++ b/fixincludes/mkfixinc.sh Thu Jan 29 14:06:22 2015 -0500
|
||||
@@ -19,7 +19,8 @@
|
||||
powerpc-*-eabi* | \
|
||||
powerpc-*-rtems* | \
|
||||
powerpcle-*-eabisim* | \
|
||||
- powerpcle-*-eabi* )
|
||||
+ powerpcle-*-eabi* | \
|
||||
+ *-musl* )
|
||||
# IF there is no include fixing,
|
||||
# THEN create a no-op fixer and exit
|
||||
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
|
||||
# HG changeset patch
|
||||
# Parent 6c0bb7083dd2eba825f2693dc30d0e39359c1a66
|
||||
Support for i386-linux-musl and x86_64-linux-musl.
|
||||
|
||||
diff -r 6c0bb7083dd2 gcc/config/i386/linux.h
|
||||
--- a/gcc/config/i386/linux.h Thu Jan 29 14:06:22 2015 -0500
|
||||
+++ b/gcc/config/i386/linux.h Thu Jan 29 14:06:25 2015 -0500
|
||||
@@ -21,3 +21,4 @@
|
||||
|
||||
#define GNU_USER_LINK_EMULATION "elf_i386"
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
||||
diff -r 6c0bb7083dd2 gcc/config/i386/linux64.h
|
||||
--- a/gcc/config/i386/linux64.h Thu Jan 29 14:06:22 2015 -0500
|
||||
+++ b/gcc/config/i386/linux64.h Thu Jan 29 14:06:25 2015 -0500
|
||||
@@ -30,3 +30,7 @@
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
|
||||
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
|
||||
+
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
|
||||
diff -r 6c0bb7083dd2 libitm/config/linux/x86/tls.h
|
||||
--- a/libitm/config/linux/x86/tls.h Thu Jan 29 14:06:22 2015 -0500
|
||||
+++ b/libitm/config/linux/x86/tls.h Thu Jan 29 14:06:25 2015 -0500
|
||||
@@ -25,16 +25,19 @@
|
||||
#ifndef LIBITM_X86_TLS_H
|
||||
#define LIBITM_X86_TLS_H 1
|
||||
|
||||
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
||||
+#if defined(__GLIBC_PREREQ)
|
||||
+#if __GLIBC_PREREQ(2, 10)
|
||||
/* Use slots in the TCB head rather than __thread lookups.
|
||||
GLIBC has reserved words 10 through 13 for TM. */
|
||||
#define HAVE_ARCH_GTM_THREAD 1
|
||||
#define HAVE_ARCH_GTM_THREAD_DISP 1
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#include "config/generic/tls.h"
|
||||
|
||||
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
||||
+#if defined(__GLIBC_PREREQ)
|
||||
+#if __GLIBC_PREREQ(2, 10)
|
||||
namespace GTM HIDDEN {
|
||||
|
||||
#ifdef __x86_64__
|
||||
@@ -101,5 +104,6 @@
|
||||
|
||||
} // namespace GTM
|
||||
#endif /* >= GLIBC 2.10 */
|
||||
+#endif
|
||||
|
||||
#endif // LIBITM_X86_TLS_H
|
||||
# HG changeset patch
|
||||
# Parent 4802c181abe099c2f903184ace267c6a527ca91c
|
||||
Support for arm-linux-musl.
|
||||
|
||||
diff -r 4802c181abe0 gcc/config/arm/linux-eabi.h
|
||||
--- a/gcc/config/arm/linux-eabi.h Thu Jan 29 14:06:25 2015 -0500
|
||||
+++ b/gcc/config/arm/linux-eabi.h Thu Jan 29 14:06:27 2015 -0500
|
||||
@@ -77,6 +77,23 @@
|
||||
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
|
||||
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
|
||||
|
||||
+/* For ARM musl currently supports four dynamic linkers:
|
||||
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
|
||||
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
|
||||
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
|
||||
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
|
||||
+ musl does not support the legacy OABI mode.
|
||||
+ All the dynamic linkers live in /lib.
|
||||
+ We default to soft-float, EL. */
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
|
||||
+#endif
|
||||
+#define MUSL_DYNAMIC_LINKER \
|
||||
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
|
||||
+
|
||||
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
|
||||
use the GNU/Linux version, not the generic BPABI version. */
|
||||
#undef LINK_SPEC
|
||||
diff -r 4802c181abe0 libitm/config/arm/hwcap.cc
|
||||
--- a/libitm/config/arm/hwcap.cc Thu Jan 29 14:06:25 2015 -0500
|
||||
+++ b/libitm/config/arm/hwcap.cc Thu Jan 29 14:06:27 2015 -0500
|
||||
@@ -40,7 +40,11 @@
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
+#ifdef __GLIBC__
|
||||
#include <sys/fcntl.h>
|
||||
+#else
|
||||
+#include <fcntl.h>
|
||||
+#endif
|
||||
#include <elf.h>
|
||||
|
||||
static void __attribute__((constructor))
|
||||
# HG changeset patch
|
||||
# Parent f34ce414667f8513979b8a0507f3d6b934f1ebeb
|
||||
Support for mips-linux-musl.
|
||||
|
||||
diff -r f34ce414667f gcc/config/mips/linux.h
|
||||
--- a/gcc/config/mips/linux.h Thu Jan 29 14:06:27 2015 -0500
|
||||
+++ b/gcc/config/mips/linux.h Thu Jan 29 14:06:29 2015 -0500
|
||||
@@ -23,3 +23,10 @@
|
||||
#undef UCLIBC_DYNAMIC_LINKER
|
||||
#define UCLIBC_DYNAMIC_LINKER \
|
||||
"%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
|
||||
+
|
||||
+#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
|
||||
+#endif
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
# HG changeset patch
|
||||
# Parent d4bad9a6572b0e8eacc08d2b1c40d03a6608bee5
|
||||
Support for powerpc-linux-musl.
|
||||
|
||||
diff -r d4bad9a6572b gcc/config.gcc
|
||||
--- a/gcc/config.gcc Thu Jan 29 14:06:29 2015 -0500
|
||||
+++ b/gcc/config.gcc Thu Jan 29 14:06:32 2015 -0500
|
||||
@@ -2334,6 +2334,10 @@
|
||||
powerpc*-*-linux*paired*)
|
||||
tm_file="${tm_file} rs6000/750cl.h" ;;
|
||||
esac
|
||||
+ case ${target} in
|
||||
+ *-linux*-musl*)
|
||||
+ enable_secureplt=yes ;;
|
||||
+ esac
|
||||
if test x${enable_secureplt} = xyes; then
|
||||
tm_file="rs6000/secureplt.h ${tm_file}"
|
||||
fi
|
||||
diff -r d4bad9a6572b gcc/config/rs6000/linux64.h
|
||||
--- a/gcc/config/rs6000/linux64.h Thu Jan 29 14:06:29 2015 -0500
|
||||
+++ b/gcc/config/rs6000/linux64.h Thu Jan 29 14:06:32 2015 -0500
|
||||
@@ -375,17 +375,21 @@
|
||||
#endif
|
||||
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
|
||||
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
|
||||
#if DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
||||
#elif DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif
|
||||
#define GNU_USER_DYNAMIC_LINKER32 \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
||||
#define GNU_USER_DYNAMIC_LINKER64 \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
||||
|
||||
#undef DEFAULT_ASM_ENDIAN
|
||||
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
|
||||
diff -r d4bad9a6572b gcc/config/rs6000/secureplt.h
|
||||
--- a/gcc/config/rs6000/secureplt.h Thu Jan 29 14:06:29 2015 -0500
|
||||
+++ b/gcc/config/rs6000/secureplt.h Thu Jan 29 14:06:32 2015 -0500
|
||||
@@ -18,3 +18,4 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
|
||||
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
|
||||
diff -r d4bad9a6572b gcc/config/rs6000/sysv4.h
|
||||
--- a/gcc/config/rs6000/sysv4.h Thu Jan 29 14:06:29 2015 -0500
|
||||
+++ b/gcc/config/rs6000/sysv4.h Thu Jan 29 14:06:32 2015 -0500
|
||||
@@ -537,6 +537,9 @@
|
||||
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
|
||||
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
|
||||
#endif
|
||||
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
|
||||
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
|
||||
+#endif
|
||||
|
||||
/* Pass -G xxx to the compiler. */
|
||||
#define CC1_SPEC "%{G*} %(cc1_cpu)" \
|
||||
@@ -585,7 +588,8 @@
|
||||
|
||||
/* Override the default target of the linker. */
|
||||
#define LINK_TARGET_SPEC \
|
||||
- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
|
||||
+ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
|
||||
+ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
|
||||
|
||||
/* Any specific OS flags. */
|
||||
#define LINK_OS_SPEC "\
|
||||
@@ -763,15 +767,18 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
|
||||
#if DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
||||
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif
|
||||
#define GNU_USER_DYNAMIC_LINKER \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
||||
|
||||
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
@@ -894,6 +901,7 @@
|
||||
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
|
||||
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
|
||||
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
|
||||
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
|
||||
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
|
||||
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
|
||||
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
|
||||
diff -r 47a8492e5aa7 gcc/config/aarch64/aarch64-linux.h
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h Thu Jan 29 14:06:31 2015 -0500
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h Thu Jan 29 14:06:34 2015 -0500
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1"
|
||||
+
|
||||
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
||||
# HG changeset patch
|
||||
# Parent 9f4208089e8987637569ce7b294256c536396299
|
||||
Microblaze support (again).
|
||||
|
||||
diff -r 9f4208089e89 gcc/config/microblaze/linux.h
|
||||
--- a/gcc/config/microblaze/linux.h Thu Jan 29 14:06:34 2015 -0500
|
||||
+++ b/gcc/config/microblaze/linux.h Thu Jan 29 14:06:36 2015 -0500
|
||||
@@ -25,7 +25,22 @@
|
||||
#undef TLS_NEEDS_GOT
|
||||
#define TLS_NEEDS_GOT 1
|
||||
|
||||
-#define DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
|
||||
+#endif
|
||||
+
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
|
||||
+#else
|
||||
+#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "dynamic_linker", DYNAMIC_LINKER }
|
||||
From 478ee0c03a08e2ef9371fd88d516738936943e78 Mon Sep 17 00:00:00 2001
|
||||
From: David Holsgrove <david.holsgrove@xilinx.com>
|
||||
Date: Fri, 28 Sep 2012 16:32:03 +1000
|
||||
Subject: [PATCH 06/11] [Patch, microblaze]: Add SIZE_TYPE and PTRDIFF_TYPE to
|
||||
microblaze.h
|
||||
|
||||
Fixes warnings like;
|
||||
|
||||
warning: format '%zX' expects argument of type 'size_t',
|
||||
but argument 3 has type 'unsigned int' [-Wformat]
|
||||
|
||||
Changelog
|
||||
|
||||
2013-03-18 David Holsgrove <david.holsgrove@xilinx.com>
|
||||
|
||||
* gcc/config/microblaze/microblaze.h: Define SIZE_TYPE
|
||||
and PTRDIFF_TYPE.
|
||||
|
||||
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
|
||||
---
|
||||
gcc/config/microblaze/microblaze.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff -r 0dbe9a3f7670 gcc/config/microblaze/microblaze.h
|
||||
--- a/gcc/config/microblaze/microblaze.h Thu Jan 29 14:06:36 2015 -0500
|
||||
+++ b/gcc/config/microblaze/microblaze.h Thu Jan 29 14:06:38 2015 -0500
|
||||
@@ -218,6 +218,12 @@
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "int"
|
||||
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
|
||||
((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \
|
||||
&& (ALIGN) < BITS_PER_WORD \
|
||||
diff -r 94ebb0799454 gcc/config/sh/linux.h
|
||||
--- a/gcc/config/sh/linux.h Fri Sep 28 16:32:03 2012 +1000
|
||||
+++ b/gcc/config/sh/linux.h Thu Jan 29 14:06:41 2015 -0500
|
||||
@@ -43,7 +43,14 @@
|
||||
|
||||
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
||||
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT /* BE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "eb"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E
|
||||
+#endif
|
||||
+
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
|
||||
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
||||
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
|
||||
Do not use weak references on any targets for gthread. Necessary on musl, safe elsewhere.
|
||||
|
||||
diff -r d2b373a6ad39 libgcc/gthr.h
|
||||
--- a/libgcc/gthr.h Thu Jan 29 18:59:33 2015 -0500
|
||||
+++ b/libgcc/gthr.h Thu Jan 29 19:00:03 2015 -0500
|
||||
@@ -136,10 +136,8 @@
|
||||
/* The pe-coff weak support isn't fully compatible to ELF's weak.
|
||||
For static libraries it might would work, but as we need to deal
|
||||
with shared versions too, we disable it for mingw-targets. */
|
||||
-#ifdef __MINGW32__
|
||||
#undef GTHREAD_USE_WEAK
|
||||
#define GTHREAD_USE_WEAK 0
|
||||
-#endif
|
||||
|
||||
#ifndef GTHREAD_USE_WEAK
|
||||
#define GTHREAD_USE_WEAK 1
|
237
srcpkgs/cross-aarch64-linux-musl/template
Normal file
237
srcpkgs/cross-aarch64-linux-musl/template
Normal file
|
@ -0,0 +1,237 @@
|
|||
# Template build file for 'cross-aarch64-linux-musl'
|
||||
#
|
||||
_binutils_version=2.25
|
||||
_gcc_version=4.9.2
|
||||
_musl_version=1.1.8
|
||||
_linux_version=3.18.5
|
||||
|
||||
_triplet=aarch64-linux-musl
|
||||
_archflags="-march=armv8-a"
|
||||
_sysroot="/usr/${_triplet}"
|
||||
|
||||
pkgname=cross-${_triplet}
|
||||
version=0.17
|
||||
revision=1
|
||||
short_desc="Cross toolchain for ${_triplet} LE Hard Float target (musl)"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
homepage="http://www.voidlinux.eu"
|
||||
license="Public Domain"
|
||||
distfiles="
|
||||
http://ftp.gnu.org/pub/gnu/binutils/binutils-${_binutils_version}.tar.bz2
|
||||
http://ftp.gnu.org/pub/gnu/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.bz2
|
||||
http://www.kernel.org/pub/linux/kernel/v3.x/linux-${_linux_version}.tar.xz
|
||||
http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
|
||||
checksum="22defc65cfa3ef2a3395faaea75d6331c6e62ea5dfacfed3e2ec17b08c882923
|
||||
2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd
|
||||
e4442436e59c74169e98d38d2e2a434c7b73f8eda0aa8f20e454eaf52270fc90
|
||||
fa928506415b9c555977daaf874c190eaf7fbbd16028cc5c5f33a00a83227813"
|
||||
|
||||
lib32disabled=yes
|
||||
nocross=yes
|
||||
nodebug=yes
|
||||
create_wrksrc=yes
|
||||
|
||||
hostmakedepends="perl flex"
|
||||
makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel"
|
||||
nostrip_files="libgcc.a libgcov.a libgcc_eh.a"
|
||||
depends="${pkgname}-libc-${version}_${revision}"
|
||||
|
||||
_apply_patch() {
|
||||
local pname="$(basename $1)"
|
||||
|
||||
if [ ! -f ".${pname}_done" ]; then
|
||||
patch -Np1 -i ${1}
|
||||
touch .${pname}_done
|
||||
fi
|
||||
}
|
||||
|
||||
_binutils_build() {
|
||||
[ -f ${wrksrc}/.binutils_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross binutils bootstrap\n"
|
||||
|
||||
[ ! -d binutils-build ] && mkdir binutils-build
|
||||
cd binutils-build
|
||||
|
||||
../binutils-${_binutils_version}/configure \
|
||||
--prefix=/usr --target=${_triplet} --with-sysroot=${_sysroot} \
|
||||
--disable-nls --disable-multilib --disable-werror \
|
||||
--disable-shared --enable-gold
|
||||
|
||||
make configure-host && make ${makejobs}
|
||||
make install
|
||||
|
||||
touch ${wrksrc}/.binutils_build_done
|
||||
}
|
||||
|
||||
_gcc_bootstrap() {
|
||||
[ -f ${wrksrc}/.gcc_bootstrap_done ] && return 0
|
||||
|
||||
cd ${wrksrc}/gcc-${_gcc_version}
|
||||
_apply_patch ${FILESDIR}/gcc-${_gcc_version}-musl.diff
|
||||
|
||||
msg_normal "Building cross gcc bootstrap\n"
|
||||
|
||||
[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap
|
||||
cd ../gcc-bootstrap
|
||||
|
||||
CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0" \
|
||||
../gcc-${_gcc_version}/configure --prefix=/usr \
|
||||
--target=${_triplet} --with-sysroot=${_sysroot} --with-newlib \
|
||||
--enable-languages=c --with-newlib --disable-libssp --disable-nls \
|
||||
--disable-libquadmath --disable-threads --disable-decimal-float \
|
||||
--disable-shared --disable-libmudflap --disable-libgomp \
|
||||
--disable-libatomic
|
||||
|
||||
make ${makejobs}
|
||||
make install
|
||||
|
||||
touch ${wrksrc}/.gcc_bootstrap_done
|
||||
}
|
||||
|
||||
_linux_headers() {
|
||||
[ -f ${wrksrc}/.linux_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building Linux API headers for ARM\n"
|
||||
|
||||
cd linux-${_linux_version}
|
||||
|
||||
make ARCH=arm64 headers_check
|
||||
make ARCH=arm64 INSTALL_HDR_PATH=${_sysroot}/usr headers_install
|
||||
|
||||
touch ${wrksrc}/.linux_build_done
|
||||
}
|
||||
|
||||
_musl_build() {
|
||||
[ -f ${wrksrc}/.musl_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}/musl-${_musl_version}
|
||||
msg_normal "Building cross musl libc\n"
|
||||
|
||||
CC="${_triplet}-gcc" CFLAGS="-Os -pipe ${_archflags}" \
|
||||
./configure --prefix=/usr \
|
||||
|
||||
make ${makejobs}
|
||||
make DESTDIR=${_sysroot} install
|
||||
|
||||
touch ${wrksrc}/.musl_build_done
|
||||
}
|
||||
|
||||
_gcc_build() {
|
||||
[ -f ${wrksrc}/.gcc_build_done ] && return 0
|
||||
|
||||
cd ${wrksrc}
|
||||
msg_normal "Building cross gcc final\n"
|
||||
|
||||
[ ! -d gcc-build ] && mkdir gcc-build
|
||||
cd gcc-build
|
||||
|
||||
../gcc-${_gcc_version}/configure \
|
||||
--target=${_triplet} --with-sysroot=${_sysroot} --prefix=/usr \
|
||||
--enable-languages=c,c++,lto --enable-lto --disable-libsanitizer \
|
||||
--disable-multilib --disable-nls --disable-libquadmath \
|
||||
--disable-libmudflap --enable-shared \
|
||||
--with-gnu-as --with-gnu-ld --disable-multilib \
|
||||
--disable-nls --disable-sjlj-exceptions \
|
||||
--enable-threads=posix --enable-long-longx \
|
||||
--enable-shared --enable-linker-build-id \
|
||||
--enable-gnu-unique-object --enable-lto \
|
||||
--disable-libquadmath --disable-libatomic \
|
||||
--disable-libssp --disable-libmudflap \
|
||||
--disable-libsanitizer --disable-libcilkrts \
|
||||
--disable-libitm --disable-libvtv --disable-libstdcxx-pch \
|
||||
--enable-libstdcxx-time --with-linker-hash-style=gnu
|
||||
|
||||
make ${makejobs}
|
||||
|
||||
touch ${wrksrc}/.gcc_build_done
|
||||
}
|
||||
|
||||
do_build() {
|
||||
# Ensure we use sane environment
|
||||
unset CC CXX CPP LD AS AR RANLIB OBJDUMP READELF NM
|
||||
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
|
||||
export CFLAGS="-Os -pipe" CXXFLAGS="-Os -pipe"
|
||||
|
||||
for f in include lib libexec bin sbin; do
|
||||
if [ ! -d ${_sysroot}/usr/${f} ]; then
|
||||
mkdir -p ${_sysroot}/usr/${f}
|
||||
fi
|
||||
if [ ! -h ${_sysroot}/${f} ]; then
|
||||
ln -sfr ${_sysroot}/usr/${f} ${_sysroot}/${f}
|
||||
fi
|
||||
done
|
||||
|
||||
_binutils_build
|
||||
_gcc_bootstrap
|
||||
_linux_headers
|
||||
_musl_build
|
||||
_gcc_build
|
||||
}
|
||||
|
||||
do_install() {
|
||||
for f in include lib libexec bin sbin; do
|
||||
if [ ! -d ${DESTDIR}/${_sysroot}/usr/${f} ]; then
|
||||
mkdir -p ${DESTDIR}/${_sysroot}/usr/${f}
|
||||
fi
|
||||
if [ ! -h ${DESTDIR}/${_sysroot}/${f} ]; then
|
||||
ln -sfr ${DESTDIR}/${_sysroot}/usr/${f} \
|
||||
${DESTDIR}/${_sysroot}/${f}
|
||||
fi
|
||||
done
|
||||
|
||||
# install linux API headers
|
||||
cd ${wrksrc}/linux-${_linux_version}
|
||||
make ARCH=arm64 INSTALL_HDR_PATH=${DESTDIR}/${_sysroot}/usr headers_install
|
||||
rm -f $(find ${DESTDIR}/${_sysroot}/usr/include -name .install -or -name ..install.cmd)
|
||||
rm -rf ${DESTDIR}/${_sysroot}/usr/include/drm
|
||||
|
||||
# install cross binutils
|
||||
cd ${wrksrc}/binutils-build
|
||||
make DESTDIR=${DESTDIR} install
|
||||
|
||||
# install cross gcc
|
||||
cd ${wrksrc}/gcc-build
|
||||
make DESTDIR=${DESTDIR} install
|
||||
|
||||
# install musl libc for target
|
||||
cd ${wrksrc}/musl-${_musl_version}
|
||||
make DESTDIR=${DESTDIR}/${_sysroot} install
|
||||
|
||||
# Remove useless headers.
|
||||
rm -rf ${DESTDIR}/usr/lib/gcc/${_triplet}/*/include-fixed/ \
|
||||
${DESTDIR}/usr/lib/gcc/${_triplet}/*/include/stddef.h
|
||||
|
||||
# Make ld-musl-armhf.so.1 symlink relative.
|
||||
#ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-armhf.so.1
|
||||
|
||||
# Remove unnecessary stuff
|
||||
rm -f ${DESTDIR}/usr/lib*/libiberty.a
|
||||
rm -rf ${DESTDIR}/usr/share
|
||||
rm -rf ${DESTDIR}/${_sysroot}/{etc,var}
|
||||
rm -rf ${DESTDIR}/${_sysroot}/usr/{sbin,share,libexec}
|
||||
rm -f ${DESTDIR}/${_sysroot}/libexec
|
||||
rm -f ${DESTDIR}/${_sysroot}/lib/*.py
|
||||
}
|
||||
|
||||
do_clean() {
|
||||
# Remove temporary stuff from masterdir
|
||||
rm -rf ${_sysroot}
|
||||
rm -f /usr/bin/${_triplet}*
|
||||
rm -rf /usr/lib/gcc/${_triplet}
|
||||
rm -rf /usr/libexec/gcc/${_triplet}
|
||||
}
|
||||
|
||||
cross-aarch64-linux-musl-libc_package() {
|
||||
short_desc+=" - libc files"
|
||||
noarch=yes
|
||||
noverifydeps=yes
|
||||
pkg_install() {
|
||||
vmove usr/${_triplet}
|
||||
mkdir -p ${DESTDIR}/usr/${_triplet}/usr/
|
||||
mv ${PKGDESTDIR}/usr/${_triplet}/usr/bin ${DESTDIR}/usr/${_triplet}/usr
|
||||
|
||||
}
|
||||
}
|
|
@ -52,4 +52,5 @@ shlib_provides="
|
|||
libgomp.so.1
|
||||
ld-linux.so.2
|
||||
ld-linux-x86_64.so.2
|
||||
ld-linux-armhf.so.3"
|
||||
ld-linux-armhf.so.3
|
||||
ld-linux-aarch64.so.1"
|
||||
|
|
|
@ -44,9 +44,12 @@ case "$XBPS_TARGET_MACHINE" in
|
|||
armv6l) _triplet="arm-linux-gnueabihf";;
|
||||
armv7l) _triplet="arm-linux-gnueabihf7";;
|
||||
arm*-musl) _triplet="arm-linux-musleabi";;
|
||||
aarch64) _triplet="aarch64-linux-gnu";;
|
||||
aarch64-musl) _triplet="aarch64-linux-musl";;
|
||||
esac
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl) depends+=" musl";;
|
||||
aarch64) depends+=" glibc-devel";;
|
||||
*) subpackages+=" libsanitizer libsanitizer-devel"; depends+=" glibc-devel";;
|
||||
esac
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
|
@ -75,6 +78,7 @@ do_configure() {
|
|||
armv5*) _args+=" --with-arch=armv5te --with-float=soft";;
|
||||
armv6l*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
|
||||
armv7l*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
|
||||
aarch64*) _args+=" --with-arch=armv8-a";;
|
||||
esac
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
@ -86,7 +90,7 @@ do_configure() {
|
|||
_args+=" --disable-multilib --host=$XBPS_CROSS_TRIPLET --with-build-sysroot=${XBPS_CROSS_BASE}"
|
||||
else
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
arm*) _args+=" --build=${_triplet}";;
|
||||
arm*|aarch64*) _args+=" --build=${_triplet}";;
|
||||
esac
|
||||
_langs="c,c++,objc,obj-c++,fortran,lto,go,java"
|
||||
_args+=" --enable-java-gc=boehm --enable-fast-character"
|
||||
|
@ -103,6 +107,7 @@ do_configure() {
|
|||
fi
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl) _args+=" --disable-libsanitizer";;
|
||||
aarch64*) _args+=" --disable-libsanitizer";;
|
||||
esac
|
||||
|
||||
export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
|
||||
|
@ -135,7 +140,7 @@ pre_install() {
|
|||
}
|
||||
do_install() {
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
x86_64*)
|
||||
x86_64*|aarch64*)
|
||||
vmkdir usr/lib
|
||||
ln -sfr ${DESTDIR}/usr/lib ${DESTDIR}/usr/lib64
|
||||
;;
|
||||
|
|
|
@ -59,6 +59,7 @@ do_configure() {
|
|||
armv5*) configure_args+=" --with-march=armv5te --without-fp --with-float=soft";;
|
||||
armv6l*) configure_args+=" --with-march=armv6 --with-fpu=vfp --with-float=hard";;
|
||||
armv7l*) configure_args+=" --with-march=armv7-a --with-fpu=vfpv3 --with-float=hard";;
|
||||
arm64*) configure_args+=" --with-march=armv8-a";;
|
||||
esac
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
|
|
@ -21,7 +21,8 @@ fi
|
|||
case "$XBPS_TARGET_MACHINE" in
|
||||
i686*|x86_64*) _arch="x86";;
|
||||
arm*) _arch="arm";;
|
||||
*) msg_error "$pkgver: unknown architecture.\n";;
|
||||
aarch64*) _arch="arm64";;
|
||||
*) msg_error "$pkgname: unknown architecture.\n";;
|
||||
esac
|
||||
|
||||
do_build() {
|
||||
|
|
|
@ -13,7 +13,7 @@ distfiles="http://www.musl-libc.org/releases/musl-${version}.tar.gz"
|
|||
checksum=fa928506415b9c555977daaf874c190eaf7fbbd16028cc5c5f33a00a83227813
|
||||
|
||||
shlib_provides="libc.so"
|
||||
only_for_archs="i686-musl x86_64-musl armv6l-musl armv7l-musl"
|
||||
only_for_archs="i686-musl x86_64-musl armv6l-musl armv7l-musl aarch64-musl"
|
||||
CFLAGS="-fno-stack-protector -U_FORTIFY_SOURCE"
|
||||
|
||||
post_build() {
|
||||
|
|
1142
srcpkgs/perl/files/cross/config.sh-aarch64
Normal file
1142
srcpkgs/perl/files/cross/config.sh-aarch64
Normal file
File diff suppressed because one or more lines are too long
1143
srcpkgs/perl/files/cross/config.sh-aarch64-musl
Normal file
1143
srcpkgs/perl/files/cross/config.sh-aarch64-musl
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue