From 0e14700702f06f09f25bc861e2642a6d42da982b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 15 Dec 2013 14:09:00 +0100 Subject: need to merge third patch from Phil manually. disable on non Linux hosts --- target/config/Config.in | 10 ++++++++++ target/linux/config/Config.in.block | 4 ++++ target/linux/config/Config.in.fs | 6 +++++- target/x86/Makefile | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) (limited to 'target') diff --git a/target/config/Config.in b/target/config/Config.in index f551e21a0..7ddc7b83c 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -748,6 +748,16 @@ config ADK_TARGET_ROOTFS_MMC Use this option if you have a MMC/SDCARD based system. (ext2 filesystem is used.) +config ADK_TARGET_ROOTFS_ISO + bool "ISO image" + select ADK_KERNEL_ISO9660_FS + select ADK_KERNEL_JOLIET + select ADK_KERNEL_SCSI + select ADK_KERNEL_BLK_DEV_SR + depends on ADK_HOST_LINUX + help + Use this option to create a bootable ISO image. + config ADK_TARGET_ROOTFS_ARCHIVE bool "Archive usable for different filesystems" select ADK_KERNEL_EXT2_FS if ADK_HARDWARE_QEMU diff --git a/target/linux/config/Config.in.block b/target/linux/config/Config.in.block index bbd9ce745..fb5bf080f 100644 --- a/target/linux/config/Config.in.block +++ b/target/linux/config/Config.in.block @@ -28,6 +28,9 @@ config ADK_KERNEL_SCSI config ADK_KERNEL_BLK_DEV_SD boolean +config ADK_KERNEL_BLK_DEV_SR + boolean + config ADK_KERNEL_ISCSI_TCP boolean @@ -324,6 +327,7 @@ config ADK_KPACKAGE_KMOD_BLK_DEV_SD config ADK_KPACKAGE_KMOD_BLK_DEV_SR prompt "kmod-scsi-cdrom................... SCSI CDROM support" depends on !ADK_KERNEL_SCSI + depends on !ADK_KERNEL_BLK_DEV_SR depends on ADK_KPACKAGE_KMOD_SCSI tristate help diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs index ab048805e..9bdc6b9e5 100644 --- a/target/linux/config/Config.in.fs +++ b/target/linux/config/Config.in.fs @@ -227,7 +227,11 @@ config ADK_KPACKAGE_KMOD_FUSE_FS fuse-utils. config ADK_KERNEL_JOLIET - bool + boolean + default n + +config ADK_KERNEL_ISO9660_FS + boolean default n config ADK_KPACKAGE_KMOD_ISO9660_FS diff --git a/target/x86/Makefile b/target/x86/Makefile index a3dc8ae70..87d3b5806 100644 --- a/target/x86/Makefile +++ b/target/x86/Makefile @@ -65,4 +65,8 @@ ifeq ($(ADK_HARDWARE_QEMU),y) @echo "Start qemu with following command line:" @echo 'qemu-system-i386 -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=e1000 -kernel $(BIN_DIR)/$(TARGET_KERNEL)' endif +ifeq (${ADK_TARGET_FS},iso) +imageinstall: ${BIN_DIR}/${ROOTFSISO} + @echo 'ISO image is at $<' +endif endif -- cgit v1.2.3 From f377248abda877e2a945f4152e3e57bbaaeec1ca Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 15 Dec 2013 14:11:52 +0100 Subject: use linux.bin without included dtb, dtb is already provided by qemu. no need to patch kernel dts. --- target/config/Config.in | 2 +- target/linux/patches/3.11.10/microblaze-dts.patch | 475 ---------------------- toolchain/musl/Makefile | 3 + 3 files changed, 4 insertions(+), 476 deletions(-) delete mode 100644 target/linux/patches/3.11.10/microblaze-dts.patch (limited to 'target') diff --git a/target/config/Config.in b/target/config/Config.in index e59b86010..c02461819 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -20,7 +20,7 @@ config ADK_TARGET_KERNEL string default "zImage" if ADK_TARGET_KERNEL_ZIMAGE default "Image" if ADK_TARGET_KERNEL_IMAGE - default "simpleImage.system" if ADK_TARGET_KERNEL_LINUXBIN + default "linux.bin" if ADK_TARGET_KERNEL_LINUXBIN default "vmlinuz" if ADK_TARGET_KERNEL_VMLINUZ default "bzImage" if ADK_TARGET_KERNEL_BZIMAGE default "vmlinux" diff --git a/target/linux/patches/3.11.10/microblaze-dts.patch b/target/linux/patches/3.11.10/microblaze-dts.patch deleted file mode 100644 index e73959a73..000000000 --- a/target/linux/patches/3.11.10/microblaze-dts.patch +++ /dev/null @@ -1,475 +0,0 @@ -diff -Nur linux-3.11.10.orig/arch/microblaze/platform/generic/system.dts linux-3.11.10/arch/microblaze/platform/generic/system.dts ---- linux-3.11.10.orig/arch/microblaze/platform/generic/system.dts 2013-11-29 19:42:37.000000000 +0100 -+++ linux-3.11.10/arch/microblaze/platform/generic/system.dts 2013-12-08 13:01:59.000000000 +0100 -@@ -1,102 +1,72 @@ --/* -- * Device Tree Generator version: 1.1 -- * -- * (C) Copyright 2007-2008 Xilinx, Inc. -- * (C) Copyright 2007-2009 Michal Simek -- * -- * Michal SIMEK -- * -- * This program 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 (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. -- * -- * 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., 59 Temple Place, Suite 330, Boston, -- * MA 02111-1307 USA -- * -- * CAUTION: This file is automatically generated by libgen. -- * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6 -- * -- * XPS project directory: Xilinx-ML505-ll_temac-sgdma-MMU-FDT-edk101 -- */ -- - /dts-v1/; -+ - / { -- #address-cells = <1>; -- #size-cells = <1>; -+ #address-cells = <0x1>; -+ #size-cells = <0x1>; - compatible = "xlnx,microblaze"; -- hard-reset-gpios = <&LEDs_8Bit 2 1>; - model = "testing"; -- DDR2_SDRAM: memory@90000000 { -+ -+ memory@90000000 { - device_type = "memory"; -- reg = < 0x90000000 0x10000000 >; -- } ; -- aliases { -- ethernet0 = &Hard_Ethernet_MAC; -- serial0 = &RS232_Uart_1; -- } ; -+ reg = <0x90000000 0x8000000>; -+ }; -+ - chosen { -- bootargs = "console=ttyUL0,115200 highres=on"; -+ bootargs = "console=ttyUL0,115200"; - linux,stdout-path = "/plb@0/serial@84000000"; -- } ; -+ }; -+ - cpus { -- #address-cells = <1>; -+ #address-cells = <0x1>; - #cpus = <0x1>; -- #size-cells = <0>; -- microblaze_0: cpu@0 { -- clock-frequency = <125000000>; -+ #size-cells = <0x0>; -+ -+ cpu@0 { -+ clock-frequency = <0x3b9aca0>; - compatible = "xlnx,microblaze-7.10.d"; - d-cache-baseaddr = <0x90000000>; -- d-cache-highaddr = <0x9fffffff>; -+ d-cache-highaddr = <0x97ffffff>; - d-cache-line-size = <0x10>; -- d-cache-size = <0x2000>; -+ d-cache-size = <0x800>; - device_type = "cpu"; - i-cache-baseaddr = <0x90000000>; -- i-cache-highaddr = <0x9fffffff>; -+ i-cache-highaddr = <0x97ffffff>; - i-cache-line-size = <0x10>; -- i-cache-size = <0x2000>; -+ i-cache-size = <0x800>; - model = "microblaze,7.10.d"; -- reg = <0>; -- timebase-frequency = <125000000>; -- xlnx,addr-tag-bits = <0xf>; -+ reg = <0x0>; -+ timebase-frequency = <0x3b9aca0>; -+ xlnx,addr-tag-bits = <0x10>; - xlnx,allow-dcache-wr = <0x1>; - xlnx,allow-icache-wr = <0x1>; - xlnx,area-optimized = <0x0>; -- xlnx,cache-byte-size = <0x2000>; -+ xlnx,cache-byte-size = <0x800>; - xlnx,d-lmb = <0x1>; - xlnx,d-opb = <0x0>; - xlnx,d-plb = <0x1>; - xlnx,data-size = <0x20>; -- xlnx,dcache-addr-tag = <0xf>; -- xlnx,dcache-always-used = <0x1>; -- xlnx,dcache-byte-size = <0x2000>; -+ xlnx,dcache-addr-tag = <0x10>; -+ xlnx,dcache-always-used = <0x0>; -+ xlnx,dcache-byte-size = <0x800>; - xlnx,dcache-line-len = <0x4>; - xlnx,dcache-use-fsl = <0x1>; - xlnx,debug-enabled = <0x1>; -- xlnx,div-zero-exception = <0x1>; -+ xlnx,div-zero-exception = <0x0>; - xlnx,dopb-bus-exception = <0x0>; - xlnx,dynamic-bus-sizing = <0x1>; - xlnx,edge-is-positive = <0x1>; -- xlnx,family = "virtex5"; -- xlnx,endianness = <0x1>; -- xlnx,fpu-exception = <0x1>; -+ xlnx,family = "spartan3adsp"; -+ xlnx,fpu-exception = <0x0>; - xlnx,fsl-data-size = <0x20>; - xlnx,fsl-exception = <0x0>; - xlnx,fsl-links = <0x0>; - xlnx,i-lmb = <0x1>; - xlnx,i-opb = <0x0>; - xlnx,i-plb = <0x1>; -- xlnx,icache-always-used = <0x1>; -+ xlnx,icache-always-used = <0x0>; - xlnx,icache-line-len = <0x4>; - xlnx,icache-use-fsl = <0x1>; -- xlnx,ill-opcode-exception = <0x1>; -+ xlnx,ill-opcode-exception = <0x0>; - xlnx,instance = "microblaze_0"; - xlnx,interconnect = <0x1>; - xlnx,interrupt-is-edge = <0x0>; -@@ -105,11 +75,11 @@ - xlnx,mmu-itlb-size = <0x2>; - xlnx,mmu-tlb-access = <0x3>; - xlnx,mmu-zones = <0x10>; -- xlnx,number-of-pc-brk = <0x1>; -- xlnx,number-of-rd-addr-brk = <0x0>; -- xlnx,number-of-wr-addr-brk = <0x0>; -- xlnx,opcode-0x0-illegal = <0x1>; -- xlnx,pvr = <0x2>; -+ xlnx,number-of-pc-brk = <0x3>; -+ xlnx,number-of-rd-addr-brk = <0x2>; -+ xlnx,number-of-wr-addr-brk = <0x2>; -+ xlnx,opcode-0x0-illegal = <0x0>; -+ xlnx,pvr = <0x1>; - xlnx,pvr-user1 = <0x0>; - xlnx,pvr-user2 = <0x0>; - xlnx,reset-msr = <0x0>; -@@ -117,29 +87,44 @@ - xlnx,unaligned-exceptions = <0x1>; - xlnx,use-barrel = <0x1>; - xlnx,use-dcache = <0x1>; -- xlnx,use-div = <0x1>; -+ xlnx,use-div = <0x0>; - xlnx,use-ext-brk = <0x1>; - xlnx,use-ext-nm-brk = <0x1>; - xlnx,use-extended-fsl-instr = <0x0>; -- xlnx,use-fpu = <0x2>; -- xlnx,use-hw-mul = <0x2>; -+ xlnx,use-fpu = <0x0>; -+ xlnx,use-hw-mul = <0x1>; - xlnx,use-icache = <0x1>; - xlnx,use-interrupt = <0x1>; - xlnx,use-mmu = <0x3>; - xlnx,use-msr-instr = <0x1>; - xlnx,use-pcmp-instr = <0x1>; -- } ; -- } ; -- mb_plb: plb@0 { -- #address-cells = <1>; -- #size-cells = <1>; -- compatible = "xlnx,plb-v46-1.03.a", "xlnx,plb-v46-1.00.a", "simple-bus"; -- ranges ; -- FLASH: flash@a0000000 { -- bank-width = <2>; -+ }; -+ }; -+ -+ plb@0 { -+ #address-cells = <0x1>; -+ #size-cells = <0x1>; -+ compatible = "xlnx,plb-v46-1.03.a", "simple-bus"; -+ ranges; -+ -+ ethernet@81000000 { -+ compatible = "xlnx,xps-ethernetlite-2.00.b"; -+ device_type = "network"; -+ interrupt-parent = <0x1>; -+ interrupts = <0x1 0x0>; -+ local-mac-address = [02 00 00 00 00 00]; -+ reg = <0x81000000 0x10000>; -+ xlnx,duplex = <0x1>; -+ xlnx,family = "spartan3adsp"; -+ xlnx,rx-ping-pong = <0x0>; -+ xlnx,tx-ping-pong = <0x0>; -+ }; -+ -+ flash@a0000000 { -+ bank-width = <0x1>; - compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash"; -- reg = < 0xa0000000 0x2000000 >; -- xlnx,family = "virtex5"; -+ reg = <0xa0000000 0x1000000>; -+ xlnx,family = "spartan3adsp"; - xlnx,include-datawidth-matching-0 = <0x1>; - xlnx,include-datawidth-matching-1 = <0x0>; - xlnx,include-datawidth-matching-2 = <0x0>; -@@ -147,9 +132,9 @@ - xlnx,include-negedge-ioregs = <0x0>; - xlnx,include-plb-ipif = <0x1>; - xlnx,include-wrbuf = <0x1>; -- xlnx,max-mem-width = <0x10>; -+ xlnx,max-mem-width = <0x8>; - xlnx,mch-native-dwidth = <0x20>; -- xlnx,mch-plb-clk-period-ps = <0x1f40>; -+ xlnx,mch-plb-clk-period-ps = <0x3e80>; - xlnx,mch-splb-awidth = <0x20>; - xlnx,mch0-accessbuf-depth = <0x10>; - xlnx,mch0-protocol = <0x0>; -@@ -163,7 +148,7 @@ - xlnx,mch3-accessbuf-depth = <0x10>; - xlnx,mch3-protocol = <0x0>; - xlnx,mch3-rddatabuf-depth = <0x10>; -- xlnx,mem0-width = <0x10>; -+ xlnx,mem0-width = <0x8>; - xlnx,mem1-width = <0x20>; - xlnx,mem2-width = <0x20>; - xlnx,mem3-width = <0x20>; -@@ -178,31 +163,31 @@ - xlnx,synch-pipedelay-1 = <0x2>; - xlnx,synch-pipedelay-2 = <0x2>; - xlnx,synch-pipedelay-3 = <0x2>; -- xlnx,tavdv-ps-mem-0 = <0x1adb0>; -+ xlnx,tavdv-ps-mem-0 = <0x11170>; - xlnx,tavdv-ps-mem-1 = <0x3a98>; - xlnx,tavdv-ps-mem-2 = <0x3a98>; - xlnx,tavdv-ps-mem-3 = <0x3a98>; -- xlnx,tcedv-ps-mem-0 = <0x1adb0>; -+ xlnx,tcedv-ps-mem-0 = <0x11170>; - xlnx,tcedv-ps-mem-1 = <0x3a98>; - xlnx,tcedv-ps-mem-2 = <0x3a98>; - xlnx,tcedv-ps-mem-3 = <0x3a98>; -- xlnx,thzce-ps-mem-0 = <0x88b8>; -+ xlnx,thzce-ps-mem-0 = <0x61a8>; - xlnx,thzce-ps-mem-1 = <0x1b58>; - xlnx,thzce-ps-mem-2 = <0x1b58>; - xlnx,thzce-ps-mem-3 = <0x1b58>; -- xlnx,thzoe-ps-mem-0 = <0x1b58>; -+ xlnx,thzoe-ps-mem-0 = <0x61a8>; - xlnx,thzoe-ps-mem-1 = <0x1b58>; - xlnx,thzoe-ps-mem-2 = <0x1b58>; - xlnx,thzoe-ps-mem-3 = <0x1b58>; -- xlnx,tlzwe-ps-mem-0 = <0x88b8>; -+ xlnx,tlzwe-ps-mem-0 = <0x1388>; - xlnx,tlzwe-ps-mem-1 = <0x0>; - xlnx,tlzwe-ps-mem-2 = <0x0>; - xlnx,tlzwe-ps-mem-3 = <0x0>; -- xlnx,twc-ps-mem-0 = <0x2af8>; -+ xlnx,twc-ps-mem-0 = <0x11170>; - xlnx,twc-ps-mem-1 = <0x3a98>; - xlnx,twc-ps-mem-2 = <0x3a98>; - xlnx,twc-ps-mem-3 = <0x3a98>; -- xlnx,twp-ps-mem-0 = <0x11170>; -+ xlnx,twp-ps-mem-0 = <0xafc8>; - xlnx,twp-ps-mem-1 = <0x2ee0>; - xlnx,twp-ps-mem-2 = <0x2ee0>; - xlnx,twp-ps-mem-3 = <0x2ee0>; -@@ -214,154 +199,83 @@ - xlnx,xcl2-writexfer = <0x1>; - xlnx,xcl3-linesize = <0x4>; - xlnx,xcl3-writexfer = <0x1>; -- } ; -- Hard_Ethernet_MAC: xps-ll-temac@81c00000 { -- #address-cells = <1>; -- #size-cells = <1>; -- compatible = "xlnx,compound"; -- ranges ; -- ethernet@81c00000 { -- compatible = "xlnx,xps-ll-temac-1.01.b", "xlnx,xps-ll-temac-1.00.a"; -- device_type = "network"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 5 2 >; -- llink-connected = <&PIM3>; -- local-mac-address = [ 00 0a 35 00 00 00 ]; -- reg = < 0x81c00000 0x40 >; -- xlnx,bus2core-clk-ratio = <0x1>; -- xlnx,phy-type = <0x1>; -- xlnx,phyaddr = <0x1>; -- xlnx,rxcsum = <0x0>; -- xlnx,rxfifo = <0x1000>; -- xlnx,temac-type = <0x0>; -- xlnx,txcsum = <0x0>; -- xlnx,txfifo = <0x1000>; -- } ; -- } ; -- IIC_EEPROM: i2c@81600000 { -- compatible = "xlnx,xps-iic-2.00.a"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 6 2 >; -- reg = < 0x81600000 0x10000 >; -- xlnx,clk-freq = <0x7735940>; -- xlnx,family = "virtex5"; -- xlnx,gpo-width = <0x1>; -- xlnx,iic-freq = <0x186a0>; -- xlnx,scl-inertial-delay = <0x0>; -- xlnx,sda-inertial-delay = <0x0>; -- xlnx,ten-bit-adr = <0x0>; -- } ; -- LEDs_8Bit: gpio@81400000 { -+ }; -+ -+ gpio@81400000 { - compatible = "xlnx,xps-gpio-1.00.a"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 7 2 >; -- reg = < 0x81400000 0x10000 >; -+ interrupt-parent = <0x1>; -+ interrupts = <0x2 0x2>; -+ reg = <0x81400000 0x10000>; - xlnx,all-inputs = <0x0>; - xlnx,all-inputs-2 = <0x0>; - xlnx,dout-default = <0x0>; - xlnx,dout-default-2 = <0x0>; -- xlnx,family = "virtex5"; -+ xlnx,family = "spartan3adsp"; - xlnx,gpio-width = <0x8>; - xlnx,interrupt-present = <0x1>; -- xlnx,is-bidir = <0x1>; -+ xlnx,is-bidir = <0x0>; - xlnx,is-bidir-2 = <0x1>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xffffffff>; - xlnx,tri-default-2 = <0xffffffff>; -- #gpio-cells = <2>; -- gpio-controller; -- } ; -- -- gpio-leds { -- compatible = "gpio-leds"; -- -- heartbeat { -- label = "Heartbeat"; -- gpios = <&LEDs_8Bit 4 1>; -- linux,default-trigger = "heartbeat"; -- }; -- -- yellow { -- label = "Yellow"; -- gpios = <&LEDs_8Bit 5 1>; -- }; -- -- red { -- label = "Red"; -- gpios = <&LEDs_8Bit 6 1>; -- }; -- -- green { -- label = "Green"; -- gpios = <&LEDs_8Bit 7 1>; -- }; -- } ; -- RS232_Uart_1: serial@84000000 { -- clock-frequency = <125000000>; -+ }; -+ -+ serial@84000000 { -+ clock-frequency = <0x3b9aca0>; - compatible = "xlnx,xps-uartlite-1.00.a"; -- current-speed = <115200>; -+ current-speed = <0x1c200>; - device_type = "serial"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 8 0 >; -- port-number = <0>; -- reg = < 0x84000000 0x10000 >; -+ interrupt-parent = <0x1>; -+ interrupts = <0x3 0x0>; -+ port-number = <0x0>; -+ reg = <0x84000000 0x10000>; - xlnx,baudrate = <0x1c200>; - xlnx,data-bits = <0x8>; -- xlnx,family = "virtex5"; -+ xlnx,family = "spartan3adsp"; - xlnx,odd-parity = <0x0>; - xlnx,use-parity = <0x0>; -- } ; -- SysACE_CompactFlash: sysace@83600000 { -- compatible = "xlnx,xps-sysace-1.00.a"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 4 2 >; -- reg = < 0x83600000 0x10000 >; -- xlnx,family = "virtex5"; -- xlnx,mem-width = <0x10>; -- } ; -- debug_module: debug@84400000 { -+ }; -+ -+ debug@84400000 { - compatible = "xlnx,mdm-1.00.d"; -- reg = < 0x84400000 0x10000 >; -- xlnx,family = "virtex5"; -+ reg = <0x84400000 0x10000>; -+ xlnx,family = "spartan3adsp"; - xlnx,interconnect = <0x1>; - xlnx,jtag-chain = <0x2>; - xlnx,mb-dbg-ports = <0x1>; - xlnx,uart-width = <0x8>; - xlnx,use-uart = <0x1>; - xlnx,write-fsl-ports = <0x0>; -- } ; -+ }; -+ - mpmc@90000000 { -- #address-cells = <1>; -- #size-cells = <1>; -- compatible = "xlnx,mpmc-4.02.a"; -- ranges ; -- PIM3: sdma@84600180 { -- compatible = "xlnx,ll-dma-1.00.a"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 2 2 1 2 >; -- reg = < 0x84600180 0x80 >; -- } ; -- } ; -- xps_intc_0: interrupt-controller@81800000 { -+ #address-cells = <0x1>; -+ #size-cells = <0x1>; -+ compatible = "xlnx,mpmc-4.03.a"; -+ }; -+ -+ interrupt-controller@81800000 { - #interrupt-cells = <0x2>; - compatible = "xlnx,xps-intc-1.00.a"; -- interrupt-controller ; -- reg = < 0x81800000 0x10000 >; -- xlnx,kind-of-intr = <0x100>; -- xlnx,num-intr-inputs = <0x9>; -- } ; -- xps_timer_1: timer@83c00000 { -+ interrupt-controller; -+ reg = <0x81800000 0x10000>; -+ xlnx,kind-of-intr = <0xa>; -+ xlnx,num-intr-inputs = <0x4>; -+ linux,phandle = <0x1>; -+ }; -+ -+ timer@83c00000 { - compatible = "xlnx,xps-timer-1.00.a"; -- interrupt-parent = <&xps_intc_0>; -- interrupts = < 3 2 >; -- reg = < 0x83c00000 0x10000 >; -+ interrupt-parent = <0x1>; -+ interrupts = <0x0 0x2>; -+ reg = <0x83c00000 0x10000>; - xlnx,count-width = <0x20>; -- xlnx,family = "virtex5"; -+ xlnx,family = "spartan3adsp"; - xlnx,gen0-assert = <0x1>; - xlnx,gen1-assert = <0x1>; - xlnx,one-timer-only = <0x0>; - xlnx,trig0-assert = <0x1>; - xlnx,trig1-assert = <0x1>; -- } ; -- } ; --} ; -+ }; -+ }; -+}; diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile index 2cce6bebc..f647939b5 100644 --- a/toolchain/musl/Makefile +++ b/toolchain/musl/Makefile @@ -12,6 +12,9 @@ endif ifeq ($(CPU_ARCH),mips64el) REAL_GNU_TARGET_NAME:= $(subst mips64el,mips,$(REAL_GNU_TARGET_NAME)) endif +ifeq ($(CPU_ARCH),microblazeel) +REAL_GNU_TARGET_NAME:= $(subst microblazeel,microblaze,$(REAL_GNU_TARGET_NAME)) +endif $(WRKBUILD)/.headers: (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \ -- cgit v1.2.3 From 422fe42ea4a4f5c5f868736e17a0462e1e5c1c6b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 16 Dec 2013 13:11:33 +0100 Subject: small fixes for iso target --- target/config/Config.in | 1 + target/x86/Makefile | 2 +- tools/Makefile | 5 ++++- tools/syslinux/Makefile | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) (limited to 'target') diff --git a/target/config/Config.in b/target/config/Config.in index db04414de..99b056546 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -755,6 +755,7 @@ config ADK_TARGET_ROOTFS_ISO select ADK_KERNEL_SCSI select ADK_KERNEL_BLK_DEV_SR depends on ADK_HOST_LINUX + depends on ADK_LINUX_X86 help Use this option to create a bootable ISO image. diff --git a/target/x86/Makefile b/target/x86/Makefile index 87d3b5806..b228810c7 100644 --- a/target/x86/Makefile +++ b/target/x86/Makefile @@ -65,8 +65,8 @@ ifeq ($(ADK_HARDWARE_QEMU),y) @echo "Start qemu with following command line:" @echo 'qemu-system-i386 -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=e1000 -kernel $(BIN_DIR)/$(TARGET_KERNEL)' endif +endif ifeq (${ADK_TARGET_FS},iso) imageinstall: ${BIN_DIR}/${ROOTFSISO} @echo 'ISO image is at $<' endif -endif diff --git a/tools/Makefile b/tools/Makefile index 86eb09e22..4a5f1ec92 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -3,7 +3,10 @@ include $(TOPDIR)/rules.mk -TARGETS:=adk mkcrypt cpio mkimage genext2fs cdrtools syslinux +TARGETS:=adk mkcrypt cpio mkimage genext2fs +ifeq ($(ADK_TARGET_ROOTFS_ISO),y) +TARGETS+=cdrtools syslinux +endif TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS)) TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) diff --git a/tools/syslinux/Makefile b/tools/syslinux/Makefile index 2f44c301b..1ac6ef672 100644 --- a/tools/syslinux/Makefile +++ b/tools/syslinux/Makefile @@ -24,6 +24,7 @@ $(WRKBUILD)/.installed: ${WRKBUILD}/.compiled ${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}' \ INSTALLROOT='${WRKINST}' \ bios install + touch $@ ${TOOLS_DIR}/extlinux: $(WRKBUILD)/.installed $(INSTALL_BIN) ${WRKINST}/sbin/extlinux \ -- cgit v1.2.3 From 86534f8753b2dcac52f1ceb3bfc01ccca6697f80 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 17 Dec 2013 14:55:23 +0100 Subject: add dependency to bcm2835-vc, remove bcm2835-vc as default --- package/xbmc/Makefile | 2 +- target/arm/kernel.config | 57 ++++++++++++++++++++++++++++++++--- target/arm/sys-available/raspberry-pi | 1 - 3 files changed, 53 insertions(+), 7 deletions(-) (limited to 'target') diff --git a/package/xbmc/Makefile b/package/xbmc/Makefile index b4f96f47f..e0b509178 100644 --- a/package/xbmc/Makefile +++ b/package/xbmc/Makefile @@ -9,7 +9,7 @@ PKG_RELEASE:= 2 PKG_MD5SUM:= 489f3877decae4e265ece54f9eaef0ba PKG_DESCR:= software media player PKG_SECTION:= multimedia -PKG_DEPENDS:= boost libffmpeg python2 libstdcxx +PKG_DEPENDS:= boost libffmpeg python2 libstdcxx bcm2835-vc PKG_DEPENDS+= libglew mesalib libass libmpeg2 libmad dbus PKG_DEPENDS+= libjpeg libogg libvorbis libmodplug libcurl PKG_DEPENDS+= libflac libopenssl libbz2 libtiff liblzo diff --git a/target/arm/kernel.config b/target/arm/kernel.config index 7a4266c04..a702c270f 100644 --- a/target/arm/kernel.config +++ b/target/arm/kernel.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.11.5 Kernel Configuration +# Linux/arm 3.11.10 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -332,9 +332,6 @@ CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 # CONFIG_ARM_APPENDED_DTB is not set CONFIG_CMDLINE="" -# CONFIG_CMDLINE_FROM_BOOTLOADER is not set -CONFIG_CMDLINE_EXTEND=y -# CONFIG_CMDLINE_FORCE is not set # CONFIG_XIP_KERNEL is not set # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set @@ -810,7 +807,57 @@ CONFIG_TMPFS=y # CONFIG_CONFIGFS_FS is not set # CONFIG_MISC_FILESYSTEMS is not set # CONFIG_NETWORK_FILESYSTEMS is not set -# CONFIG_NLS is not set +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="utf8" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +# CONFIG_NLS_UTF8 is not set # # Kernel hacking diff --git a/target/arm/sys-available/raspberry-pi b/target/arm/sys-available/raspberry-pi index 9d743ed18..3fa60178e 100644 --- a/target/arm/sys-available/raspberry-pi +++ b/target/arm/sys-available/raspberry-pi @@ -14,7 +14,6 @@ config ADK_TARGET_SYSTEM_RASPBERRY_PI select ADK_TARGET_WITH_USB select ADK_TARGET_WITH_INPUT select ADK_PACKAGE_BCM2835_FIRMWARE - select ADK_PACKAGE_BCM2835_VC select ADK_TARGET_KERNEL_ZIMAGE help Raspberry PI -- cgit v1.2.3 From 081a0d8a8e175d92b4f0d86466f2ec68537bb868 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 17 Dec 2013 17:01:32 +0100 Subject: fix vfat support, use correct codepage and iocharset --- mk/kernel-ver.mk | 2 +- target/arm/kernel.config | 2 +- target/linux/config/Config.in.fs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'target') diff --git a/mk/kernel-ver.mk b/mk/kernel-ver.mk index 0cfc73006..e4c368af5 100644 --- a/mk/kernel-ver.mk +++ b/mk/kernel-ver.mk @@ -2,7 +2,7 @@ ifeq ($(ADK_KERNEL_VERSION_TOOLCHAIN),y) KERNEL_VERSION:= 3.11.10 KERNEL_MOD_VERSION:= $(KERNEL_VERSION) KERNEL_RELEASE:= 1 -KERNEL_MD5SUM:= edbf88eb7f7d34dbd5d3887726790755 +KERNEL_MD5SUM:= 59f352d3f4e2cdf6755f79e09fa09176 endif ifeq ($(ADK_KERNEL_VERSION_3_11_10),y) KERNEL_VERSION:= 3.11.10 diff --git a/target/arm/kernel.config b/target/arm/kernel.config index a702c270f..e477fcfb8 100644 --- a/target/arm/kernel.config +++ b/target/arm/kernel.config @@ -808,7 +808,7 @@ CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set # CONFIG_NETWORK_FILESYSTEMS is not set CONFIG_NLS=m -CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs index 9bdc6b9e5..10b2d7e1b 100644 --- a/target/linux/config/Config.in.fs +++ b/target/linux/config/Config.in.fs @@ -172,7 +172,8 @@ config ADK_KPACKAGE_KMOD_VFAT_FS prompt "kmod-vfat-fs...................... VFAT filesystem support" tristate select ADK_KPACKAGE_KMOD_NLS if !ADK_KERNEL_NLS - select ADK_KPACKAGE_KMOD_NLS_UTF8 + select ADK_KPACKAGE_KMOD_NLS_CODEPAGE_850 + select ADK_KPACKAGE_KMOD_NLS_ISO8859_1 select ADK_KERNEL_BLOCK default y if ADK_TARGET_WITH_MMC default n -- cgit v1.2.3 From b69cbbf603cf1a960fbdf6bfdf819df75c0a8efb Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 19 Dec 2013 11:49:01 +0100 Subject: build static binaries for transcend wifi sdcard --- target/arm/sys-available/keyasic-ka2000 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 target/arm/sys-available/keyasic-ka2000 (limited to 'target') diff --git a/target/arm/sys-available/keyasic-ka2000 b/target/arm/sys-available/keyasic-ka2000 new file mode 100644 index 000000000..d4ed74282 --- /dev/null +++ b/target/arm/sys-available/keyasic-ka2000 @@ -0,0 +1,16 @@ +config ADK_TARGET_SYSTEM_KEYASIC_KA2000 + bool "KeyASIC KA2000 (f.e. Transcend WifiSD)" + select ADK_arm + select ADK_little + select ADK_keyasic_ka2000 + select ADK_KERNEL_AEABI + select ADK_EABI + select ADK_CPU_ARMV5 + select ADK_TARGET_NO_FPU + select ADK_TOOLCHAIN + select ADK_STATIC + select BUSYBOX_STATIC + help + KeyASIC KA2000 aka Transcend WifiSD. + Build a toolchain only and make all binaries static. + -- cgit v1.2.3 From 320e16528ea6a9eba54bac0161e2331093075647 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 28 Dec 2013 17:30:22 +0100 Subject: convert microblaze to miniconfig kernel config generation, add support for squashfs and jffs2 rootfs for qemu-microblaze, add support for both machine emulations --- Config.in | 3 + TODO | 1 + mk/build.mk | 2 +- mk/image.mk | 47 +- mk/kernel-build.mk | 5 + mk/rootfs.mk | 2 + package/base-files/Makefile | 5 +- package/cfgfs/Makefile | 2 +- package/libstdcxx/Makefile | 24 +- rules.mk | 1 + target/Makefile | 10 + target/config/Config.in | 38 +- target/linux/Config.in | 1 - target/linux/config/Config.in.flash | 36 +- target/linux/config/Config.in.fs | 14 +- target/linux/config/Config.in.graphics | 2 - target/linux/config/Config.in.microblaze | 4 - target/linux/kernel.config | 41 + target/linux/patches/3.11.10/defaults.patch | 24 + .../patches/3.11.10/microblaze-ethernet.patch | 11 + target/microblaze/Makefile | 38 +- target/microblaze/kernel.config | 1337 -------------------- target/microblaze/kernel/qemu-microblaze-ml605 | 37 + .../microblaze/kernel/qemu-microblaze-s3adsp1800 | 34 + target/microblaze/ml605.dtb | Bin 0 -> 12839 bytes target/microblaze/ml605.dts | 399 ++++++ target/microblaze/sys-available/qemu-microblaze | 5 +- target/microblaze/sys-available/qemu-microblazeel | 5 +- target/tools/mtd-utils/Makefile | 24 + target/tools/mtd-utils/patches/lzo.patch | 80 ++ target/tools/squashfs/Makefile | 10 +- target/tools/squashfs/patches/cppflags.patch | 12 + target/tools/squashfs/patches/honour-cflags.patch | 11 - target/tools/squashfs/patches/squashfs-bsd.patch | 245 ---- target/tools/squashfs/patches/uClibc-compat.patch | 24 - target/tools/xz/Makefile | 28 + toolchain/eglibc/Makefile | 3 + 37 files changed, 891 insertions(+), 1674 deletions(-) delete mode 100644 target/linux/config/Config.in.microblaze create mode 100644 target/linux/kernel.config create mode 100644 target/linux/patches/3.11.10/microblaze-ethernet.patch delete mode 100644 target/microblaze/kernel.config create mode 100644 target/microblaze/kernel/qemu-microblaze-ml605 create mode 100644 target/microblaze/kernel/qemu-microblaze-s3adsp1800 create mode 100644 target/microblaze/ml605.dtb create mode 100644 target/microblaze/ml605.dts create mode 100644 target/tools/mtd-utils/Makefile create mode 100644 target/tools/mtd-utils/patches/lzo.patch create mode 100644 target/tools/squashfs/patches/cppflags.patch delete mode 100644 target/tools/squashfs/patches/honour-cflags.patch delete mode 100644 target/tools/squashfs/patches/squashfs-bsd.patch delete mode 100644 target/tools/squashfs/patches/uClibc-compat.patch create mode 100644 target/tools/xz/Makefile (limited to 'target') diff --git a/Config.in b/Config.in index e7a496e9c..268ea3558 100644 --- a/Config.in +++ b/Config.in @@ -91,6 +91,9 @@ source "package/Config.in.auto.global" source "package/Config.in.auto" endmenu +config ADK_USE_KERNEL_MINICONFIG + boolean + choice prompt "Kernel Version" depends on ADK_TOOLCHAIN_ONLY diff --git a/TODO b/TODO index f5b7ac867..0770a0771 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +- microblaze: add cfgfs partition to dts, add partition to spartan dts - use host-tools infrastructure for openjdk7 - remove openjdk6 - evaluate libguestfs for image creation diff --git a/mk/build.mk b/mk/build.mk index ad2d42b40..f20b4e59e 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -100,7 +100,7 @@ POSTCONFIG= -@\ touch .rebuild.busybox;\ rebuild=1;\ fi; \ - for i in ADK_RUNTIME_PASSWORD ADK_RUNTIME_TMPFS_SIZE ADK_RUNTIME_HOSTNAME ADK_TARGET_ROOTFS ADK_RUNTIME_CONSOLE;do \ + for i in ADK_RUNTIME_PASSWORD ADK_RUNTIME_TMPFS_SIZE ADK_RUNTIME_HOSTNAME ADK_TARGET_ROOTFS ADK_RUNTIME_CONSOLE ADK_TARGET_QEMU_MICROBLAZE_MODEL;do \ if [ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \ touch .rebuild.base-files;\ rebuild=1;\ diff --git a/mk/image.mk b/mk/image.mk index 7c519d7f5..79d6102c6 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -119,6 +119,7 @@ ifeq ($(ADK_HARDWARE_QEMU),y) TARGET_KERNEL= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_FS}-kernel INITRAMFS= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-${ADK_TARGET_FS} ROOTFSSQUASHFS= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.img +ROOTFSJFFS2= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-jffs2.img ROOTFSTARBALL= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}+kernel.tar.gz ROOTFSUSERTARBALL= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.gz ROOTFSISO= ${ADK_TARGET_SYSTEM}-$(CPU_ARCH)-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.iso @@ -126,6 +127,7 @@ else TARGET_KERNEL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_FS}-kernel INITRAMFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS} ROOTFSSQUASHFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.img +ROOTFSJFFS2= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-jffs2.img ROOTFSTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}+kernel.tar.gz ROOTFSUSERTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.gz ROOTFSISO= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.iso @@ -161,41 +163,76 @@ ${BIN_DIR}/${INITRAMFS}: ${BIN_DIR}/${INITRAMFS}_list ${BUILD_DIR}/root.squashfs: ${TARGET_DIR} ${STAGING_HOST_DIR}/bin/mksquashfs ${TARGET_DIR} \ - ${BUILD_DIR}/root.squashfs \ + ${BUILD_DIR}/root.squashfs -comp xz \ -nopad -noappend -root-owned $(MAKE_TRACE) +${BIN_DIR}/${ROOTFSJFFS2}: ${TARGET_DIR} + ${STAGING_HOST_DIR}/bin/mkfs.jffs2 $(ADK_JFFS2_OPTS) -q -r ${TARGET_DIR} \ + --pad=$(ADK_TARGET_MTD_SIZE) -o ${BIN_DIR}/${ROOTFSJFFS2} $(MAKE_TRACE) + createinitramfs: ${BIN_DIR}/${INITRAMFS}_list ${SED} 's/.*CONFIG_(BLK_DEV_INITRD|INITRAMFS_SOURCE|INITRAMFS_COMPRESSION).*//' \ ${LINUX_DIR}/.config ( \ echo "CONFIG_BLK_DEV_INITRD=y"; \ echo 'CONFIG_INITRAMFS_SOURCE="${BIN_DIR}/${INITRAMFS}_list"'; \ - echo 'CONFIG_INITRAMFS_COMPRESSION_NONE is not set' >> ${LINUX_DIR}/.config; \ + echo '# CONFIG_INITRAMFS_COMPRESSION_NONE is not set' >> ${LINUX_DIR}/.config; \ + echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> ${LINUX_DIR}/.config; \ + echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> ${LINUX_DIR}/.config; \ ) >> ${LINUX_DIR}/.config ifeq ($(ADK_KERNEL_COMP_XZ),y) + echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config echo "CONFIG_RD_XZ=y" >> ${LINUX_DIR}/.config echo "CONFIG_INITRAMFS_COMPRESSION_XZ=y" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_X86=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_POWERPC=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_IA64=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_ARM=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_ARMTHUMB=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_SPARC=n" >> ${LINUX_DIR}/.config + echo "CONFIG_XZ_DEC_TEST=n" >> ${LINUX_DIR}/.config endif ifeq ($(ADK_KERNEL_COMP_LZMA),y) + echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config echo "CONFIG_RD_LZMA=y" >> ${LINUX_DIR}/.config echo "CONFIG_INITRAMFS_COMPRESSION_LZMA=y" >> ${LINUX_DIR}/.config endif ifeq ($(ADK_KERNEL_COMP_LZO),y) + echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config echo "CONFIG_RD_LZO=y" >> ${LINUX_DIR}/.config echo "CONFIG_INITRAMFS_COMPRESSION_LZO=y" >> ${LINUX_DIR}/.config endif ifeq ($(ADK_KERNEL_COMP_GZIP),y) + echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config echo "CONFIG_RD_GZIP=y" >> ${LINUX_DIR}/.config echo "CONFIG_INITRAMFS_COMPRESSION_GZIP=y" >> ${LINUX_DIR}/.config endif ifeq ($(ADK_KERNEL_COMP_BZIP2),y) + echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config + echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config echo "CONFIG_RD_BZIP2=y" >> ${LINUX_DIR}/.config echo "CONFIG_INITRAMFS_COMPRESSION_BZIP2=y" >> ${LINUX_DIR}/.config endif @-rm $(LINUX_DIR)/usr/initramfs_data.cpio* 2>/dev/null - echo N | \ - $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH=$(ARCH) CC="$(TARGET_CC)" -j${ADK_MAKE_JOBS} oldconfig $(MAKE_TRACE) $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \ ARCH=$(ARCH) CC="$(TARGET_CC)" -j${ADK_MAKE_JOBS} $(ADK_TARGET_KERNEL) $(MAKE_TRACE) diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index 59a68eb88..8fe0799a0 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -35,8 +35,13 @@ $(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PK $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(TOPDIR)/mk/modules.mk $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-configure -for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done +ifeq ($(ADK_USE_KERNEL_MINICONFIG),y) + $(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/mini.config + ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE) +else $(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config echo N | ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} oldconfig $(MAKE_TRACE) +endif ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} prepare scripts $(MAKE_TRACE) touch -c $(LINUX_DIR)/.config diff --git a/mk/rootfs.mk b/mk/rootfs.mk index 18d4f83dc..3bbe31f25 100644 --- a/mk/rootfs.mk +++ b/mk/rootfs.mk @@ -9,6 +9,7 @@ endif endef ifeq ($(ADK_HARDWARE_QEMU),y) +MTDDEV:= root=/dev/mtdblock0 ifeq ($(ADK_TARGET_ROOTFS_ARCHIVE),y) ROOTFS:= root=/dev/sda1 endif @@ -50,6 +51,7 @@ $(eval $(call rootfs_template,initramfs,INITRAMFS)) $(eval $(call rootfs_template,initramfs-piggyback,INITRAMFS_PIGGYBACK)) $(eval $(call rootfs_template,squashfs,SQUASHFS,$(ROOTFS))) $(eval $(call rootfs_template,yaffs,YAFFS,$(MTDDEV) panic=3)) +$(eval $(call rootfs_template,jffs2,JFFS2,$(MTDDEV) rootfstype=jffs2)) $(eval $(call rootfs_template,nfsroot,NFSROOT,root=/dev/nfs ip=dhcp init=/init)) $(eval $(call rootfs_template,encrypted,ENCRYPTED)) $(eval $(call rootfs_template,iso,ISO)) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index d9b7878b3..7f68bad96 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -72,10 +72,7 @@ endif ifeq ($(ADK_TARGET_SYSTEM_QEMU_PPC64),y) $(SED) 's#ttyS#hvc#g' $(IDIR_BASE_FILES)/etc/inittab endif -ifeq ($(ADK_TARGET_SYSTEM_QEMU_MICROBLAZE),y) - $(SED) 's#ttyS#ttyUL#g' $(IDIR_BASE_FILES)/etc/inittab -endif -ifeq ($(ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL),y) +ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800),y) $(SED) 's#ttyS#ttyUL#g' $(IDIR_BASE_FILES)/etc/inittab endif $(SED) 's#@SPEED@#$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)#' $(IDIR_BASE_FILES)/etc/inittab diff --git a/package/cfgfs/Makefile b/package/cfgfs/Makefile index bea53dc64..a79bd73ca 100644 --- a/package/cfgfs/Makefile +++ b/package/cfgfs/Makefile @@ -15,7 +15,7 @@ PKG_CFLINE_CFGFS:= select BUSYBOX_DIFF@ PKG_CFLINE_CFGFS+= select BUSYBOX_MD5SUM@ PKG_CFLINE_CFGFS+= select BUSYBOX_XARGS@ PKG_CFLINE_CFGFS+= select BUSYBOX_FEATURE_SORT_BIG@ -PKG_CFLINE_CFGFS+= depends on !ADK_TARGET_ROOTFS_NFSROOT && !ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK && !ADK_TARGET_ROOTFS_INITRAMFS +PKG_CFLINE_CFGFS+= depends on !ADK_TARGET_ROOTFS_NFSROOT && !ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK && !ADK_TARGET_ROOTFS_INITRAMFS && !ADK_TARGET_ROOTFS_JFFS2 && !ADK_TARGET_ROOTFS_SQUASHFS PKG_DFLT_CFGFS:= y if !(ADK_TOOLCHAIN_ONLY || ADK_TOOLCHAIN_ARCHIVE) WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION} diff --git a/package/libstdcxx/Makefile b/package/libstdcxx/Makefile index b4e5c3b86..45c1edfc4 100644 --- a/package/libstdcxx/Makefile +++ b/package/libstdcxx/Makefile @@ -16,16 +16,20 @@ endif endif endif -PKG_NAME:= libstdcxx -PKG_DESCR:= C++ support library -PKG_SECTION:= libs -PKG_NEED_CXX:= 1 ifeq ($(ADK_LINUX_AVR32),y) -PKG_SUBVER:= 13 +LIBSTDCXX_VER:= 13 +else +ifeq ($(ADK_LINUX_MICROBLAZE),y) +LIBSTDCXX_VER:= 18 else -PKG_SUBVER:= 17 +LIBSTDCXX_VER:= 17 +endif endif +PKG_NAME:= libstdcxx +PKG_DESCR:= C++ support library +PKG_SECTION:= libs +PKG_NEED_CXX:= 1 NO_DISTFILES:= 1 include ${TOPDIR}/mk/package.mk @@ -41,10 +45,10 @@ do-install: ifeq ($(ADK_NATIVE),y) $(CP) /usr/lib/libstdc++.so* ${IDIR_LIBSTDCXX}/usr/lib else - (cd ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH}; ln -sf libstdc++.so.6.0.${PKG_SUBVER} libstdc++.so.6) - (cd ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH}; ln -sf libstdc++.so.6.0.${PKG_SUBVER} libstdc++.so) - (cd ${STAGING_TARGET_DIR}/${ADK_TARGET_LIBC_PATH}/; ln -sf libstdc++.so.6.0.${PKG_SUBVER} libstdc++.so) - $(CP) ${STAGING_TARGET_DIR}/${ADK_TARGET_LIBC_PATH}/libstdc++.so.6.0.${PKG_SUBVER} ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH} + (cd ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH}; ln -sf libstdc++.so.6.0.${LIBSTDCXX_VER} libstdc++.so.6) + (cd ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH}; ln -sf libstdc++.so.6.0.${LIBSTDCXX_VER} libstdc++.so) + (cd ${STAGING_TARGET_DIR}/${ADK_TARGET_LIBC_PATH}/; ln -sf libstdc++.so.6.0.${LIBSTDCXX_VER} libstdc++.so) + $(CP) ${STAGING_TARGET_DIR}/${ADK_TARGET_LIBC_PATH}/libstdc++.so.6.0.${LIBSTDCXX_VER} ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH} -@rm ${IDIR_LIBSTDCXX}/usr/${ADK_TARGET_LIBC_PATH}/libstdc++.so.*-gdb.py endif diff --git a/rules.mk b/rules.mk index f848d83ac..2d49a4b09 100644 --- a/rules.mk +++ b/rules.mk @@ -49,6 +49,7 @@ ADK_TOOLS_ADDPATTERN_ARGS:= $(strip $(subst ",, $(ADK_TOOLS_ADDPATTERN_ARGS))) ADK_KERNEL_VERSION:= $(strip $(subst ",, $(ADK_KERNEL_VERSION))) ADK_PARAMETER_NETCONSOLE_SRC_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_SRC_IP))) ADK_PARAMETER_NETCONSOLE_DST_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_DST_IP))) +ADK_JFFS2_OPTS:= $(strip $(subst ",, $(ADK_JFFS2_OPTS))) ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y) ifneq ($(strip $(wildcard $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk)),) diff --git a/target/Makefile b/target/Makefile index b8b92c960..562d2b86b 100644 --- a/target/Makefile +++ b/target/Makefile @@ -58,12 +58,22 @@ ifeq ($(ADK_NATIVE),y) else \ if [ -f /proc/config.gz ];then zcat /proc/config.gz > ${BUILD_DIR}/.kernelconfig.board; else cp ${ADK_TARGET}/kernel.config.$(ARCH) ${BUILD_DIR}/.kernelconfig.board; fi; \ fi +else +ifeq ($(ADK_USE_KERNEL_MINICONFIG),y) + @if [ -f ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} ];then \ + cat ${TOPDIR}/target/linux/kernel.config \ + ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} > ${BUILD_DIR}/.kernelconfig.board; \ + else \ + echo "no miniconfig found for target system"; \ + exit 1; \ + fi else @if [ -f ${ADK_TARGET_ARCH}/${KERNEL_CFG}.$(ADK_TARGET_SYSTEM) ];then \ cp ${ADK_TARGET_ARCH}/${KERNEL_CFG}.$(ADK_TARGET_SYSTEM) ${BUILD_DIR}/.kernelconfig.board; \ else \ cp ${ADK_TARGET_ARCH}/${KERNEL_CFG} ${BUILD_DIR}/.kernelconfig.board; \ fi +endif endif @(cat ${BUILD_DIR}/.kernelconfig.{modules,kernel} | \ while IFS='=' read symbol value; do \ diff --git a/target/config/Config.in b/target/config/Config.in index 99b056546..1e7afc323 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -36,6 +36,11 @@ config ADK_TARGET_ENDIAN default "little" if ADK_little default "big" if ADK_big +config ADK_JFFS2_OPTS + string + default "-l" if ADK_little + default "-b" if ADK_big + config ADK_TOOLCHAIN boolean @@ -143,7 +148,25 @@ config ADK_TARGET_LIBC_PATH # submodel support -# + +config ADK_TARGET_KERNEL_MINICONFIG + string + default "qemu-microblaze-s3adsp1800" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800 + default "qemu-microblaze-ml605" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 + +choice +prompt "Qemu MICROBLAZE Emulation" +depends on ADK_TARGET_SYSTEM_QEMU_MICROBLAZE || ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + +config ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 + boolean "Xilinx ml605" + select ADK_TARGET_WITH_MTD + +config ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800 + boolean "Xilinx Spartan S3ADSP1800" + +endchoice + choice prompt "Qemu ARM Emulation" depends on ADK_TARGET_SYSTEM_QEMU_ARM @@ -501,8 +524,8 @@ config ADK_TARGET_CMDLINE default "console=ttyS0,115200 console=tty0" if ADK_TARGET_SYSTEM_IBM_X40 default "console=ttyS0,115200 console=tty0" if ADK_TARGET_SYSTEM_INTEL_ATOM default "console=ttyS0,115200 console=tty0" if ADK_TARGET_SYSTEM_QEMU_I686 - default "console=ttyUL0" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE - default "console=ttyUL0" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default "console=ttyUL0" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800 + default "console=ttyS0,115200" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 default "console=ttyS0,115200 console=tty0" if ADK_TARGET_SYSTEM_VBOX_I686 default "console=ttyS0,115200 console=tty0" if ADK_TARGET_QEMU_ARM_MODEL_SPITZ default "console=ttyAMA0 console=tty0" if ADK_TARGET_QEMU_ARM_MODEL_VERSATILE @@ -680,6 +703,14 @@ config ADK_TARGET_ROOTFS_SQUASHFS help highly compressed read-only filesystem for MTD flash systems. +config ADK_TARGET_ROOTFS_JFFS2 + bool "Compressed read-write root filesystem (jffs2)" + select ADK_KERNEL_MISC_FILESYSTEMS + select ADK_KERNEL_JFFS2 + depends on ADK_TARGET_WITH_MTD + help + compressed read-write filesystem for MTD flash systems. + config ADK_TARGET_ROOTFS_YAFFS bool "YAFFS2 root filesystem (NAND)" select ADK_KERNEL_MISC_FILESYSTEMS @@ -762,6 +793,7 @@ config ADK_TARGET_ROOTFS_ISO config ADK_TARGET_ROOTFS_ARCHIVE bool "Archive usable for different filesystems" select ADK_KERNEL_EXT2_FS if ADK_HARDWARE_QEMU + depends on !ADK_LINUX_MICROBLAZE help Use this option if your root filesystem is ext2/ext3/ext4/xfs. diff --git a/target/linux/Config.in b/target/linux/Config.in index 79511489c..e4b81dd2f 100644 --- a/target/linux/Config.in +++ b/target/linux/Config.in @@ -18,7 +18,6 @@ source target/linux/config/Config.in.bluetooth source target/linux/config/Config.in.watchdog source target/linux/config/Config.in.leds source target/linux/config/Config.in.misc -source target/linux/config/Config.in.microblaze source target/linux/config/Config.in.mips source target/linux/config/Config.in.lib source target/linux/config/Config.in.pm diff --git a/target/linux/config/Config.in.flash b/target/linux/config/Config.in.flash index 091cb98a4..26f00845a 100644 --- a/target/linux/config/Config.in.flash +++ b/target/linux/config/Config.in.flash @@ -1,6 +1,10 @@ config ADK_KERNEL_MTD + select ADK_KERNEL_GENERIC_IO boolean +config ADK_KERNEL_GENERIC_IO + boolean + config ADK_KERNEL_MTD_MTDRAM boolean @@ -41,6 +45,9 @@ config ADK_KERNEL_MTD_GEN_PROBE config ADK_KERNEL_MTD_PHYSMAP boolean +config ADK_KERNEL_MTD_PHYSMAP_OF + boolean + config ADK_KERNEL_MTD_CFI_ADV_OPTIONS boolean @@ -57,16 +64,31 @@ config ADK_KERNEL_MTD_AR7_PARTS config ADK_KERNEL_MTD_CFI_INTELEXT boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default n config ADK_KERNEL_MTD_CFI_AMDSTD boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default n config ADK_KERNEL_MTD_CFI_STAA boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE + default n + +config ADK_KERNEL_MTD_OF_PARTS + boolean + default n + +config ADK_KERNEL_MTD_M25P80 + boolean + default y if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 default n config ADK_KERNEL_MTD_AR2315 @@ -78,6 +100,7 @@ config ADK_KERNEL_MTD_AR2315 config ADK_TARGET_NAND boolean + select ADK_KERNEL_BLOCK select ADK_KERNEL_MISC_FILESYSTEMS select ADK_KERNEL_YAFFS_FS select ADK_KERNEL_YAFFS_YAFFS2 @@ -88,22 +111,31 @@ config ADK_TARGET_NAND select ADK_KERNEL_MTD_NAND_PLATFORM select ADK_KERNEL_MTD_CHAR select ADK_KERNEL_MTD_BLKDEVS - select ADK_KERNEL_BLOCK select ADK_KERNEL_MTD_BLOCK default y if ADK_TARGET_WITH_NAND default n config ADK_TARGET_MTD boolean + select ADK_KERNEL_BLOCK + select ADK_KERNEL_MISC_FILESYSTEMS + select ADK_KERNEL_JFFS2_FS select ADK_KERNEL_MTD select ADK_KERNEL_MTD_PARTITIONS select ADK_KERNEL_MTD_CHAR select ADK_KERNEL_MTD_BLKDEVS - select ADK_KERNEL_BLOCK select ADK_KERNEL_MTD_BLOCK select ADK_KERNEL_MTD_ROOTFS_ROOT_DEV select ADK_KERNEL_MTD_CFI select ADK_KERNEL_MTD_GEN_PROBE select ADK_KERNEL_MTD_PHYSMAP + select ADK_KERNEL_MTD_PHYSMAP_OF if ADK_LINUX_MICROBLAZE + select ADK_KERNEL_MTD_OF_PARTS if ADK_LINUX_MICROBLAZE default y if ADK_TARGET_WITH_MTD default n + +config ADK_TARGET_MTD_SIZE + int + default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE + default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default "" diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs index 10b2d7e1b..a764e7491 100644 --- a/target/linux/config/Config.in.fs +++ b/target/linux/config/Config.in.fs @@ -1,5 +1,8 @@ menu "Filesystems support" +config ADK_KERNEL_MISC_FILESYSTEMS + boolean + config ADK_KERNEL_FSNOTIFY boolean default y @@ -8,6 +11,9 @@ config ADK_KERNEL_EXPORTFS boolean default y +config ADK_KERNEL_JFFS2_FS + boolean + config ADK_KERNEL_YAFFS_FS tristate @@ -27,9 +33,6 @@ config ADK_KERNEL_YAFFS_CHECKPOINT_RESERVED_BLOCKS config ADK_KERNEL_YAFFS_SHORT_NAMES_IN_RAM boolean -config ADK_KERNEL_MISC_FILESYSTEMS - boolean - config ADK_KERNEL_DNOTIFY boolean @@ -44,10 +47,15 @@ config ADK_KERNEL_FAT_DEFAULT_IOCHARSET string default "iso8859-1" +config ADK_KERNEL_SQUASHFS_XZ + boolean + default n + config ADK_KERNEL_SQUASHFS prompt "squashfs.......................... SquashFS filesystem" boolean select ADK_KERNEL_MISC_FILESYSTEMS + select ADK_KERNEL_SQUASHFS_XZ default n config ADK_KERNEL_EXT2_FS diff --git a/target/linux/config/Config.in.graphics b/target/linux/config/Config.in.graphics index 75c05449f..af28b91d7 100644 --- a/target/linux/config/Config.in.graphics +++ b/target/linux/config/Config.in.graphics @@ -1,6 +1,5 @@ config ADK_KERNEL_VT boolean - default y if ADK_HARDWARE_QEMU default y if ADK_HARDWARE_VBOX default y if ADK_TARGET_WITH_VGA default y if ADK_NATIVE_SYSTEM_IBM_X40 @@ -9,7 +8,6 @@ config ADK_KERNEL_VT config ADK_KERNEL_VT_CONSOLE boolean - default y if ADK_HARDWARE_QEMU default y if ADK_HARDWARE_VBOX default y if ADK_TARGET_WITH_VGA default y if ADK_NATIVE_SYSTEM_IBM_X40 diff --git a/target/linux/config/Config.in.microblaze b/target/linux/config/Config.in.microblaze deleted file mode 100644 index 5a6764250..000000000 --- a/target/linux/config/Config.in.microblaze +++ /dev/null @@ -1,4 +0,0 @@ -config ADK_KERNEL_OPT_LIB_ASM - default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE - default n - boolean diff --git a/target/linux/kernel.config b/target/linux/kernel.config new file mode 100644 index 000000000..8bf3aafe6 --- /dev/null +++ b/target/linux/kernel.config @@ -0,0 +1,41 @@ +CONFIG_DEFAULT_HOSTNAME="openadk" +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="" +CONFIG_MMU=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_INET=y +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_EMBEDDED=y +CONFIG_MODULES=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_SCRIPT=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_NO_HZ=y +CONFIG_PRINTK=y +CONFIG_BUG=n +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_PCI_QUIRKS=y +CONFIG_TTY=y +CONFIG_UNIX98_PTYS=y +CONFIG_PRINTK_TIME=y +CONFIG_EARLY_PRINTK=y diff --git a/target/linux/patches/3.11.10/defaults.patch b/target/linux/patches/3.11.10/defaults.patch index 58aae610b..6cdca084e 100644 --- a/target/linux/patches/3.11.10/defaults.patch +++ b/target/linux/patches/3.11.10/defaults.patch @@ -20,3 +20,27 @@ diff -Nur linux-3.0.4.orig/fs/notify/Kconfig linux-3.0.4/fs/notify/Kconfig source "fs/notify/dnotify/Kconfig" source "fs/notify/inotify/Kconfig" +diff -Nur linux-3.11.10.orig/drivers/scsi/Kconfig linux-3.11.10/drivers/scsi/Kconfig +--- linux-3.11.10.orig/drivers/scsi/Kconfig 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/drivers/scsi/Kconfig 2013-12-27 19:13:21.000000000 +0100 +@@ -2,7 +2,7 @@ + + config SCSI_MOD + tristate +- default y if SCSI=n || SCSI=y ++ default y if SCSI=y + default m if SCSI=m + + config RAID_ATTRS +diff -Nur linux-3.11.10.orig/usr/Kconfig linux-3.11.10/usr/Kconfig +--- linux-3.11.10.orig/usr/Kconfig 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/usr/Kconfig 2013-12-27 19:15:16.000000000 +0100 +@@ -47,7 +47,7 @@ + + config RD_GZIP + bool "Support initial ramdisks compressed using gzip" if EXPERT +- default y ++ default n + depends on BLK_DEV_INITRD + select DECOMPRESS_GZIP + help diff --git a/target/linux/patches/3.11.10/microblaze-ethernet.patch b/target/linux/patches/3.11.10/microblaze-ethernet.patch new file mode 100644 index 000000000..742ab477e --- /dev/null +++ b/target/linux/patches/3.11.10/microblaze-ethernet.patch @@ -0,0 +1,11 @@ +diff -Nur linux-3.11.10.orig/drivers/net/ethernet/xilinx/xilinx_emaclite.c linux-3.11.10/drivers/net/ethernet/xilinx/xilinx_emaclite.c +--- linux-3.11.10.orig/drivers/net/ethernet/xilinx/xilinx_emaclite.c 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/drivers/net/ethernet/xilinx/xilinx_emaclite.c 2013-12-23 20:01:14.000000000 +0100 +@@ -1282,6 +1282,7 @@ + { .compatible = "xlnx,opb-ethernetlite-1.01.b", }, + { .compatible = "xlnx,xps-ethernetlite-1.00.a", }, + { .compatible = "xlnx,xps-ethernetlite-2.00.a", }, ++ { .compatible = "xlnx,xps-ethernetlite-2.00.b", }, + { .compatible = "xlnx,xps-ethernetlite-2.01.a", }, + { .compatible = "xlnx,xps-ethernetlite-3.00.a", }, + { /* end of list */ }, diff --git a/target/microblaze/Makefile b/target/microblaze/Makefile index 3ff728627..e4c98ed6d 100644 --- a/target/microblaze/Makefile +++ b/target/microblaze/Makefile @@ -9,16 +9,36 @@ include $(TOPDIR)/mk/image.mk KERNEL:=$(LINUX_DIR)/arch/microblaze/boot/$(ADK_TARGET_KERNEL) -ifeq ($(ADK_TARGET_FS),archive) -imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL) - @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)" +tools-compile: + $(MAKE) -C ../tools/mtd-utils all + $(MAKE) -C ../tools/xz all + $(MAKE) -C ../tools/squashfs all + +ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605),y) +MODEL:=petalogix-ml605 +DTB:=-dtb target/microblaze/ml605.dtb +endif +ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800),y) +MODEL:=petalogix-s3adsp1800 +DTB:= +endif + +ifeq ($(ADK_TARGET_FS),squashfs) +imageinstall: tools-compile $(BUILD_DIR)/root.squashfs + qemu-img create -f raw $(BIN_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE) + dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(BIN_DIR)/$(ROOTFSSQUASHFS) + @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL) ifneq ($(ADK_HARDWARE_QEMU),) + @echo "Start qemu with following options:" + @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -pflash $(BIN_DIR)/$(ROOTFSSQUASHFS)' +endif +endif +ifeq ($(ADK_TARGET_FS),jffs2) +imageinstall: tools-compile $(BIN_DIR)/$(ROOTFSJFFS2) @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL) - @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}' - @echo "Use following command to create a QEMU Image:" - @echo "./scripts/create.sh +g qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)" +ifneq ($(ADK_HARDWARE_QEMU),) @echo "Start qemu with following options:" - @echo 'qemu-system-${CPU_ARCH} -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img' + @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -pflash $(BIN_DIR)/$(ROOTFSJFFS2)' endif endif ifeq ($(ADK_TARGET_FS),initramfs) @@ -28,7 +48,7 @@ imageinstall: $(BIN_DIR)/$(INITRAMFS) @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}' ifneq ($(ADK_HARDWARE_QEMU),) @echo "Start qemu with following command line:" - @echo 'qemu-system-${CPU_ARCH} -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}' + @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}' endif endif ifeq ($(ADK_TARGET_FS),initramfs-piggyback) @@ -37,6 +57,6 @@ imageinstall: createinitramfs @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}' ifneq ($(ADK_HARDWARE_QEMU),) @echo "Start qemu with following command line:" - @echo 'qemu-system-${CPU_ARCH} -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL)' + @echo 'qemu-system-${CPU_ARCH} $(DTB) -M $(MODEL) -nographic -kernel $(BIN_DIR)/$(TARGET_KERNEL)' endif endif diff --git a/target/microblaze/kernel.config b/target/microblaze/kernel.config deleted file mode 100644 index ffea9e904..000000000 --- a/target/microblaze/kernel.config +++ /dev/null @@ -1,1337 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/microblaze 3.11.10 Kernel Configuration -# -CONFIG_MICROBLAZE=y -# CONFIG_SWAP is not set -CONFIG_RWSEM_GENERIC_SPINLOCK=y -CONFIG_ZONE_DMA=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_CSUM=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y - -# -# General setup -# -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -# CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_DEFAULT_HOSTNAME="openadk" -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_FHANDLE is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_GENERIC_HARDIRQS=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_HARDIRQS=y -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_IRQ_DOMAIN=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y - -# -# Timers subsystem -# -CONFIG_HZ_PERIODIC=y -# CONFIG_NO_HZ_IDLE is not set -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_TINY_RCU=y -# CONFIG_PREEMPT_RCU is not set -# CONFIG_RCU_STALL_COMMON is not set -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=17 -# CONFIG_CGROUPS is not set -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_NAMESPACES is not set -CONFIG_UIDGID_CONVERTED=y -# CONFIG_UIDGID_STRICT_TYPE_CHECKS is not set -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_RELAY is not set -# CONFIG_BLK_DEV_INITRD is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_EXPERT=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y -CONFIG_PRINTK=y -CONFIG_BUG=y -# CONFIG_BASE_FULL is not set -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_PCI_QUIRKS=y -CONFIG_EMBEDDED=y - -# -# Kernel Performance Events And Counters -# -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_COMPAT_BRK is not set -CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_CLONE_BACKWARDS3=y - -# -# GCOV-based kernel profiling -# -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=1 -CONFIG_MODULES=y -# CONFIG_MODULE_FORCE_LOAD is not set -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_MODULE_SIG is not set -# CONFIG_BLOCK is not set -CONFIG_UNINLINE_SPIN_UNLOCK=y -# CONFIG_FREEZER is not set - -# -# Platform options -# -CONFIG_PLATFORM_GENERIC=y -CONFIG_OPT_LIB_FUNCTION=y -# CONFIG_OPT_LIB_ASM is not set - -# -# Definitions for MICROBLAZE0 -# -CONFIG_KERNEL_BASE_ADDR=0x90000000 -CONFIG_XILINX_MICROBLAZE0_FAMILY="spartan3adsp" -CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 -CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 -CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1 -CONFIG_XILINX_MICROBLAZE0_USE_DIV=0 -CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=1 -CONFIG_XILINX_MICROBLAZE0_USE_FPU=0 -CONFIG_XILINX_MICROBLAZE0_HW_VER="7.10.d" - -# -# Processor type and features -# -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_HZ_100=y -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=100 -# CONFIG_SCHED_HRTICK is not set -CONFIG_MMU=y - -# -# Boot options -# -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="" -CONFIG_CMDLINE_FORCE=y -# CONFIG_SECCOMP is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_HIGHMEM=y -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_MANUAL_RESET_VECTOR=0x0 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_TASK_SIZE=0x80000000 -CONFIG_KERNEL_PAD=0x80000 -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MEMBLOCK_NODE_MAP=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=999999 -# CONFIG_COMPACTION is not set -# CONFIG_PHYS_ADDR_T_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_VIRT_TO_BUS=y -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -# CONFIG_CROSS_MEMORY_ATTACH is not set -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_CLEANCACHE is not set -# CONFIG_ZBUD is not set - -# -# Executable file formats -# -CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_SCRIPT=y -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -# CONFIG_COREDUMP is not set - -# -# Bus Options -# -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_SYSCALL=y -CONFIG_PCI_XILINX=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_IOV is not set -# CONFIG_PCI_PRI is not set -# CONFIG_PCI_PASID is not set - -# -# PCI host controller drivers -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -# CONFIG_XFRM_USER is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_PNP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_LRO is not set -# CONFIG_INET_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -# CONFIG_BRIDGE is not set -CONFIG_HAVE_NET_DSA=y -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -# CONFIG_NETLINK_MMAP is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_NET_MPLS_GSO is not set -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -CONFIG_WIRELESS=y -# CONFIG_CFG80211 is not set -# CONFIG_LIB80211 is not set - -# -# CFG80211 needs to be enabled for MAC80211 -# -# CONFIG_WIMAX is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_STANDALONE=y -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -CONFIG_GENERIC_CPU_DEVICES=y -# CONFIG_DMA_SHARED_BUFFER is not set - -# -# Bus devices -# -# CONFIG_CONNECTOR is not set -# CONFIG_MTD is not set -CONFIG_DTC=y -CONFIG_OF=y - -# -# Device Tree and Open Firmware support -# -CONFIG_PROC_DEVICETREE=y -# CONFIG_OF_SELFTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_I2C=y -CONFIG_OF_NET=y -CONFIG_OF_MDIO=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -# CONFIG_PARPORT is not set - -# -# Misc devices -# -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_PHANTOM is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ATMEL_SSC is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1780 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_BMP085_I2C is not set -# CONFIG_BMP085_SPI is not set -# CONFIG_PCH_PHUB is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_AT25 is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set -# CONFIG_CB710_CORE is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_TI_ST is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_SCSI_DMA is not set -# CONFIG_SCSI_NETLINK is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# CONFIG_I2O is not set -CONFIG_NETDEVICES=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -# CONFIG_DUMMY is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_VXLAN is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -# CONFIG_NLMON is not set -# CONFIG_ARCNET is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6060 is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -CONFIG_ETHERNET=y -CONFIG_NET_VENDOR_3COM=y -# CONFIG_VORTEX is not set -# CONFIG_TYPHOON is not set -CONFIG_NET_VENDOR_ADAPTEC=y -# CONFIG_ADAPTEC_STARFIRE is not set -CONFIG_NET_VENDOR_ALTEON=y -# CONFIG_ACENIC is not set -CONFIG_NET_VENDOR_AMD=y -# CONFIG_AMD8111_ETH is not set -# CONFIG_PCNET32 is not set -CONFIG_NET_VENDOR_ARC=y -# CONFIG_ARC_EMAC is not set -CONFIG_NET_VENDOR_ATHEROS=y -# CONFIG_ATL2 is not set -# CONFIG_ATL1 is not set -# CONFIG_ATL1E is not set -# CONFIG_ATL1C is not set -# CONFIG_ALX is not set -CONFIG_NET_CADENCE=y -# CONFIG_ARM_AT91_ETHER is not set -# CONFIG_MACB is not set -CONFIG_NET_VENDOR_BROADCOM=y -# CONFIG_B44 is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2X is not set -CONFIG_NET_VENDOR_BROCADE=y -# CONFIG_BNA is not set -# CONFIG_NET_CALXEDA_XGMAC is not set -CONFIG_NET_VENDOR_CHELSIO=y -# CONFIG_CHELSIO_T1 is not set -# CONFIG_CHELSIO_T3 is not set -# CONFIG_CHELSIO_T4 is not set -# CONFIG_CHELSIO_T4VF is not set -CONFIG_NET_VENDOR_CISCO=y -# CONFIG_ENIC is not set -# CONFIG_DNET is not set -CONFIG_NET_VENDOR_DEC=y -# CONFIG_NET_TULIP is not set -CONFIG_NET_VENDOR_DLINK=y -# CONFIG_DL2K is not set -# CONFIG_SUNDANCE is not set -CONFIG_NET_VENDOR_EMULEX=y -# CONFIG_BE2NET is not set -CONFIG_NET_VENDOR_EXAR=y -# CONFIG_S2IO is not set -# CONFIG_VXGE is not set -CONFIG_NET_VENDOR_HP=y -# CONFIG_HP100 is not set -CONFIG_NET_VENDOR_INTEL=y -# CONFIG_E100 is not set -# CONFIG_E1000 is not set -# CONFIG_E1000E is not set -# CONFIG_IGB is not set -# CONFIG_IGBVF is not set -# CONFIG_IXGB is not set -# CONFIG_IXGBE is not set -CONFIG_NET_VENDOR_I825XX=y -# CONFIG_IP1000 is not set -# CONFIG_JME is not set -CONFIG_NET_VENDOR_MARVELL=y -# CONFIG_MVMDIO is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -CONFIG_NET_VENDOR_MELLANOX=y -# CONFIG_MLX4_EN is not set -# CONFIG_MLX4_CORE is not set -CONFIG_NET_VENDOR_MICREL=y -# CONFIG_KS8851 is not set -# CONFIG_KS8851_MLL is not set -# CONFIG_KSZ884X_PCI is not set -CONFIG_NET_VENDOR_MICROCHIP=y -# CONFIG_ENC28J60 is not set -CONFIG_NET_VENDOR_MYRI=y -# CONFIG_MYRI10GE is not set -# CONFIG_FEALNX is not set -CONFIG_NET_VENDOR_NATSEMI=y -# CONFIG_NATSEMI is not set -# CONFIG_NS83820 is not set -CONFIG_NET_VENDOR_8390=y -# CONFIG_NE2K_PCI is not set -CONFIG_NET_VENDOR_NVIDIA=y -# CONFIG_FORCEDETH is not set -CONFIG_NET_VENDOR_OKI=y -# CONFIG_ETHOC is not set -CONFIG_NET_PACKET_ENGINE=y -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -CONFIG_NET_VENDOR_QLOGIC=y -# CONFIG_QLA3XXX is not set -# CONFIG_QLCNIC is not set -# CONFIG_QLGE is not set -# CONFIG_NETXEN_NIC is not set -CONFIG_NET_VENDOR_REALTEK=y -# CONFIG_8139CP is not set -# CONFIG_8139TOO is not set -# CONFIG_R8169 is not set -# CONFIG_SH_ETH is not set -CONFIG_NET_VENDOR_RDC=y -# CONFIG_R6040 is not set -CONFIG_NET_VENDOR_SEEQ=y -CONFIG_NET_VENDOR_SILAN=y -# CONFIG_SC92031 is not set -CONFIG_NET_VENDOR_SIS=y -# CONFIG_SIS900 is not set -# CONFIG_SIS190 is not set -# CONFIG_SFC is not set -CONFIG_NET_VENDOR_SMSC=y -# CONFIG_EPIC100 is not set -# CONFIG_SMSC911X is not set -# CONFIG_SMSC9420 is not set -CONFIG_NET_VENDOR_STMICRO=y -# CONFIG_STMMAC_ETH is not set -CONFIG_NET_VENDOR_SUN=y -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NIU is not set -CONFIG_NET_VENDOR_TEHUTI=y -# CONFIG_TEHUTI is not set -CONFIG_NET_VENDOR_TI=y -# CONFIG_TLAN is not set -CONFIG_NET_VENDOR_VIA=y -# CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set -CONFIG_NET_VENDOR_WIZNET=y -# CONFIG_WIZNET_W5100 is not set -# CONFIG_WIZNET_W5300 is not set -CONFIG_NET_VENDOR_XILINX=y -CONFIG_XILINX_EMACLITE=y -# CONFIG_XILINX_AXI_EMAC is not set -CONFIG_XILINX_LL_TEMAC=y -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_AT803X_PHY is not set -# CONFIG_AMD_PHY is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_STE10XP is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_FIXED_PHY is not set -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -CONFIG_WLAN=y -# CONFIG_ATMEL is not set -# CONFIG_PRISM54 is not set -# CONFIG_HOSTAP is not set -# CONFIG_WL_TI is not set - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_VMXNET3 is not set -# CONFIG_ISDN is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_NOZOMI is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -# CONFIG_DEVKMEM is not set - -# -# Serial drivers -# -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_DW is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_MFD_HSU is not set -CONFIG_SERIAL_UARTLITE=y -CONFIG_SERIAL_UARTLITE_CONSOLE=y -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_OF_PLATFORM is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_TIMBERDALE is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_PCH_UART is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set -CONFIG_XILINX_HWICAP=y -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# PCMCIA character devices -# -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -# CONFIG_BRCM_CHAR_DRIVERS is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -# CONFIG_I2C_CHARDEV is not set -# CONFIG_I2C_MUX is not set -CONFIG_I2C_HELPER_AUTO=y - -# -# I2C Hardware Bus support -# - -# -# PC SMBus host controller drivers -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PCI is not set -# CONFIG_I2C_EG20T is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_SIMTEC is not set -CONFIG_I2C_XILINX=y - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_TAOS_EVM is not set - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_ALTERA is not set -CONFIG_SPI_BITBANG=y -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_PXA2XX is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_TOPCLIFF_PCH is not set -# CONFIG_SPI_XCOMM is not set -CONFIG_SPI_XILINX=y -# CONFIG_SPI_DESIGNWARE is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -CONFIG_GPIO_DEVRES=y -CONFIG_GPIOLIB=y -CONFIG_OF_GPIO=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers: -# -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_TS5500 is not set -CONFIG_GPIO_XILINX=y -# CONFIG_GPIO_VX855 is not set -# CONFIG_GPIO_GRGPIO is not set - -# -# I2C GPIO expanders: -# -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_SX150X is not set -# CONFIG_GPIO_ADP5588 is not set -# CONFIG_GPIO_ADNP is not set - -# -# PCI GPIO expanders: -# -# CONFIG_GPIO_BT8XX is not set -# CONFIG_GPIO_AMD8111 is not set -# CONFIG_GPIO_ML_IOH is not set -# CONFIG_GPIO_RDC321X is not set - -# -# SPI GPIO expanders: -# -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_74X164 is not set - -# -# AC97 GPIO expanders: -# - -# -# MODULbus GPIO expanders: -# - -# -# USB GPIO expanders: -# -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_POWER_AVS is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_CORE is not set -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_I6300ESB_WDT is not set -CONFIG_XILINX_WATCHDOG=y -# CONFIG_MEN_A21_WDT is not set - -# -# PCI-based Watchdog Cards -# -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_LPC_ICH is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RTSX_PCI is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TIMBERDALE is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_REGULATOR is not set -# CONFIG_MEDIA_SUPPORT is not set - -# -# Graphics support -# -# CONFIG_VGA_ARB is not set -# CONFIG_DRM is not set -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set -# CONFIG_EXYNOS_VIDEO is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_SOUND is not set -# CONFIG_USB_SUPPORT is not set -# CONFIG_UWB is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_INFINIBAND is not set -# CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_AUXDISPLAY is not set -CONFIG_UIO=y -# CONFIG_UIO_CIF is not set -CONFIG_UIO_PDRV=y -CONFIG_UIO_PDRV_GENIRQ=y -CONFIG_UIO_DMEM_GENIRQ=y -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -# CONFIG_UIO_PCI_GENERIC is not set -# CONFIG_UIO_NETX is not set -# CONFIG_VIRT_DRIVERS is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -# CONFIG_STAGING is not set - -# -# Hardware Spinlock drivers -# -# CONFIG_MAILBOX is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_OF_IOMMU=y - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_VME_BUS is not set -# CONFIG_PWM is not set -CONFIG_IRQCHIP=y -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_FMC is not set - -# -# File systems -# -# CONFIG_FS_POSIX_ACL is not set -CONFIG_EXPORTFS=y -CONFIG_FILE_LOCKING=y -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -CONFIG_FANOTIFY=y -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -# CONFIG_PROC_KCORE is not set -CONFIG_PROC_SYSCTL=y -# CONFIG_PROC_PAGE_MONITOR is not set -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_TMPFS_XATTR is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set -# CONFIG_MISC_FILESYSTEMS is not set -# CONFIG_NETWORK_FILESYSTEMS is not set -# CONFIG_NLS is not set - -# -# Kernel hacking -# -CONFIG_TRACE_IRQFLAGS_SUPPORT=y - -# -# printk and dmesg options -# -# CONFIG_PRINTK_TIME is not set -CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 -# CONFIG_BOOT_PRINTK_DELAY is not set - -# -# Compile-time checks and compiler options -# -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y - -# -# Memory Debugging -# -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_SLAB is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_HIGHMEM is not set -# CONFIG_DEBUG_SHIRQ is not set - -# -# Debug Lockups and Hangs -# -# CONFIG_LOCKUP_DETECTOR is not set -CONFIG_DETECT_HUNG_TASK=y -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 -# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set -CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set - -# -# Lock Debugging (spinlocks, mutexes, etc...) -# -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -CONFIG_DEBUG_SPINLOCK=y -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set - -# -# RCU Debugging -# -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_LATENCYTOP is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set - -# -# Runtime Testing -# -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -CONFIG_EARLY_PRINTK=y -# CONFIG_HEART_BEAT is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_PCOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_CRC32 is not set -# CONFIG_CRYPTO_GHASH is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_SHA1 is not set -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_ZLIB is not set -# CONFIG_CRYPTO_LZO is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_GENERIC_NET_UTILS=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=y -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set -# CONFIG_CRC32 is not set -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -# CONFIG_XZ_DEC is not set -# CONFIG_XZ_DEC_BCJ is not set -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_DQL=y -CONFIG_NLATTR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -# CONFIG_AVERAGE is not set -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set diff --git a/target/microblaze/kernel/qemu-microblaze-ml605 b/target/microblaze/kernel/qemu-microblaze-ml605 new file mode 100644 index 000000000..7ae56f8c5 --- /dev/null +++ b/target/microblaze/kernel/qemu-microblaze-ml605 @@ -0,0 +1,37 @@ +CONFIG_PLATFORM_GENERIC=y +CONFIG_OPT_LIB_FUNCTION=y +CONFIG_KERNEL_BASE_ADDR=0x50000000 +CONFIG_XILINX_MICROBLAZE0_FAMILY="virtex6" +CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1 +CONFIG_XILINX_MICROBLAZE0_USE_DIV=1 +CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2 +CONFIG_XILINX_MICROBLAZE0_USE_FPU=1 +CONFIG_XILINX_MICROBLAZE0_HW_VER="8.10.a" +CONFIG_CMDLINE_FORCE=y +CONFIG_PCI=y +CONFIG_PCI_XILINX=y +CONFIG_DTC=y +CONFIG_OF=y +CONFIG_PROC_DEVICETREE=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_XILINX=y +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +CONFIG_ETHERNET=y +CONFIG_NET_VENDOR_XILINX=y +CONFIG_XILINX_AXI_EMAC=y +CONFIG_GPIOLIB=y +CONFIG_OF_GPIO=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_XILINX=y diff --git a/target/microblaze/kernel/qemu-microblaze-s3adsp1800 b/target/microblaze/kernel/qemu-microblaze-s3adsp1800 new file mode 100644 index 000000000..652b68c03 --- /dev/null +++ b/target/microblaze/kernel/qemu-microblaze-s3adsp1800 @@ -0,0 +1,34 @@ +CONFIG_PLATFORM_GENERIC=y +CONFIG_OPT_LIB_FUNCTION=y +CONFIG_KERNEL_BASE_ADDR=0x90000000 +CONFIG_XILINX_MICROBLAZE0_FAMILY="spartan3adsp" +CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1 +CONFIG_XILINX_MICROBLAZE0_USE_DIV=0 +CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=1 +CONFIG_XILINX_MICROBLAZE0_USE_FPU=0 +CONFIG_XILINX_MICROBLAZE0_HW_VER="7.10.d" +CONFIG_CMDLINE_FORCE=y +CONFIG_PCI=y +CONFIG_PCI_XILINX=y +CONFIG_DTC=y +CONFIG_OF=y +CONFIG_PROC_DEVICETREE=y +CONFIG_SERIAL_UARTLITE=y +CONFIG_SERIAL_UARTLITE_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_XILINX=y +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +CONFIG_ETHERNET=y +CONFIG_NET_VENDOR_XILINX=y +CONFIG_XILINX_EMACLITE=y +CONFIG_GPIOLIB=y +CONFIG_OF_GPIO=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_XILINX=y diff --git a/target/microblaze/ml605.dtb b/target/microblaze/ml605.dtb new file mode 100644 index 000000000..aaa7fb2b1 Binary files /dev/null and b/target/microblaze/ml605.dtb differ diff --git a/target/microblaze/ml605.dts b/target/microblaze/ml605.dts new file mode 100644 index 000000000..6ba0da255 --- /dev/null +++ b/target/microblaze/ml605.dts @@ -0,0 +1,399 @@ +/dts-v1/; +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "xlnx,microblaze"; + model = "petalogix-ml605"; + ddr3_sdram: memory@50000000 { + device_type = "memory"; + reg = < 0x50000000 0x4000000 >; + } ; + aliases { + ethernet0 = ðernet; + serial0 = &rs232_uart_1; + } ; + chosen { + bootargs = "console=ttyS0,115200"; + linux,stdout-path = "/axi@1/serial@83e00000"; + } ; + cpus { + #address-cells = <1>; + #cpus = <0x1>; + #size-cells = <0>; + microblaze_0: cpu@0 { + clock-frequency = <100000000>; + compatible = "xlnx,microblaze-8.40.a"; + d-cache-baseaddr = <0x50000000>; + d-cache-highaddr = <0x53ffffff>; + d-cache-line-size = <0x10>; + d-cache-size = <0x8000>; + device_type = "cpu"; + i-cache-baseaddr = <0x50000000>; + i-cache-highaddr = <0x53ffffff>; + i-cache-line-size = <0x10>; + i-cache-size = <0x8000>; + model = "microblaze,8.40.a"; + reg = <0>; + timebase-frequency = <100000000>; + xlnx,addr-tag-bits = <0xb>; + xlnx,allow-dcache-wr = <0x1>; + xlnx,allow-icache-wr = <0x1>; + xlnx,area-optimized = <0x0>; + xlnx,avoid-primitives = <0x0>; + xlnx,branch-target-cache-size = <0x0>; + xlnx,cache-byte-size = <0x8000>; + xlnx,d-axi = <0x1>; + xlnx,d-lmb = <0x1>; + xlnx,d-plb = <0x0>; + xlnx,data-size = <0x20>; + xlnx,dcache-addr-tag = <0xb>; + xlnx,dcache-always-used = <0x1>; + xlnx,dcache-byte-size = <0x8000>; + xlnx,dcache-data-width = <0x0>; + xlnx,dcache-force-tag-lutram = <0x0>; + xlnx,dcache-interface = <0x0>; + xlnx,dcache-line-len = <0x4>; + xlnx,dcache-use-fsl = <0x0>; + xlnx,dcache-use-writeback = <0x0>; + xlnx,dcache-victims = <0x0>; + xlnx,debug-enabled = <0x0>; + xlnx,div-zero-exception = <0x1>; + xlnx,dynamic-bus-sizing = <0x1>; + xlnx,ecc-use-ce-exception = <0x0>; + xlnx,edge-is-positive = <0x1>; + xlnx,endianness = <0x1>; + xlnx,family = "virtex6"; + xlnx,fault-tolerant = <0x0>; + xlnx,fpu-exception = <0x1>; + xlnx,freq = <0x5f5e100>; + xlnx,fsl-data-size = <0x20>; + xlnx,fsl-exception = <0x0>; + xlnx,fsl-links = <0x0>; + xlnx,i-axi = <0x1>; + xlnx,i-lmb = <0x1>; + xlnx,i-plb = <0x0>; + xlnx,icache-always-used = <0x1>; + xlnx,icache-data-width = <0x0>; + xlnx,icache-force-tag-lutram = <0x0>; + xlnx,icache-interface = <0x0>; + xlnx,icache-line-len = <0x4>; + xlnx,icache-streams = <0x0>; + xlnx,icache-use-fsl = <0x0>; + xlnx,icache-victims = <0x0>; + xlnx,ill-opcode-exception = <0x1>; + xlnx,instance = "microblaze_0"; + xlnx,interconnect = <0x2>; + xlnx,interrupt-is-edge = <0x0>; + xlnx,lockstep-slave = <0x0>; + xlnx,mmu-dtlb-size = <0x2>; + xlnx,mmu-itlb-size = <0x4>; + xlnx,mmu-privileged-instr = <0x0>; + xlnx,mmu-tlb-access = <0x3>; + xlnx,mmu-zones = <0x2>; + xlnx,number-of-pc-brk = <0x1>; + xlnx,number-of-rd-addr-brk = <0x0>; + xlnx,number-of-wr-addr-brk = <0x0>; + xlnx,opcode-0x0-illegal = <0x0>; + xlnx,optimization = <0x0>; + xlnx,pc-width = <0x20>; + xlnx,pvr = <0x2>; + xlnx,pvr-user1 = <0x0>; + xlnx,pvr-user2 = <0x0>; + xlnx,reset-msr = <0x0>; + xlnx,sco = <0x0>; + xlnx,stream-interconnect = <0x0>; + xlnx,unaligned-exceptions = <0x0>; + xlnx,use-barrel = <0x1>; + xlnx,use-branch-target-cache = <0x0>; + xlnx,use-dcache = <0x1>; + xlnx,use-div = <0x1>; + xlnx,use-ext-brk = <0x1>; + xlnx,use-ext-nm-brk = <0x1>; + xlnx,use-extended-fsl-instr = <0x0>; + xlnx,use-fpu = <0x1>; + xlnx,use-hw-mul = <0x2>; + xlnx,use-icache = <0x1>; + xlnx,use-interrupt = <0x1>; + xlnx,use-mmu = <0x3>; + xlnx,use-msr-instr = <0x1>; + xlnx,use-pcmp-instr = <0x1>; + xlnx,use-reorder-instr = <0x1>; + xlnx,use-stack-protection = <0x0>; + } ; + } ; + axi4_0: axi@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "xlnx,axi-interconnect-1.06.a", "simple-bus"; + ranges ; + } ; + axi4lite_0: axi@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "xlnx,axi-interconnect-1.06.a", "simple-bus"; + ranges ; + ethernet: axi-ethernet@82780000 { + axistream-connected = <ðernet_dma>; + axistream-control-connected = <ðernet_dma>; + clock-frequency = <100000000>; + compatible = "xlnx,axi-ethernet-3.01.a", "xlnx,axi-ethernet-1.00.a"; + device_type = "network"; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 3 2 >; + local-mac-address = [ 00 0a 35 00 81 91 ]; + phy-handle = <&phy0>; + reg = < 0x82780000 0x40000 >; + xlnx,avb = <0x0>; + xlnx,halfdup = <0x0>; + xlnx,include-io = <0x1>; + xlnx,mcast-extend = <0x0>; + xlnx,phy-type = <0x1>; + xlnx,phyaddr = "0B00001"; + xlnx,rxcsum = <0x0>; + xlnx,rxmem = <0x1000>; + xlnx,rxvlan-strp = <0x0>; + xlnx,rxvlan-tag = <0x0>; + xlnx,rxvlan-tran = <0x0>; + xlnx,stats = <0x0>; + xlnx,txcsum = <0x0>; + xlnx,txmem = <0x1000>; + xlnx,txvlan-strp = <0x0>; + xlnx,txvlan-tag = <0x0>; + xlnx,txvlan-tran = <0x0>; + xlnx,type = <0x2>; + mdio { + #address-cells = <1>; + #size-cells = <0>; + phy0: phy@7 { + compatible = "marvell,88e1111"; + device_type = "ethernet-phy"; + reg = <7>; + } ; + } ; + } ; + ethernet_dma: axi-dma@84600000 { + axistream-connected = <ðernet>; + axistream-control-connected = <ðernet>; + compatible = "xlnx,axi-dma-4.00.a", "xlnx,axi-dma-1.00.a"; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 1 2 0 2 >; + reg = < 0x84600000 0x10000 >; + xlnx,dlytmr-resolution = <0x4e2>; + xlnx,family = "virtex6"; + xlnx,include-mm2s = <0x1>; + xlnx,include-mm2s-dre = <0x1>; + xlnx,include-s2mm = <0x1>; + xlnx,include-s2mm-dre = <0x1>; + xlnx,include-sg = <0x1>; + xlnx,mm2s-burst-size = <0x10>; + xlnx,prmry-is-aclk-async = <0x0>; + xlnx,s2mm-burst-size = <0x10>; + xlnx,sg-include-desc-queue = <0x1>; + xlnx,sg-include-stscntrl-strm = <0x1>; + xlnx,sg-length-width = <0x10>; + xlnx,sg-use-stsapp-length = <0x1>; + } ; + rs232_uart_1: serial@83e00000 { + clock-frequency = <100000000>; + compatible = "xlnx,axi-uart16550-1.01.a", "xlnx,xps-uart16550-2.00.a", "ns16550a"; + current-speed = <115200>; + device_type = "serial"; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 5 2 >; + reg = < 0x83e00000 0x10000 >; + reg-offset = <0x1000>; + reg-shift = <2>; + xlnx,external-xin-clk-hz = <0x17d7840>; + xlnx,family = "virtex6"; + xlnx,has-external-rclk = <0x0>; + xlnx,has-external-xin = <0x0>; + xlnx,instance = "RS232_Uart_1"; + xlnx,is-a-16550 = <0x1>; + xlnx,use-modem-ports = <0x0>; + xlnx,use-user-ports = <0x0>; + } ; + pflash: flash@86000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "xlnx,axi-emc-1.03.a", "cfi-flash"; + bank-width = <2>; + reg = < 0x86000000 0x02000000 >; + xlnx,axi-clk-period-ps = <0x2710>; + xlnx,family = "virtex6"; + xlnx,include-datawidth-matching-0 = <0x1>; + xlnx,include-datawidth-matching-1 = <0x0>; + xlnx,include-datawidth-matching-2 = <0x0>; + xlnx,include-datawidth-matching-3 = <0x0>; + xlnx,include-negedge-ioregs = <0x0>; + xlnx,instance = "Linear_Flash"; + xlnx,lflash-period-ps = <0x4e20>; + xlnx,linear-flash-sync-burst = <0x0>; + xlnx,max-mem-width = <0x10>; + xlnx,mem0-type = <0x2>; + xlnx,mem0-width = <0x10>; + xlnx,mem1-type = <0x0>; + xlnx,mem1-width = <0x20>; + xlnx,mem2-type = <0x0>; + xlnx,mem2-width = <0x20>; + xlnx,mem3-type = <0x0>; + xlnx,mem3-width = <0x20>; + xlnx,num-banks-mem = <0x1>; + xlnx,parity-type-mem-0 = <0x0>; + xlnx,parity-type-mem-1 = <0x0>; + xlnx,parity-type-mem-2 = <0x0>; + xlnx,parity-type-mem-3 = <0x0>; + xlnx,s-axi-en-reg = <0x0>; + xlnx,s-axi-mem-addr-width = <0x20>; + xlnx,s-axi-mem-data-width = <0x20>; + xlnx,s-axi-mem-id-width = <0x1>; + xlnx,s-axi-mem-protocol = "AXI4LITE"; + xlnx,s-axi-reg-addr-width = <0x5>; + xlnx,s-axi-reg-data-width = <0x20>; + xlnx,s-axi-reg-protocol = "axi4"; + xlnx,synch-pipedelay-0 = <0x2>; + xlnx,synch-pipedelay-1 = <0x2>; + xlnx,synch-pipedelay-2 = <0x2>; + xlnx,synch-pipedelay-3 = <0x2>; + xlnx,tavdv-ps-mem-0 = <0x1fbd0>; + xlnx,tavdv-ps-mem-1 = <0x3a98>; + xlnx,tavdv-ps-mem-2 = <0x3a98>; + xlnx,tavdv-ps-mem-3 = <0x3a98>; + xlnx,tcedv-ps-mem-0 = <0x1fbd0>; + xlnx,tcedv-ps-mem-1 = <0x3a98>; + xlnx,tcedv-ps-mem-2 = <0x3a98>; + xlnx,tcedv-ps-mem-3 = <0x3a98>; + xlnx,thzce-ps-mem-0 = <0x88b8>; + xlnx,thzce-ps-mem-1 = <0x1b58>; + xlnx,thzce-ps-mem-2 = <0x1b58>; + xlnx,thzce-ps-mem-3 = <0x1b58>; + xlnx,thzoe-ps-mem-0 = <0x1b58>; + xlnx,thzoe-ps-mem-1 = <0x1b58>; + xlnx,thzoe-ps-mem-2 = <0x1b58>; + xlnx,thzoe-ps-mem-3 = <0x1b58>; + xlnx,tlzwe-ps-mem-0 = <0x88b8>; + xlnx,tlzwe-ps-mem-1 = <0x0>; + xlnx,tlzwe-ps-mem-2 = <0x0>; + xlnx,tlzwe-ps-mem-3 = <0x0>; + xlnx,tpacc-ps-flash-0 = <0x61a8>; + xlnx,tpacc-ps-flash-1 = <0x61a8>; + xlnx,tpacc-ps-flash-2 = <0x61a8>; + xlnx,tpacc-ps-flash-3 = <0x61a8>; + xlnx,twc-ps-mem-0 = <0x11170>; + xlnx,twc-ps-mem-1 = <0x3a98>; + xlnx,twc-ps-mem-2 = <0x3a98>; + xlnx,twc-ps-mem-3 = <0x3a98>; + xlnx,twp-ps-mem-0 = <0x11170>; + xlnx,twp-ps-mem-1 = <0x2ee0>; + xlnx,twp-ps-mem-2 = <0x2ee0>; + xlnx,twp-ps-mem-3 = <0x2ee0>; + xlnx,twph-ps-mem-0 = <0x2ee0>; + xlnx,twph-ps-mem-1 = <0x2ee0>; + xlnx,twph-ps-mem-2 = <0x2ee0>; + xlnx,twph-ps-mem-3 = <0x2ee0>; + xlnx,wr-rec-time-mem-0 = <0x186a0>; + xlnx,wr-rec-time-mem-1 = <0x186a0>; + xlnx,wr-rec-time-mem-2 = <0x186a0>; + xlnx,wr-rec-time-mem-3 = <0x186a0>; + partition@0x00000000 { + label = "rootfs"; + reg = <0x00000000 0x02000000>; + }; + } ; + microblaze_0_intc: interrupt-controller@81800000 { + #interrupt-cells = <0x2>; + compatible = "xlnx,axi-intc-1.02.a", "xlnx,xps-intc-1.00.a"; + interrupt-controller ; + reg = < 0x81800000 0x10000 >; + xlnx,kind-of-intr = <0x0>; + xlnx,num-intr-inputs = <0x7>; + } ; + system_timer: system-timer@83c00000 { + clock-frequency = <100000000>; + compatible = "xlnx,axi-timer-1.03.a", "xlnx,xps-timer-1.00.a"; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 2 2 >; + reg = < 0x83c00000 0x10000 >; + xlnx,count-width = <0x20>; + xlnx,family = "virtex6"; + xlnx,gen0-assert = <0x1>; + xlnx,gen1-assert = <0x1>; + xlnx,instance = "system_timer"; + xlnx,one-timer-only = <0x0>; + xlnx,trig0-assert = <0x1>; + xlnx,trig1-assert = <0x1>; + } ; + axi_pcie_0: axi-pcie@80000000 { + #address-cells = <2>; + #size-cells = <2>; + compatible = "xlnx,axi-pcie-1.05.a"; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 6 2 >; + ranges = < 0x00000002 0x00000000 0x40000000 0x70000000 0x00000000 0x00000000 0x10000000 >; + reg = < 0x80000000 0x1000000 >; + xlnx,axi-aclk-freq-hz = <0x7735940>; + xlnx,axibar-0 = <0x70000000>; + xlnx,axibar-1 = <0xffffffff>; + xlnx,axibar-2 = <0xffffffff>; + xlnx,axibar-3 = <0xffffffff>; + xlnx,axibar-4 = <0xffffffff>; + xlnx,axibar-5 = <0xffffffff>; + xlnx,axibar-as-0 = <0x0>; + xlnx,axibar-as-1 = <0x0>; + xlnx,axibar-as-2 = <0x0>; + xlnx,axibar-as-3 = <0x0>; + xlnx,axibar-as-4 = <0x0>; + xlnx,axibar-as-5 = <0x0>; + xlnx,axibar-highaddr-0 = <0x7fffffff>; + xlnx,axibar-highaddr-1 = <0x0>; + xlnx,axibar-highaddr-2 = <0x0>; + xlnx,axibar-highaddr-3 = <0x0>; + xlnx,axibar-highaddr-4 = <0x0>; + xlnx,axibar-highaddr-5 = <0x0>; + xlnx,axibar-num = <0x1>; + xlnx,axibar2pciebar-0 = <0x40000000>; + xlnx,axibar2pciebar-1 = <0x0>; + xlnx,axibar2pciebar-2 = <0x0>; + xlnx,axibar2pciebar-3 = <0x0>; + xlnx,axibar2pciebar-4 = <0x0>; + xlnx,axibar2pciebar-5 = <0x0>; + xlnx,class-code = <0x60400>; + xlnx,comp-timeout = <0x1>; + xlnx,device-id = <0x705>; + xlnx,family = "virtex6"; + xlnx,include-baroffset-reg = <0x0>; + xlnx,include-rc = <0x1>; + xlnx,instance = "axi_pcie_0"; + xlnx,interrupt-pin = <0x0>; + xlnx,max-link-speed = <0x0>; + xlnx,no-of-lanes = <0x1>; + xlnx,num-msi-req = <0x0>; + xlnx,pcie-cap-slot-implemented = <0x0>; + xlnx,pcie-use-mode = "1.0"; + xlnx,pciebar-as = <0x0>; + xlnx,pciebar-len-0 = <0x1c>; + xlnx,pciebar-len-1 = <0xd>; + xlnx,pciebar-len-2 = <0xd>; + xlnx,pciebar-num = <0x1>; + xlnx,pciebar2axibar-0 = <0xc0000000>; + xlnx,pciebar2axibar-0-sec = <0x0>; + xlnx,pciebar2axibar-1 = <0xffffffff>; + xlnx,pciebar2axibar-1-sec = <0x0>; + xlnx,pciebar2axibar-2 = <0xffffffff>; + xlnx,pciebar2axibar-2-sec = <0x0>; + xlnx,ref-clk-freq = <0x0>; + xlnx,ref-clk-freq-hz = <0x5f5e100>; + xlnx,rev-id = <0x0>; + xlnx,s-axi-ctl-aclk-freq-hz = <0x7735940>; + xlnx,s-axi-ctl-protocol = "AXI4LITE"; + xlnx,s-axi-id-width = <0x1>; + xlnx,s-axi-support-threads = <0x1>; + xlnx,s-axi-supports-narrow-burst = <0x0>; + xlnx,s-axi-supports-read = <0x1>; + xlnx,s-axi-supports-write = <0x1>; + xlnx,subsystem-id = <0x0>; + xlnx,subsystem-vendor-id = <0x0>; + xlnx,vendor-id = <0x10ee>; + } ; + + } ; +} ; diff --git a/target/microblaze/sys-available/qemu-microblaze b/target/microblaze/sys-available/qemu-microblaze index 49e2c000e..294f793ff 100644 --- a/target/microblaze/sys-available/qemu-microblaze +++ b/target/microblaze/sys-available/qemu-microblaze @@ -5,11 +5,8 @@ config ADK_TARGET_SYSTEM_QEMU_MICROBLAZE select ADK_qemu_microblaze select ADK_KERNEL_CPU_BIG_ENDIAN select ADK_HARDWARE_QEMU - select ADK_TARGET_WITH_VGA - select ADK_TARGET_WITH_INPUT - select ADK_TARGET_WITH_PCI - select ADK_TARGET_WITH_HDD select ADK_TARGET_KERNEL_LINUXBIN + select ADK_USE_KERNEL_MINICONFIG help Qemu support for microblaze big endian architecture. diff --git a/target/microblaze/sys-available/qemu-microblazeel b/target/microblaze/sys-available/qemu-microblazeel index 9c02185e8..a577d340a 100644 --- a/target/microblaze/sys-available/qemu-microblazeel +++ b/target/microblaze/sys-available/qemu-microblazeel @@ -5,11 +5,8 @@ config ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL select ADK_little select ADK_KERNEL_CPU_LITTLE_ENDIAN select ADK_HARDWARE_QEMU - select ADK_TARGET_WITH_VGA - select ADK_TARGET_WITH_INPUT - select ADK_TARGET_WITH_PCI - select ADK_TARGET_WITH_HDD select ADK_TARGET_KERNEL_LINUXBIN + select ADK_USE_KERNEL_MINICONFIG help Qemu support for microblaze little endian architecture. diff --git a/target/tools/mtd-utils/Makefile b/target/tools/mtd-utils/Makefile new file mode 100644 index 000000000..3c90f81c8 --- /dev/null +++ b/target/tools/mtd-utils/Makefile @@ -0,0 +1,24 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= mtd-utils +PKG_VERSION:= 1.5 +PKG_RELEASE:= 1 +PKG_MD5SUM:= fbc1e3560a2c941ed2c94a73ae74348c +PKG_SITES:= http://openadk.org/distfiles/ + +include ../rules.mk + +all: ${STAGING_HOST_DIR}/bin/mkfs.jffs2 + +$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared + ${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}' CPPFLAGS='-DWITHOUT_XATTR=1 -D_GNU_SOURCE -I./include' + touch $@ + +${STAGING_HOST_DIR}/bin/mkfs.jffs2: $(WRKBUILD)/.compiled + $(INSTALL_BIN) $(WRKBUILD)/mkfs.jffs2 \ + ${STAGING_HOST_DIR}/bin + +include $(TOPDIR)/mk/tools.mk diff --git a/target/tools/mtd-utils/patches/lzo.patch b/target/tools/mtd-utils/patches/lzo.patch new file mode 100644 index 000000000..6d6469ef6 --- /dev/null +++ b/target/tools/mtd-utils/patches/lzo.patch @@ -0,0 +1,80 @@ +diff -Nur mtd-utils-1.5.orig/compr.c mtd-utils-1.5/compr.c +--- mtd-utils-1.5.orig/compr.c 2013-12-24 10:42:36.000000000 +0100 ++++ mtd-utils-1.5/compr.c 2013-12-25 22:18:17.000000000 +0100 +@@ -517,9 +517,6 @@ + #ifdef CONFIG_JFFS2_RTIME + jffs2_rtime_init(); + #endif +-#ifdef CONFIG_JFFS2_LZO +- jffs2_lzo_init(); +-#endif + return 0; + } + +@@ -531,8 +528,5 @@ + #ifdef CONFIG_JFFS2_ZLIB + jffs2_zlib_exit(); + #endif +-#ifdef CONFIG_JFFS2_LZO +- jffs2_lzo_exit(); +-#endif + return 0; + } +diff -Nur mtd-utils-1.5.orig/Makefile mtd-utils-1.5/Makefile +--- mtd-utils-1.5.orig/Makefile 2013-12-24 10:42:36.000000000 +0100 ++++ mtd-utils-1.5/Makefile 2013-12-25 22:22:52.000000000 +0100 +@@ -26,18 +26,12 @@ + rfddump rfdformat \ + serve_image recv_image \ + sumtool jffs2reader +-UBI_BINS = \ +- ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \ +- ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol + + BINS = $(MTD_BINS) +-BINS += mkfs.ubifs/mkfs.ubifs +-BINS += $(addprefix ubi-utils/,$(UBI_BINS)) + SCRIPTS = flash_eraseall + + TARGETS = $(BINS) + TARGETS += lib/libmtd.a +-TARGETS += ubi-utils/libubi.a + + OBJDEPS = $(BUILDDIR)/include/version.h + +@@ -84,12 +78,12 @@ + # + # Utils in top level + # +-obj-mkfs.jffs2 = compr_rtime.o compr_zlib.o compr_lzo.o compr.o rbtree.o +-LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS) +-LDLIBS_mkfs.jffs2 = -lz $(LZOLDLIBS) ++obj-mkfs.jffs2 = compr_rtime.o compr_zlib.o compr.o rbtree.o ++LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) ++LDLIBS_mkfs.jffs2 = -lz + +-LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) +-LDLIBS_jffs2reader = -lz $(LZOLDLIBS) ++LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) ++LDLIBS_jffs2reader = -lz + + $(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v)))) + +@@ -104,8 +98,8 @@ + # + obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \ + hashtable/hashtable.o hashtable/hashtable_itr.o +-LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS) +-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid ++LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(UUIDLDFLAGS) ++LDLIBS_mkfs.ubifs = -lz -lm -luuid + $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a) + + # +@@ -119,6 +113,3 @@ + obj-mtdinfo = libubigen.a + obj-ubinize = libubigen.a libiniparser.a + obj-ubiformat = libubigen.a libscan.a +- +-$(foreach v,libubi.a libubigen.a libiniparser.a libscan.a,$(eval $(call _mkdep,ubi-utils/,$(v)))) +-$(foreach v,$(UBI_BINS),$(eval $(call mkdep,ubi-utils/,$(v),libubi.a ubiutils-common.o))) diff --git a/target/tools/squashfs/Makefile b/target/tools/squashfs/Makefile index bcc966274..94b3a0115 100644 --- a/target/tools/squashfs/Makefile +++ b/target/tools/squashfs/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:= squashfs -PKG_VERSION:= 4.0 -PKG_RELEASE:= 2 -PKG_MD5SUM:= a3c23391da4ebab0ac4a75021ddabf96 +PKG_VERSION:= 4.2 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 1b7a781fb4cf8938842279bd3e8ee852 PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=squashfs/} DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tar.gz @@ -17,7 +17,9 @@ include ../rules.mk all: ${STAGING_HOST_DIR}/bin/mksquashfs $(WRKBUILD)/.compiled: ${WRKDIST}/.prepared - ${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}' + ${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}' \ + XZ_SUPPORT=1 CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD) \ + EXTRA_LDFLAGS=$(LDFLAGS_FOR_BUILD) touch $@ ${STAGING_HOST_DIR}/bin/mksquashfs: $(WRKBUILD)/.compiled diff --git a/target/tools/squashfs/patches/cppflags.patch b/target/tools/squashfs/patches/cppflags.patch new file mode 100644 index 000000000..1432ea3cf --- /dev/null +++ b/target/tools/squashfs/patches/cppflags.patch @@ -0,0 +1,12 @@ +diff -Nur squashfs4.2.orig/squashfs-tools/Makefile squashfs4.2/squashfs-tools/Makefile +--- squashfs4.2.orig/squashfs-tools/Makefile 2011-02-28 21:04:15.000000000 +0100 ++++ squashfs4.2/squashfs-tools/Makefile 2013-12-27 13:49:22.000000000 +0100 +@@ -93,7 +93,7 @@ + # End of BUILD options section # + ############################################### + +-INCLUDEDIR = -I. ++INCLUDEDIR = -I. $(CPPFLAGS_FOR_BUILD) + INSTALL_DIR = /usr/local/bin + + MKSQUASHFS_OBJS = mksquashfs.o read_fs.o sort.o swap.o pseudo.o compressor.o diff --git a/target/tools/squashfs/patches/honour-cflags.patch b/target/tools/squashfs/patches/honour-cflags.patch deleted file mode 100644 index a50d94263..000000000 --- a/target/tools/squashfs/patches/honour-cflags.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- squashfs4.0/squashfs-tools/Makefile~ Sun Apr 5 02:03:12 2009 -+++ squashfs4.0/squashfs-tools/Makefile Fri Jan 7 16:16:46 2011 -@@ -2,7 +2,7 @@ INSTALL_DIR = /usr/local/bin - - INCLUDEDIR = . - --CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 -+CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 ${CFLAGS_FOR_BUILD} - - all: mksquashfs unsquashfs - diff --git a/target/tools/squashfs/patches/squashfs-bsd.patch b/target/tools/squashfs/patches/squashfs-bsd.patch deleted file mode 100644 index 578b9017f..000000000 --- a/target/tools/squashfs/patches/squashfs-bsd.patch +++ /dev/null @@ -1,245 +0,0 @@ ---- squashfs4.0~/squashfs-tools/mksquashfs.c Sun Apr 5 21:22:24 2009 -+++ squashfs4.0/squashfs-tools/mksquashfs.c Fri Jan 7 20:36:08 2011 -@@ -24,6 +24,7 @@ - #define FALSE 0 - #define TRUE 1 - -+#include - #include - #include - #include -@@ -3688,23 +3689,9 @@ void initialise_threads() - signal(SIGUSR1, sigusr1_handler); - - if(processors == -1) { --#ifndef linux -- int mib[2]; -- size_t len = sizeof(processors); -- -- mib[0] = CTL_HW; --#ifdef HW_AVAILCPU -- mib[1] = HW_AVAILCPU; -+#if defined(BSD) -+ processors = 1; - #else -- mib[1] = HW_NCPU; --#endif -- -- if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) { -- ERROR("Failed to get number of available processors. " -- "Defaulting to 1\n"); -- processors = 1; -- } --#else - processors = get_nprocs(); - #endif - } -@@ -3974,9 +3961,15 @@ int excluded(struct pathnames *paths, ch - int match = use_regex ? - regexec(path->name[i].preg, name, (size_t) 0, - NULL, 0) == 0 : -+#if defined(BSD) - fnmatch(path->name[i].name, name, -+ FNM_PATHNAME|FNM_PERIOD) == -+ 0; -+#else -+ fnmatch(path->name[i].name, name, - FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == - 0; -+#endif - - if(match && path->name[i].paths == NULL) { - /* match on a leaf component, any subdirectories ---- squashfs4.0~/squashfs-tools/mksquashfs.h Thu Feb 19 18:30:44 2009 -+++ squashfs4.0/squashfs-tools/mksquashfs.h Fri Jan 7 20:40:01 2011 -@@ -24,7 +24,9 @@ - * - */ - --#if __BYTE_ORDER == __BIG_ENDIAN -+#ifndef __BYTE_ORDER -+#error Which endianness? __BYTE_ORDER is not defined. -+#elif __BYTE_ORDER == __BIG_ENDIAN - #define SQUASHFS_SWAP_SHORTS(s, d, n) swap_le16_num(s, d, n) - #define SQUASHFS_SWAP_INTS(s, d, n) swap_le32_num(s, d, n) - #define SQUASHFS_SWAP_LONG_LONGS(s, d, n) swap_le64_num(s, d, n) -@@ -34,11 +36,13 @@ - #define SWAP_LE64(s, d, field) swap_le64(&((s)->field), &((d)->field)) - #define SWAP_LES16(s, d, field) swap_le16((unsigned short *) &((s)->field), \ - (unsigned short *) &((d)->field)) --#else -+#elif __BYTE_ORDER == __LITTLE_ENDIAN - #define SQUASHFS_MEMCPY(s, d, n) memcpy(d, s, n) - #define SQUASHFS_SWAP_SHORTS(s, d, n) memcpy(d, s, n * sizeof(short)) - #define SQUASHFS_SWAP_INTS(s, d, n) memcpy(d, s, n * sizeof(int)) - #define SQUASHFS_SWAP_LONG_LONGS(s, d, n) \ - memcpy(d, s, n * sizeof(long long)) -+#else -+#error Which endianness (PDP endian? Worse?) - #endif - #endif ---- squashfs4.0~/squashfs-tools/pseudo.c Sun Apr 5 02:01:34 2009 -+++ squashfs4.0/squashfs-tools/pseudo.c Fri Jan 7 20:35:31 2011 -@@ -30,6 +30,11 @@ - #include - #include - #include -+#include -+ -+#if defined(BSD) -+#include -+#endif - - #include "pseudo.h" - ---- squashfs4.0~/squashfs-tools/read_fs.h Thu Feb 19 18:28:56 2009 -+++ squashfs4.0/squashfs-tools/read_fs.h Fri Jan 7 20:40:00 2011 -@@ -24,7 +24,9 @@ - * - */ - --#if __BYTE_ORDER == __BIG_ENDIAN -+#ifndef __BYTE_ORDER -+#error Which endianness? __BYTE_ORDER is not defined. -+#elif __BYTE_ORDER == __BIG_ENDIAN - #define SQUASHFS_SWAP_SHORTS(d, s, n) swap_le16_num(s, d, n) - #define SQUASHFS_SWAP_INTS(d, s, n) swap_le32_num(s, d, n) - #define SQUASHFS_SWAP_LONG_LONGS(d, s, n) swap_le64_num(s, d, n) -@@ -34,11 +36,13 @@ - #define SWAP_LE64(d, s, field) swap_le64(&((s)->field), &((d)->field)) - #define SWAP_LES16(d, s, field) swap_le16((unsigned short *) &((s)->field), \ - (unsigned short *) &((d)->field)) --#else -+#elif __BYTE_ORDER == __LITTLE_ENDIAN - #define SQUASHFS_MEMCPY(d, s, n) memcpy(d, s, n) - #define SQUASHFS_SWAP_SHORTS(d, s, n) memcpy(d, s, n * sizeof(short)) - #define SQUASHFS_SWAP_INTS(d, s, n) memcpy(d, s, n * sizeof(int)) - #define SQUASHFS_SWAP_LONG_LONGS(d, s, n) \ - memcpy(d, s, n * sizeof(long long)) -+#else -+#error Which endianness (PDP endian? Worse?) - #endif - #endif ---- squashfs4.0~/squashfs-tools/squashfs_compat.h Mon Mar 16 04:27:03 2009 -+++ squashfs4.0/squashfs-tools/squashfs_compat.h Fri Jan 7 20:39:59 2011 -@@ -768,12 +768,16 @@ typedef union squashfs_inode_header_2 sq - * macros used to swap each structure entry, taking into account - * bitfields and different bitfield placing conventions on differing architectures - */ --#if __BYTE_ORDER == __BIG_ENDIAN -+#ifndef __BYTE_ORDER -+#error Which endianness? __BYTE_ORDER is not defined. -+#elif __BYTE_ORDER == __BIG_ENDIAN - /* convert from big endian to little endian */ - #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, b_pos) --#else -+#elif __BYTE_ORDER == __LITTLE_ENDIAN - /* convert from little endian to big endian */ - #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, 64 - tbits - b_pos) -+#else -+#error Which endianness (PDP endian? Worse?) - #endif - - #define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\ ---- squashfs4.0~/squashfs-tools/squashfs_swap.h Fri Feb 20 19:41:56 2009 -+++ squashfs4.0/squashfs-tools/squashfs_swap.h Fri Jan 7 20:39:59 2011 -@@ -27,7 +27,9 @@ - * macros to convert each stucture from big endian to little endian - */ - --#if __BYTE_ORDER == __BIG_ENDIAN -+#ifndef __BYTE_ORDER -+#error Which endianness? __BYTE_ORDER is not defined. -+#elif __BYTE_ORDER == __BIG_ENDIAN - extern void swap_le16(unsigned short *, unsigned short *); - extern void swap_le32(unsigned int *, unsigned int *); - extern void swap_le64(long long *, long long *); -@@ -256,7 +258,7 @@ extern void inswap_le64_num(long long *, - #define SQUASHFS_INSWAP_SHORTS(s, n) inswap_le16_num(s, n) - #define SQUASHFS_INSWAP_INTS(s, n) inswap_le32_num(s, n) - #define SQUASHFS_INSWAP_LONG_LONGS(s, n) inswap_le64_num(s, n) --#else -+#elif __BYTE_ORDER == __LITTLE_ENDIAN - #define SQUASHFS_SWAP_SUPER_BLOCK(s, d) \ - SQUASHFS_MEMCPY(s, d, sizeof(*(s))) - #define SQUASHFS_SWAP_DIR_INDEX(s, d) \ -@@ -308,5 +310,7 @@ extern void inswap_le64_num(long long *, - #define SQUASHFS_INSWAP_SHORTS(s, n) - #define SQUASHFS_INSWAP_INTS(s, n) - #define SQUASHFS_INSWAP_LONG_LONGS(s, n) -+#else -+#error Which endianness (PDP endian? Worse?) - #endif - #endif ---- squashfs4.0~/squashfs-tools/swap.c Thu Mar 26 04:39:52 2009 -+++ squashfs4.0/squashfs-tools/swap.c Fri Jan 7 20:40:00 2011 -@@ -27,7 +27,9 @@ - #include - #endif - --#if __BYTE_ORDER == __BIG_ENDIAN -+#ifndef __BYTE_ORDER -+#error Which endianness? __BYTE_ORDER is not defined. -+#elif __BYTE_ORDER == __BIG_ENDIAN - void swap_le16(unsigned short *src, unsigned short *dest) - { - unsigned char *s = (unsigned char *) src; -@@ -120,4 +122,6 @@ void inswap_le##BITS##_num(TYPE *s, int - INSWAP_LE_NUM(16, unsigned short) - INSWAP_LE_NUM(32, unsigned int) - INSWAP_LE_NUM(64, long long) -+#elif __BYTE_ORDER != __LITTLE_ENDIAN -+#error Which endianness (PDP endian? Worse?) - #endif ---- squashfs4.0~/squashfs-tools/unsquashfs.c Sun Apr 5 21:22:42 2009 -+++ squashfs4.0/squashfs-tools/unsquashfs.c Fri Jan 7 20:35:31 2011 -@@ -21,6 +21,8 @@ - * unsquashfs.c - */ - -+#include -+ - #include "unsquashfs.h" - #include "squashfs_swap.h" - #include "squashfs_compat.h" -@@ -1193,10 +1195,17 @@ int matches(struct pathnames *paths, cha - struct pathname *path = paths->path[n]; - for(i = 0; i < path->names; i++) { - int match = use_regex ? -+#if defined(BSD) - regexec(path->name[i].preg, name, (size_t) 0, - NULL, 0) == 0 : fnmatch(path->name[i].name, -+ name, FNM_PATHNAME|FNM_PERIOD) == -+ 0; -+#else -+ regexec(path->name[i].preg, name, (size_t) 0, -+ NULL, 0) == 0 : fnmatch(path->name[i].name, - name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == - 0; -+#endif - if(match && path->name[i].paths == NULL) - /* - * match on a leaf component, any subdirectories -@@ -1795,21 +1804,7 @@ void initialise_threads(int fragment_buf - - if(processors == -1) { - #ifndef linux -- int mib[2]; -- size_t len = sizeof(processors); -- -- mib[0] = CTL_HW; --#ifdef HW_AVAILCPU -- mib[1] = HW_AVAILCPU; --#else -- mib[1] = HW_NCPU; --#endif -- -- if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) { -- ERROR("Failed to get number of available processors. " -- "Defaulting to 1\n"); -- processors = 1; -- } -+ processors = 1; - #else - processors = get_nprocs(); - #endif diff --git a/target/tools/squashfs/patches/uClibc-compat.patch b/target/tools/squashfs/patches/uClibc-compat.patch deleted file mode 100644 index 00f2b22c0..000000000 --- a/target/tools/squashfs/patches/uClibc-compat.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur squashfs4.0.orig/squashfs-tools/mksquashfs.c squashfs4.0/squashfs-tools/mksquashfs.c ---- squashfs4.0.orig/squashfs-tools/mksquashfs.c 2009-04-05 23:22:48.000000000 +0200 -+++ squashfs4.0/squashfs-tools/mksquashfs.c 2011-03-18 22:04:00.000000000 +0100 -@@ -3705,7 +3705,7 @@ - processors = 1; - } - #else -- processors = get_nprocs(); -+ processors = sysconf(_SC_NPROCESSORS_CONF); - #endif - } - -diff -Nur squashfs4.0.orig/squashfs-tools/unsquashfs.c squashfs4.0/squashfs-tools/unsquashfs.c ---- squashfs4.0.orig/squashfs-tools/unsquashfs.c 2009-04-05 23:23:06.000000000 +0200 -+++ squashfs4.0/squashfs-tools/unsquashfs.c 2011-03-18 22:03:31.000000000 +0100 -@@ -1811,7 +1811,7 @@ - processors = 1; - } - #else -- processors = get_nprocs(); -+ processors = sysconf(_SC_NPROCESSORS_CONF); - #endif - } - diff --git a/target/tools/xz/Makefile b/target/tools/xz/Makefile new file mode 100644 index 000000000..6cefbb476 --- /dev/null +++ b/target/tools/xz/Makefile @@ -0,0 +1,28 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= xz +PKG_VERSION:= 5.0.5 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 1b7a781fb4cf8938842279bd3e8ee852 +PKG_SITES:= http://tukaani.org/xz/ + +include ../rules.mk + +all: $(WRKBUILD)/.installed + +$(WRKBUILD)/.configured: ${WRKDIST}/.prepared + (cd ${WRKBUILD}; ./configure --prefix=$(STAGING_HOST_DIR)/usr) + touch $@ + +$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured + ${MAKE} -C ${WRKBUILD} + touch $@ + +$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled + ${MAKE} -C ${WRKBUILD} install + touch $@ + +include $(TOPDIR)/mk/tools.mk diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile index 12f193c3b..276b468d4 100644 --- a/toolchain/eglibc/Makefile +++ b/toolchain/eglibc/Makefile @@ -8,6 +8,9 @@ include ../rules.mk ifeq ($(ADK_LINUX_SPARC),y) TARGET_CFLAGS_LIBC:= $(subst Os,O2,$(TARGET_CFLAGS)) endif +ifeq ($(ADK_LINUX_MICROBLAZE),y) +TARGET_CFLAGS_LIBC:= $(subst Os,O2,$(TARGET_CFLAGS)) +endif # ssp not supported TARGET_CFLAGS_LIBC:= $(filter-out -fstack-protector,$(TARGET_CFLAGS_LIBC)) -- cgit v1.2.3 From f3f7a7f082ffce3fe30555c73276f4c070c0b6da Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Dec 2013 19:40:44 +0100 Subject: default to 0 --- target/linux/config/Config.in.flash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target') diff --git a/target/linux/config/Config.in.flash b/target/linux/config/Config.in.flash index 26f00845a..773c518e8 100644 --- a/target/linux/config/Config.in.flash +++ b/target/linux/config/Config.in.flash @@ -138,4 +138,4 @@ config ADK_TARGET_MTD_SIZE int default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL - default "" + default "0" -- cgit v1.2.3 From bc2f511c2392159717ea20a3a71a4b23de0ed134 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 1 Jan 2014 17:42:38 +0100 Subject: make native gcc for microblaze working --- package/gcc/Makefile | 9 +- package/gcc/patches/4.7.3/cflags.patch | 253 +++++++ package/gcc/patches/4.7.3/cross-gcc-fix.patch | 13 + package/gcc/patches/4.7.3/gcc-cppflags.patch | 12 + package/gcc/patches/4.7.3/ltmain.patch | 12 + package/gcc/patches/4.7.3/mirbsd-compat.patch | 12 + package/gcc/patches/4.7.3/musl-cris.patch | 11 + package/gcc/patches/4.7.3/musl-cross.patch | 825 +++++++++++++++++++++ package/gcc/patches/4.7.3/musl-m68k.patch | 11 + package/gcc/patches/4.7.3/musl-mips64.patch | 14 + package/gcc/patches/4.7.3/musl-ppc.patch | 155 ++++ package/gcc/patches/4.7.3/musl-sh.patch | 11 + package/gcc/patches/4.7.3/musl-sparc.patch | 24 + package/gcc/patches/4.7.3/sdt.patch | 14 + .../gcc/patches/4.8.2/patch-libatomic_Makefile_in | 12 + package/gcc/patches/cflags.patch | 253 ------- package/gcc/patches/cross-gcc-fix.patch | 13 - package/gcc/patches/gcc-cppflags.patch | 12 - package/gcc/patches/ltmain.patch | 12 - package/gcc/patches/mirbsd-compat.patch | 12 - package/gcc/patches/musl-cris.patch | 11 - package/gcc/patches/musl-cross.patch | 825 --------------------- package/gcc/patches/musl-m68k.patch | 11 - package/gcc/patches/musl-mips64.patch | 14 - package/gcc/patches/musl-ppc.patch | 155 ---- package/gcc/patches/musl-sh.patch | 11 - package/gcc/patches/musl-sparc.patch | 24 - package/gcc/patches/sdt.patch | 14 - package/glibc/files/libc.so.microblaze | 5 + target/microblaze/sys-available/qemu-microblaze | 1 + 30 files changed, 1392 insertions(+), 1369 deletions(-) create mode 100644 package/gcc/patches/4.7.3/cflags.patch create mode 100644 package/gcc/patches/4.7.3/cross-gcc-fix.patch create mode 100644 package/gcc/patches/4.7.3/gcc-cppflags.patch create mode 100644 package/gcc/patches/4.7.3/ltmain.patch create mode 100644 package/gcc/patches/4.7.3/mirbsd-compat.patch create mode 100644 package/gcc/patches/4.7.3/musl-cris.patch create mode 100644 package/gcc/patches/4.7.3/musl-cross.patch create mode 100644 package/gcc/patches/4.7.3/musl-m68k.patch create mode 100644 package/gcc/patches/4.7.3/musl-mips64.patch create mode 100644 package/gcc/patches/4.7.3/musl-ppc.patch create mode 100644 package/gcc/patches/4.7.3/musl-sh.patch create mode 100644 package/gcc/patches/4.7.3/musl-sparc.patch create mode 100644 package/gcc/patches/4.7.3/sdt.patch create mode 100644 package/gcc/patches/4.8.2/patch-libatomic_Makefile_in delete mode 100644 package/gcc/patches/cflags.patch delete mode 100644 package/gcc/patches/cross-gcc-fix.patch delete mode 100644 package/gcc/patches/gcc-cppflags.patch delete mode 100644 package/gcc/patches/ltmain.patch delete mode 100644 package/gcc/patches/mirbsd-compat.patch delete mode 100644 package/gcc/patches/musl-cris.patch delete mode 100644 package/gcc/patches/musl-cross.patch delete mode 100644 package/gcc/patches/musl-m68k.patch delete mode 100644 package/gcc/patches/musl-mips64.patch delete mode 100644 package/gcc/patches/musl-ppc.patch delete mode 100644 package/gcc/patches/musl-sh.patch delete mode 100644 package/gcc/patches/musl-sparc.patch delete mode 100644 package/gcc/patches/sdt.patch create mode 100644 package/glibc/files/libc.so.microblaze (limited to 'target') diff --git a/package/gcc/Makefile b/package/gcc/Makefile index 2c2fb70a6..f0e17503a 100644 --- a/package/gcc/Makefile +++ b/package/gcc/Makefile @@ -8,7 +8,7 @@ PKG_NAME:= gcc PKG_DESCR:= GNU C compiler PKG_SECTION:= lang PKG_OPTS:= noremove -PKG_DEPENDS:= libmpc libgmp mpfr +PKG_DEPENDS:= libmpc libgmp mpfr libgcc PKG_BUILDDEP:= libmpc gmp mpfr PKG_ARCH_DEPENDS:= !avr32 @@ -37,6 +37,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y) CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI) endif +ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y) +CONFIGURE_ARGS+= --enable-sjlj-exceptions +else +CONFIGURE_ARGS+= --disable-sjlj-exceptions +endif + ifneq ($(ADK_PACKAGE_GXX),) CONFIGURE_ARGS+= --enable-languages=c,c++ else @@ -50,7 +56,6 @@ CONFIGURE_ARGS+= --host=$(REAL_GNU_TARGET_NAME) \ --without-headers \ --libexecdir=/usr/lib \ --disable-libssp \ - --disable-sjlj-exceptions \ --disable-biarch \ --disable-libmudflap \ --disable-libgomp \ diff --git a/package/gcc/patches/4.7.3/cflags.patch b/package/gcc/patches/4.7.3/cflags.patch new file mode 100644 index 000000000..3623d3872 --- /dev/null +++ b/package/gcc/patches/4.7.3/cflags.patch @@ -0,0 +1,253 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks + the default for -O2/-Os, because they trigger gcc bugs + and can delete code with security implications. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -103,6 +103,9 @@ static size_t deferred_count; + /* Number of deferred options scanned for -include. */ + static size_t include_cursor; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx0x (int); +@@ -441,6 +444,9 @@ c_common_handle_option (size_t scode, co + global_dc->warning_as_error_requested = value; + break; + ++ case OPT_Werror_maybe_reset: ++ break; ++ + case OPT_Wformat: + set_Wformat (value); + break; +@@ -584,6 +590,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1058,6 +1070,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -363,6 +363,10 @@ Werror-implicit-function-declaration + C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration) + This switch is deprecated; use -Werror=implicit-function-declaration instead + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality +@@ -794,6 +798,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -520,6 +520,10 @@ Werror= + Common Joined + Treat specified warning as error + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings +@@ -1156,6 +1160,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -477,8 +477,6 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 }, + #endif + { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 }, +@@ -494,6 +492,8 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 }, + + /* -O3 optimizations. */ ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 }, ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 }, + /* Inlining of functions reducing size is a good idea with -Os +@@ -1399,6 +1399,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -164,6 +164,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}. + -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol + -Wno-deprecated-declarations -Wdisabled-optimization @gol + -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol +--Wno-endif-labels -Werror -Werror=* @gol ++-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol + -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-y2k @gol +@@ -4497,6 +4497,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-pedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++ at item -fhonour-copts ++ at opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -6319,7 +6335,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -627,6 +627,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/package/gcc/patches/4.7.3/cross-gcc-fix.patch b/package/gcc/patches/4.7.3/cross-gcc-fix.patch new file mode 100644 index 000000000..f39b35fb9 --- /dev/null +++ b/package/gcc/patches/4.7.3/cross-gcc-fix.patch @@ -0,0 +1,13 @@ +diff -Nur gcc-4.4.2.orig/gcc/Makefile.in gcc-4.4.2/gcc/Makefile.in +--- gcc-4.5.2.orig/gcc/Makefile.in 2010-09-02 15:05:30.000000000 +0200 ++++ gcc-4.5.2/gcc/Makefile.in 2011-01-15 14:29:18.000000000 +0100 +@@ -980,7 +980,8 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $ + # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro + # puts -I options in CPPFLAGS, our include files in the srcdir will always + # win against random include files in /usr/include. +-ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) ++#ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) ++ALL_CPPFLAGS = $(INCLUDES) + + # This is the variable to use when using $(COMPILER). + ifneq ($(ENABLE_BUILD_WITH_CXX),yes) diff --git a/package/gcc/patches/4.7.3/gcc-cppflags.patch b/package/gcc/patches/4.7.3/gcc-cppflags.patch new file mode 100644 index 000000000..0971bbec9 --- /dev/null +++ b/package/gcc/patches/4.7.3/gcc-cppflags.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.4.4.orig/gcc/configure gcc-4.4.4/gcc/configure +--- gcc-4.4.4.orig/gcc/configure 2009-10-19 14:15:27.000000000 +0200 ++++ gcc-4.4.4/gcc/configure 2010-08-02 00:47:36.823620346 +0200 +@@ -13530,7 +13530,7 @@ + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ +- LDFLAGS="${LDFLAGS_FOR_BUILD}" \ ++ LDFLAGS="${LDFLAGS_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias diff --git a/package/gcc/patches/4.7.3/ltmain.patch b/package/gcc/patches/4.7.3/ltmain.patch new file mode 100644 index 000000000..215889b70 --- /dev/null +++ b/package/gcc/patches/4.7.3/ltmain.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.5.2.orig/ltmain.sh gcc-4.5.2/ltmain.sh +--- gcc-4.5.2.orig/ltmain.sh 2009-12-05 18:18:53.000000000 +0100 ++++ gcc-4.5.2/ltmain.sh 2011-01-15 14:45:07.000000000 +0100 +@@ -4980,7 +4980,7 @@ + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ +- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) ++ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|-fstack-protector*|-flto) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" diff --git a/package/gcc/patches/4.7.3/mirbsd-compat.patch b/package/gcc/patches/4.7.3/mirbsd-compat.patch new file mode 100644 index 000000000..2f3ea0c87 --- /dev/null +++ b/package/gcc/patches/4.7.3/mirbsd-compat.patch @@ -0,0 +1,12 @@ +diff -Nur gcc-4.4.2.orig/gcc/configure gcc-4.4.2/gcc/configure +--- gcc-4.4.2.orig/gcc/configure Tue Mar 24 18:45:39 2009 ++++ gcc-4.4.2/gcc/configure Sat Dec 19 21:07:07 2009 +@@ -19381,7 +19381,7 @@ + dynamic_linker='ldqnx.so' + ;; + +-openbsd*) ++mirbsd*|openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no diff --git a/package/gcc/patches/4.7.3/musl-cris.patch b/package/gcc/patches/4.7.3/musl-cris.patch new file mode 100644 index 000000000..4889263a1 --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-cris.patch @@ -0,0 +1,11 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/cris/linux.h gcc-4.7.3/gcc/config/cris/linux.h +--- gcc-4.7.3.orig/gcc/config/cris/linux.h 2011-04-11 20:46:05.000000000 +0200 ++++ gcc-4.7.3/gcc/config/cris/linux.h 2013-10-11 10:01:51.000000000 +0200 +@@ -104,6 +104,7 @@ + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-cris.1" + + #undef CRIS_LINK_SUBTARGET_SPEC + #define CRIS_LINK_SUBTARGET_SPEC \ diff --git a/package/gcc/patches/4.7.3/musl-cross.patch b/package/gcc/patches/4.7.3/musl-cross.patch new file mode 100644 index 000000000..453ba9aec --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-cross.patch @@ -0,0 +1,825 @@ +diff -Nur gcc-4.7.3.orig/config.sub gcc-4.7.3/config.sub +--- gcc-4.7.3.orig/config.sub 2012-08-06 16:34:27.000000000 +0200 ++++ gcc-4.7.3/config.sub 2013-09-16 15:39:42.000000000 +0200 +@@ -4,7 +4,7 @@ + # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + # 2011 Free Software Foundation, Inc. + +-timestamp='2011-10-29' ++timestamp='2011-03-23' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software +@@ -125,6 +125,7 @@ + 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* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ +@@ -251,17 +252,13 @@ + | 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 \ +- | be32 | be64 \ + | bfin \ + | c4x | 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 \ +- | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ +@@ -295,7 +292,7 @@ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ +- | rl78 | rx \ ++ | 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 \ +@@ -304,7 +301,7 @@ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ ++ | v850 | v850e \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) +@@ -361,7 +358,6 @@ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ +- | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ +@@ -370,10 +366,8 @@ + | 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-* \ +- | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +@@ -407,7 +401,7 @@ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ ++ | 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-* \ +@@ -415,11 +409,10 @@ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ ++ | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ ++ | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ +@@ -820,10 +813,6 @@ + basic_machine=i370-ibm + os=-mvs + ;; +- nacl) +- basic_machine=le32-unknown +- os=-nacl +- ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 +@@ -1132,8 +1121,13 @@ + basic_machine=t90-cray + os=-unicos + ;; ++ # This must be matched before tile*. ++ tilegx*) ++ basic_machine=tilegx-unknown ++ os=-linux-gnu ++ ;; + tile*) +- basic_machine=$basic_machine-unknown ++ basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) +@@ -1346,6 +1340,7 @@ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ ++ | -linux-musl* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +diff -Nur gcc-4.7.3.orig/fixincludes/mkfixinc.sh gcc-4.7.3/fixincludes/mkfixinc.sh +--- gcc-4.7.3.orig/fixincludes/mkfixinc.sh 2011-09-22 16:00:17.000000000 +0200 ++++ gcc-4.7.3/fixincludes/mkfixinc.sh 2013-09-16 15:39:42.000000000 +0200 +@@ -20,7 +20,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} +diff -Nur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h +--- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h 2011-11-02 16:03:19.000000000 +0100 ++++ gcc-4.7.3/gcc/config/arm/linux-eabi.h 2013-09-16 15:39:42.000000000 +0200 +@@ -64,6 +64,23 @@ + #undef GLIBC_DYNAMIC_LINKER + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" + ++/* For ARM musl currently supports two 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. ++ musl does not support the legacy OABI (i.e. broken) mode. ++ All the dynamic linkers live in /lib. ++ We default to soft-float, but this can be overridden by changing both ++ MUSL_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1" ++#define MUSL_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1" ++#define MUSL_DYNAMIC_LINKER_DEFAULT MUSL_DYNAMIC_LINKER_SOFT_FLOAT ++ ++#define MUSL_DYNAMIC_LINKER \ ++ "%{mfloat-abi=hard:" MUSL_DYNAMIC_LINKER_HARD_FLOAT "} \ ++ %{mfloat-abi=soft*:" MUSL_DYNAMIC_LINKER_SOFT_FLOAT "} \ ++ %{!mfloat-abi=*:" MUSL_DYNAMIC_LINKER_DEFAULT "}" ++ + /* 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 -Nur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h +--- gcc-4.7.3.orig/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200 ++++ gcc-4.7.3/gcc/config/i386/linux64.h 2013-09-16 15:39:42.000000000 +0200 +@@ -31,3 +31,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 -Nur gcc-4.7.3.orig/gcc/config/i386/linux.h gcc-4.7.3/gcc/config/i386/linux.h +--- gcc-4.7.3.orig/gcc/config/i386/linux.h 2011-06-03 20:30:39.000000000 +0200 ++++ gcc-4.7.3/gcc/config/i386/linux.h 2013-09-16 15:39:42.000000000 +0200 +@@ -22,3 +22,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 -Nur gcc-4.7.3.orig/gcc/config/linux.h gcc-4.7.3/gcc/config/linux.h +--- gcc-4.7.3.orig/gcc/config/linux.h 2012-08-14 15:59:04.000000000 +0200 ++++ gcc-4.7.3/gcc/config/linux.h 2013-09-16 15:39:42.000000000 +0200 +@@ -33,10 +33,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() \ +@@ -54,18 +56,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 */ +@@ -85,21 +90,21 @@ + + #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) + + /* Determine whether the entire c99 runtime + is present in the runtime library. */ + #undef TARGET_C99_FUNCTIONS +-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) ++#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL) + + /* Whether we have sincos that follows the GNU extension. */ + #undef TARGET_HAS_SINCOS +@@ -108,3 +113,74 @@ + /* 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 +diff -Nur gcc-4.7.3.orig/gcc/config/linux.opt gcc-4.7.3/gcc/config/linux.opt +--- gcc-4.7.3.orig/gcc/config/linux.opt 2010-09-29 16:51:52.000000000 +0200 ++++ gcc-4.7.3/gcc/config/linux.opt 2013-09-16 15:39:42.000000000 +0200 +@@ -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 -Nur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linux.h +--- gcc-4.7.3.orig/gcc/config/mips/linux.h 2011-07-19 20:00:27.000000000 +0200 ++++ gcc-4.7.3/gcc/config/mips/linux.h 2013-09-16 15:39:43.000000000 +0200 +@@ -19,3 +19,5 @@ + . */ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++ ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" +diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h +--- gcc-4.7.3.orig/gcc/config/rs6000/linux64.h 2012-03-12 17:16:51.000000000 +0100 ++++ gcc-4.7.3/gcc/config/rs6000/linux64.h 2013-09-16 15:39:43.000000000 +0200 +@@ -362,17 +362,21 @@ + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" + #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) + + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ +diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h +--- gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 +0200 ++++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2013-09-16 15:39:43.000000000 +0200 +@@ -804,15 +808,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} \ +diff -Nur gcc-4.7.3.orig/gcc/config.gcc gcc-4.7.3/gcc/config.gcc +--- gcc-4.7.3.orig/gcc/config.gcc 2013-03-06 23:54:11.000000000 +0100 ++++ gcc-4.7.3/gcc/config.gcc 2013-09-16 15:39:43.000000000 +0200 +@@ -522,7 +522,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" + + # Common parts for widely ported systems. + case ${target} in +@@ -625,6 +625,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" + ;; +@@ -2092,6 +2095,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 -Nur gcc-4.7.3.orig/gcc/configure gcc-4.7.3/gcc/configure +--- gcc-4.7.3.orig/gcc/configure 2013-02-06 16:23:55.000000000 +0100 ++++ gcc-4.7.3/gcc/configure 2013-09-16 15:39:43.000000000 +0200 +@@ -26815,7 +26815,8 @@ + gcc_cv_libc_provides_ssp=yes + fi + ;; +- *-*-gnu*) ++ *-*-gnu* | \ ++ *-linux-musl*) + # Avoid complicated tests (see + # ) and for now + # simply assert that glibc does provide this, which is true for all +@@ -26902,6 +26903,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 -Nur gcc-4.7.3.orig/gcc/configure.ac gcc-4.7.3/gcc/configure.ac +--- gcc-4.7.3.orig/gcc/configure.ac 2013-02-06 16:23:55.000000000 +0100 ++++ gcc-4.7.3/gcc/configure.ac 2013-09-16 15:39:43.000000000 +0200 +@@ -4692,7 +4692,8 @@ + gcc_cv_libc_provides_ssp=yes + fi] + ;; +- *-*-gnu*) ++ *-*-gnu* | \ ++ *-linux-musl*) + # Avoid complicated tests (see + # ) and for now + # simply assert that glibc does provide this, which is true for all +@@ -4762,6 +4763,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 +diff -Nur gcc-4.7.3.orig/gcc/ginclude/stddef.h gcc-4.7.3/gcc/ginclude/stddef.h +--- gcc-4.7.3.orig/gcc/ginclude/stddef.h 2012-02-12 02:06:04.000000000 +0100 ++++ gcc-4.7.3/gcc/ginclude/stddef.h 2013-09-16 15:39:43.000000000 +0200 +@@ -184,6 +184,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 +@@ -200,6 +201,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. */ +@@ -215,6 +217,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 */ +diff -Nur gcc-4.7.3.orig/libgcc/unwind-dw2-fde-dip.c gcc-4.7.3/libgcc/unwind-dw2-fde-dip.c +--- gcc-4.7.3.orig/libgcc/unwind-dw2-fde-dip.c 2012-10-06 23:55:06.000000000 +0200 ++++ gcc-4.7.3/libgcc/unwind-dw2-fde-dip.c 2013-09-16 15:39:43.000000000 +0200 +@@ -47,28 +47,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))) +-# 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__) ++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) + # define USE_PT_GNU_EH_FRAME ++# ifdef __OpenBSD__ ++# define ElfW(type) Elf_##typ ++# elif defined(__FreeBSD__) && __FreeBSD__ >= 7 ++# define ElfW __ElfN ++# endif + #endif + + #if defined(USE_PT_GNU_EH_FRAME) +diff -Nur gcc-4.7.3.orig/libgomp/config/posix/time.c gcc-4.7.3/libgomp/config/posix/time.c +--- gcc-4.7.3.orig/libgomp/config/posix/time.c 2009-04-09 17:00:19.000000000 +0200 ++++ gcc-4.7.3/libgomp/config/posix/time.c 2013-09-16 15:39:43.000000000 +0200 +@@ -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 + #if TIME_WITH_SYS_TIME +diff -Nur gcc-4.7.3.orig/libitm/config/arm/hwcap.cc gcc-4.7.3/libitm/config/arm/hwcap.cc +--- gcc-4.7.3.orig/libitm/config/arm/hwcap.cc 2011-12-15 04:24:05.000000000 +0100 ++++ gcc-4.7.3/libitm/config/arm/hwcap.cc 2013-09-16 15:39:43.000000000 +0200 +@@ -40,7 +40,11 @@ + + #ifdef __linux__ + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + + static void __attribute__((constructor)) +diff -Nur gcc-4.7.3.orig/libitm/config/linux/x86/tls.h gcc-4.7.3/libitm/config/linux/x86/tls.h +--- gcc-4.7.3.orig/libitm/config/linux/x86/tls.h 2011-11-08 12:13:41.000000000 +0100 ++++ gcc-4.7.3/libitm/config/linux/x86/tls.h 2013-09-16 15:39:43.000000000 +0200 +@@ -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 +diff -Nur gcc-4.7.3.orig/libssp/configure gcc-4.7.3/libssp/configure +--- gcc-4.7.3.orig/libssp/configure 2012-08-06 16:34:27.000000000 +0200 ++++ gcc-4.7.3/libssp/configure 2013-09-16 15:39:43.000000000 +0200 +@@ -626,6 +626,8 @@ + ssp_have_usable_vsnprintf + EGREP + GREP ++LIBSSP_IN_LIBC_FALSE ++LIBSSP_IN_LIBC_TRUE + LIBSSP_USE_SYMVER_SUN_FALSE + LIBSSP_USE_SYMVER_SUN_TRUE + LIBSSP_USE_SYMVER_GNU_FALSE +@@ -735,6 +737,7 @@ + enable_multilib + enable_dependency_tracking + enable_symvers ++enable_ssp_in_libc + enable_shared + enable_static + with_pic +@@ -1374,6 +1377,7 @@ + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --disable-symvers disable symbol versioning for libssp ++ --enable-ssp-in-libc do not build SSP, as it is in libc + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] +@@ -4206,6 +4210,36 @@ + fi + + ++# musl provides libssp in libc ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libssp is provided in libc" >&5 ++$as_echo_n "checking whether libssp is provided in libc... " >&6; } ++# Check whether --enable-ssp_in_libc was given. ++if test "${enable_ssp_in_libc+set}" = set; then : ++ enableval=$enable_ssp_in_libc; ssp_in_libc=$enableval ++else ++ ssp_in_libc=check ++fi ++ ++if test "x$ssp_in_libc" = "xcheck"; then ++ case "$host" in ++ *-musl*) ++ ssp_in_libc=yes ++ ;; ++ ++ *) ++ ssp_in_libc=no ++ ;; ++ esac ++fi ++ if test "x$ssp_in_libc" = xyes; then ++ LIBSSP_IN_LIBC_TRUE= ++ LIBSSP_IN_LIBC_FALSE='#' ++else ++ LIBSSP_IN_LIBC_TRUE='#' ++ LIBSSP_IN_LIBC_FALSE= ++fi ++ ++ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 + $as_echo_n "checking for grep that handles long lines and -e... " >&6; } +@@ -10650,7 +10684,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10653 "configure" ++#line 10687 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10756,7 +10790,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10759 "configure" ++#line 10793 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11185,6 +11219,10 @@ + as_fn_error "conditional \"LIBSSP_USE_SYMVER_SUN\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${LIBSSP_IN_LIBC_TRUE}" && test -z "${LIBSSP_IN_LIBC_FALSE}"; then ++ as_fn_error "conditional \"LIBSSP_IN_LIBC\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + + : ${CONFIG_STATUS=./config.status} + ac_write_fail=0 +diff -Nur gcc-4.7.3.orig/libssp/configure.ac gcc-4.7.3/libssp/configure.ac +--- gcc-4.7.3.orig/libssp/configure.ac 2012-05-31 20:59:34.000000000 +0200 ++++ gcc-4.7.3/libssp/configure.ac 2013-09-16 15:39:43.000000000 +0200 +@@ -114,6 +114,26 @@ + AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu]) + AM_CONDITIONAL(LIBSSP_USE_SYMVER_SUN, [test "x$ssp_use_symver" = xsun]) + ++# musl provides libssp in libc ++AC_MSG_CHECKING([whether libssp is provided in libc]) ++AC_ARG_ENABLE(ssp_in_libc, ++AC_HELP_STRING([--enable-ssp-in-libc], ++ [do not build SSP, as it is in libc]), ++ssp_in_libc=$enableval, ++ssp_in_libc=check) ++if test "x$ssp_in_libc" = "xcheck"; then ++ case "$host" in ++ *-musl*) ++ ssp_in_libc=yes ++ ;; ++ ++ *) ++ ssp_in_libc=no ++ ;; ++ esac ++fi ++AM_CONDITIONAL(LIBSSP_IN_LIBC, [test "x$ssp_in_libc" = xyes]) ++ + AC_CHECK_HEADERS(alloca.h malloc.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h) + + if test x$gcc_no_link = xyes; then +diff -Nur gcc-4.7.3.orig/libssp/Makefile.am gcc-4.7.3/libssp/Makefile.am +--- gcc-4.7.3.orig/libssp/Makefile.am 2010-12-06 01:50:04.000000000 +0100 ++++ gcc-4.7.3/libssp/Makefile.am 2013-09-16 15:39:43.000000000 +0200 +@@ -36,7 +36,11 @@ + + AM_CFLAGS = -Wall + ++if LIBSSP_IN_LIBC ++toolexeclib_LTLIBRARIES = libssp_nonshared.la ++else + toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la ++endif + + target_noncanonical = @target_noncanonical@ + libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include +diff -Nur gcc-4.7.3.orig/libssp/Makefile.in gcc-4.7.3/libssp/Makefile.in +--- gcc-4.7.3.orig/libssp/Makefile.in 2011-02-13 12:45:53.000000000 +0100 ++++ gcc-4.7.3/libssp/Makefile.in 2013-09-16 15:39:43.000000000 +0200 +@@ -93,12 +93,17 @@ + libssp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libssp_la_LDFLAGS) $(LDFLAGS) -o $@ ++@LIBSSP_IN_LIBC_FALSE@am_libssp_la_rpath = -rpath $(toolexeclibdir) + am_libssp_nonshared_la_OBJECTS = libssp_nonshared_la-ssp-local.lo + libssp_nonshared_la_OBJECTS = $(am_libssp_nonshared_la_OBJECTS) + libssp_nonshared_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libssp_nonshared_la_CFLAGS) $(CFLAGS) \ + $(libssp_nonshared_la_LDFLAGS) $(LDFLAGS) -o $@ ++@LIBSSP_IN_LIBC_FALSE@am_libssp_nonshared_la_rpath = -rpath \ ++@LIBSSP_IN_LIBC_FALSE@ $(toolexeclibdir) ++@LIBSSP_IN_LIBC_TRUE@am_libssp_nonshared_la_rpath = -rpath \ ++@LIBSSP_IN_LIBC_TRUE@ $(toolexeclibdir) + DEFAULT_INCLUDES = -I.@am__isrc@ + depcomp = $(SHELL) $(top_srcdir)/../depcomp + am__depfiles_maybe = depfiles +@@ -258,7 +263,8 @@ + @LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map + @LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = ssp.map-sun + AM_CFLAGS = -Wall +-toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la ++@LIBSSP_IN_LIBC_FALSE@toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la ++@LIBSSP_IN_LIBC_TRUE@toolexeclib_LTLIBRARIES = libssp_nonshared.la + libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include + nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h + libssp_la_SOURCES = \ +@@ -414,9 +420,9 @@ + rm -f "$${dir}/so_locations"; \ + done + libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES) +- $(libssp_la_LINK) -rpath $(toolexeclibdir) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) ++ $(libssp_la_LINK) $(am_libssp_la_rpath) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) + libssp_nonshared.la: $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_DEPENDENCIES) +- $(libssp_nonshared_la_LINK) -rpath $(toolexeclibdir) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS) ++ $(libssp_nonshared_la_LINK) $(am_libssp_nonshared_la_rpath) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) +diff -Nur gcc-4.7.3.orig/libstdc++-v3/configure.host gcc-4.7.3/libstdc++-v3/configure.host +--- gcc-4.7.3.orig/libstdc++-v3/configure.host 2012-12-18 15:27:14.000000000 +0100 ++++ gcc-4.7.3/libstdc++-v3/configure.host 2013-09-16 15:39:43.000000000 +0200 +@@ -243,6 +243,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 +@@ -251,6 +258,9 @@ + os_include_dir="os/gnu-linux" + fi + ;; ++ ++ esac ++ ;; + hpux*) + os_include_dir="os/hpux" + ;; diff --git a/package/gcc/patches/4.7.3/musl-m68k.patch b/package/gcc/patches/4.7.3/musl-m68k.patch new file mode 100644 index 000000000..54c7e0eef --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-m68k.patch @@ -0,0 +1,11 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/m68k/linux.h gcc-4.7.3/gcc/config/m68k/linux.h +--- gcc-4.7.3.orig/gcc/config/m68k/linux.h 2011-11-27 00:57:37.000000000 +0100 ++++ gcc-4.7.3/gcc/config/m68k/linux.h 2013-09-28 22:37:22.000000000 +0200 +@@ -73,6 +73,7 @@ + done. */ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" + + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ diff --git a/package/gcc/patches/4.7.3/musl-mips64.patch b/package/gcc/patches/4.7.3/musl-mips64.patch new file mode 100644 index 000000000..671ba9f28 --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-mips64.patch @@ -0,0 +1,14 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/mips/linux64.h gcc-4.7.3/gcc/config/mips/linux64.h +--- gcc-4.7.3.orig/gcc/config/mips/linux64.h 2011-07-19 20:00:27.000000000 +0200 ++++ gcc-4.7.3/gcc/config/mips/linux64.h 2013-09-17 09:24:36.000000000 +0200 +@@ -28,6 +28,9 @@ + #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" + #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1" + #define GNU_USER_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ +- BIONIC_DYNAMIC_LINKERN32) ++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) diff --git a/package/gcc/patches/4.7.3/musl-ppc.patch b/package/gcc/patches/4.7.3/musl-ppc.patch new file mode 100644 index 000000000..f4211ee73 --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-ppc.patch @@ -0,0 +1,155 @@ +diff -Nur gcc-4.7.3.orig/libgcc/config/rs6000/linux-unwind.h gcc-4.7.3/libgcc/config/rs6000/linux-unwind.h +--- gcc-4.7.3.orig/libgcc/config/rs6000/linux-unwind.h 2011-11-12 18:20:58.000000000 +0100 ++++ gcc-4.7.3/libgcc/config/rs6000/linux-unwind.h 2013-09-15 18:29:20.000000000 +0200 +@@ -27,7 +27,6 @@ + #define R_CR2 70 + #define R_VR0 77 + #define R_VRSAVE 109 +-#define R_VSCR 110 + + struct gcc_vregs + { +@@ -176,38 +175,6 @@ + } + #endif + +-/* Find an entry in the process auxiliary vector. The canonical way to +- test for VMX is to look at AT_HWCAP. */ +- +-static long +-ppc_linux_aux_vector (long which) +-{ +- /* __libc_stack_end holds the original stack passed to a process. */ +- extern long *__libc_stack_end; +- long argc; +- char **argv; +- char **envp; +- struct auxv +- { +- long a_type; +- long a_val; +- } *auxp; +- +- /* The Linux kernel puts argc first on the stack. */ +- argc = __libc_stack_end[0]; +- /* Followed by argv, NULL terminated. */ +- argv = (char **) __libc_stack_end + 1; +- /* Followed by environment string pointers, NULL terminated. */ +- envp = argv + argc + 1; +- while (*envp++) +- continue; +- /* Followed by the aux vector, zero terminated. */ +- for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) +- if (auxp->a_type == which) +- return auxp->a_val; +- return 0; +-} +- + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +@@ -217,8 +184,8 @@ + ppc_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) + { +- static long hwcap = 0; + struct gcc_regs *regs = get_regs (context); ++ struct gcc_vregs *vregs; + long new_cfa; + int i; + +@@ -230,12 +197,15 @@ + fs->regs.cfa_reg = STACK_POINTER_REGNUM; + fs->regs.cfa_offset = new_cfa - (long) context->cfa; + +- for (i = 0; i < 32; i++) +- if (i != STACK_POINTER_REGNUM) +- { +- fs->regs.reg[i].how = REG_SAVED_OFFSET; +- fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; +- } ++#ifdef __powerpc64__ ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long) ®s->gpr[2] - new_cfa; ++#endif ++ for (i = 14; i < 32; i++) ++ { ++ fs->regs.reg[i].how = REG_SAVED_OFFSET; ++ fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; ++ } + + fs->regs.reg[R_CR2].how = REG_SAVED_OFFSET; + /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit +@@ -251,57 +221,35 @@ + fs->retaddr_column = ARG_POINTER_REGNUM; + fs->signal_frame = 1; + +- if (hwcap == 0) ++ /* If we have a FPU... */ ++ for (i = 14; i < 32; i++) + { +- hwcap = ppc_linux_aux_vector (16); +- /* These will already be set if we found AT_HWCAP. A nonzero +- value stops us looking again if for some reason we couldn't +- find AT_HWCAP. */ +-#ifdef __powerpc64__ +- hwcap |= 0xc0000000; +-#else +- hwcap |= 0x80000000; +-#endif ++ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; ++ fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; + } + +- /* If we have a FPU... */ +- if (hwcap & 0x08000000) +- for (i = 0; i < 32; i++) +- { +- fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; +- fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; +- } +- + /* If we have a VMX unit... */ +- if (hwcap & 0x10000000) +- { +- struct gcc_vregs *vregs; + #ifdef __powerpc64__ +- vregs = regs->vp; ++ vregs = regs->vp; + #else +- vregs = ®s->vregs; ++ vregs = ®s->vregs; + #endif +- if (regs->msr & (1 << 25)) ++ if (regs->msr & (1 << 25)) ++ { ++ for (i = 20; i < 32; i++) + { +- for (i = 0; i < 32; i++) +- { +- fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET; +- fs->regs.reg[i + R_VR0].loc.offset +- = (long) &vregs->vr[i] - new_cfa; +- } +- +- fs->regs.reg[R_VSCR].how = REG_SAVED_OFFSET; +- fs->regs.reg[R_VSCR].loc.offset = (long) &vregs->vscr - new_cfa; ++ fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[i + R_VR0].loc.offset = (long) &vregs->vr[i] - new_cfa; + } +- +- fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET; +- fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa; + } + ++ fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET; ++ fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa; ++ + /* If we have SPE register high-parts... we check at compile-time to + avoid expanding the code for all other PowerPC. */ + #ifdef __SPE__ +- for (i = 0; i < 32; i++) ++ for (i = 14; i < 32; i++) + { + fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET; + fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset diff --git a/package/gcc/patches/4.7.3/musl-sh.patch b/package/gcc/patches/4.7.3/musl-sh.patch new file mode 100644 index 000000000..7738f266e --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-sh.patch @@ -0,0 +1,11 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/sh/linux.h gcc-4.7.3/gcc/config/sh/linux.h +--- gcc-4.7.3.orig/gcc/config/sh/linux.h 2013-03-25 23:55:56.000000000 +0100 ++++ gcc-4.7.3/gcc/config/sh/linux.h 2013-09-26 21:16:39.000000000 +0200 +@@ -46,6 +46,7 @@ + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh.1" + + #undef SUBTARGET_LINK_EMUL_SUFFIX + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" diff --git a/package/gcc/patches/4.7.3/musl-sparc.patch b/package/gcc/patches/4.7.3/musl-sparc.patch new file mode 100644 index 000000000..228b8522d --- /dev/null +++ b/package/gcc/patches/4.7.3/musl-sparc.patch @@ -0,0 +1,24 @@ +diff -Nur gcc-4.7.3.orig/gcc/config/sparc/linux64.h gcc-4.7.3/gcc/config/sparc/linux64.h +--- gcc-4.7.3.orig/gcc/config/sparc/linux64.h 2011-11-12 02:05:07.000000000 +0100 ++++ gcc-4.7.3/gcc/config/sparc/linux64.h 2013-09-19 11:37:50.000000000 +0200 +@@ -95,6 +95,9 @@ + + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.1" ++ + + #ifdef SPARC_BI_ARCH + +diff -Nur gcc-4.7.3.orig/gcc/config/sparc/linux.h gcc-4.7.3/gcc/config/sparc/linux.h +--- gcc-4.7.3.orig/gcc/config/sparc/linux.h 2011-11-12 02:05:07.000000000 +0100 ++++ gcc-4.7.3/gcc/config/sparc/linux.h 2013-09-19 11:37:12.000000000 +0200 +@@ -85,6 +85,7 @@ + done. */ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sparc.1" + + #undef LINK_SPEC + #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ diff --git a/package/gcc/patches/4.7.3/sdt.patch b/package/gcc/patches/4.7.3/sdt.patch new file mode 100644 index 000000000..7ee2cf1b7 --- /dev/null +++ b/package/gcc/patches/4.7.3/sdt.patch @@ -0,0 +1,14 @@ +diff -Nur gcc-4.7.2.orig/libgcc/unwind-dw2.c gcc-4.7.2/libgcc/unwind-dw2.c +--- gcc-4.7.2.orig/libgcc/unwind-dw2.c 2011-11-02 16:26:35.000000000 +0100 ++++ gcc-4.7.2/libgcc/unwind-dw2.c 2012-09-22 21:56:06.000000000 +0200 +@@ -38,10 +38,6 @@ + #include "gthr.h" + #include "unwind-dw2.h" + +-#ifdef HAVE_SYS_SDT_H +-#include +-#endif +- + #ifndef __USING_SJLJ_EXCEPTIONS__ + + #ifndef STACK_GROWS_DOWNWARD diff --git a/package/gcc/patches/4.8.2/patch-libatomic_Makefile_in b/package/gcc/patches/4.8.2/patch-libatomic_Makefile_in new file mode 100644 index 000000000..e67a62dd3 --- /dev/null +++ b/package/gcc/patches/4.8.2/patch-libatomic_Makefile_in @@ -0,0 +1,12 @@ +--- gcc-4.8.2.orig/libatomic/Makefile.in 2013-10-16 09:27:58.000000000 +0200 ++++ gcc-4.8.2/libatomic/Makefile.in 2014-01-01 11:37:38.000000000 +0100 +@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT)) + PAT_S = $(word 3,$(PAT_SPLIT)) + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_FALSE@M_DEPS = + M_SIZE = -DN=$(PAT_N) + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) + M_FILE = $(PAT_BASE)_n.c diff --git a/package/gcc/patches/cflags.patch b/package/gcc/patches/cflags.patch deleted file mode 100644 index 3623d3872..000000000 --- a/package/gcc/patches/cflags.patch +++ /dev/null @@ -1,253 +0,0 @@ - - This patch brings over a few features from MirBSD: - * -fhonour-copts - If this option is not given, it's warned (depending - on environment variables). This is to catch errors - of misbuilt packages which override CFLAGS themselves. - * -Werror-maybe-reset - Has the effect of -Wno-error if GCC_NO_WERROR is - set and not '0', a no-operation otherwise. This is - to be able to use -Werror in "make" but prevent - GNU autoconf generated configure scripts from - freaking out. - * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks - the default for -O2/-Os, because they trigger gcc bugs - and can delete code with security implications. - - This patch was authored by Thorsten Glaser - with copyright assignment to the FSF in effect. - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -103,6 +103,9 @@ static size_t deferred_count; - /* Number of deferred options scanned for -include. */ - static size_t include_cursor; - -+/* Check if a port honours COPTS. */ -+static int honour_copts = 0; -+ - static void handle_OPT_d (const char *); - static void set_std_cxx98 (int); - static void set_std_cxx0x (int); -@@ -441,6 +444,9 @@ c_common_handle_option (size_t scode, co - global_dc->warning_as_error_requested = value; - break; - -+ case OPT_Werror_maybe_reset: -+ break; -+ - case OPT_Wformat: - set_Wformat (value); - break; -@@ -584,6 +590,12 @@ c_common_handle_option (size_t scode, co - flag_no_builtin = !value; - break; - -+ case OPT_fhonour_copts: -+ if (c_language == clk_c) { -+ honour_copts++; -+ } -+ break; -+ - case OPT_fconstant_string_class_: - constant_string_class_name = arg; - break; -@@ -1058,6 +1070,47 @@ c_common_init (void) - return false; - } - -+ if (c_language == clk_c) { -+ char *ev = getenv ("GCC_HONOUR_COPTS"); -+ int evv; -+ if (ev == NULL) -+ evv = -1; -+ else if ((*ev == '0') || (*ev == '\0')) -+ evv = 0; -+ else if (*ev == '1') -+ evv = 1; -+ else if (*ev == '2') -+ evv = 2; -+ else if (*ev == 's') -+ evv = -1; -+ else { -+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); -+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ -+ } -+ if (evv == 1) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in lenient mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ warning (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } else if (evv == 2) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in strict mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ error ("someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ return false; -+ } -+ } else if (evv == 0) { -+ if (honour_copts != 1) -+ inform (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } -+ - return true; - } - ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -363,6 +363,10 @@ Werror-implicit-function-declaration - C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration) - This switch is deprecated; use -Werror=implicit-function-declaration instead - -+Werror-maybe-reset -+C ObjC C++ ObjC++ -+; Documented in common.opt -+ - Wfloat-equal - C ObjC C++ ObjC++ Var(warn_float_equal) Warning - Warn if testing floating point numbers for equality -@@ -794,6 +798,9 @@ C++ ObjC++ Optimization Alias(fexception - fhonor-std - C++ ObjC++ Ignore Warn(switch %qs is no longer supported) - -+fhonour-copts -+C ObjC C++ ObjC++ RejectNegative -+ - fhosted - C ObjC - Assume normal C execution environment ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -520,6 +520,10 @@ Werror= - Common Joined - Treat specified warning as error - -+Werror-maybe-reset -+Common -+If environment variable GCC_NO_WERROR is set, act as -Wno-error -+ - Wextra - Common Var(extra_warnings) Warning - Print extra (possibly unwanted) warnings -@@ -1156,6 +1160,9 @@ fguess-branch-probability - Common Report Var(flag_guess_branch_prob) Optimization - Enable guessing of branch probabilities - -+fhonour-copts -+Common RejectNegative -+ - ; Nonzero means ignore `#ident' directives. 0 means handle them. - ; Generate position-independent code for executables if possible - ; On SVR4 targets, it also controls whether or not to emit a ---- a/gcc/opts.c -+++ b/gcc/opts.c -@@ -477,8 +477,6 @@ static const struct default_options defa - { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 }, - #endif - { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 }, -- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, -- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, - { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 }, - { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, - { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 }, -@@ -494,6 +492,8 @@ static const struct default_options defa - { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 }, - - /* -O3 optimizations. */ -+ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 }, -+ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 }, - { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 }, - { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 }, - /* Inlining of functions reducing size is a good idea with -Os -@@ -1399,6 +1399,17 @@ common_handle_option (struct gcc_options - opts, opts_set, loc, dc); - break; - -+ case OPT_Werror_maybe_reset: -+ { -+ char *ev = getenv ("GCC_NO_WERROR"); -+ if ((ev != NULL) && (*ev != '0')) -+ warnings_are_errors = 0; -+ } -+ break; -+ -+ case OPT_fhonour_copts: -+ break; -+ - case OPT_Wlarger_than_: - opts->x_larger_than_size = value; - opts->x_warn_larger_than = value != -1; ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -164,6 +164,11 @@ in older programs. This warning is on b - Make all warnings into hard errors. Source code which triggers warnings - will be rejected. - -+ at item -Werror-maybe-reset -+ at opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ - @item -Wsystem-headers - @opindex Wsystem-headers - Issue warnings for code in system headers. These are normally unhelpful ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}. - -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol - -Wno-deprecated-declarations -Wdisabled-optimization @gol - -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol ---Wno-endif-labels -Werror -Werror=* @gol -+-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol - -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol - -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol - -Wformat-security -Wformat-y2k @gol -@@ -4497,6 +4497,22 @@ This option is only supported for C and - @option{-Wall} and by @option{-pedantic}, which can be disabled with - @option{-Wno-pointer-sign}. - -+ at item -Werror-maybe-reset -+ at opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ -+ at item -fhonour-copts -+ at opindex fhonour-copts -+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not -+given at least once, and warn if it is given more than once. -+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not -+given exactly once. -+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option -+is not given exactly once. -+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. -+This flag and environment variable only affect the C language. -+ - @item -Wstack-protector - @opindex Wstack-protector - @opindex Wno-stack-protector -@@ -6319,7 +6335,7 @@ so, the first branch is redirected to ei - second branch or a point immediately following it, depending on whether - the condition is known to be true or false. - --Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. -+Enabled at levels @option{-O3}. - - @item -fsplit-wide-types - @opindex fsplit-wide-types ---- a/gcc/java/jvspec.c -+++ b/gcc/java/jvspec.c -@@ -627,6 +627,7 @@ lang_specific_pre_link (void) - class name. Append dummy `.c' that can be stripped by set_input so %b - is correct. */ - set_input (concat (main_class_name, "main.c", NULL)); -+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ - err = do_spec (jvgenmain_spec); - if (err == 0) - { diff --git a/package/gcc/patches/cross-gcc-fix.patch b/package/gcc/patches/cross-gcc-fix.patch deleted file mode 100644 index f39b35fb9..000000000 --- a/package/gcc/patches/cross-gcc-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nur gcc-4.4.2.orig/gcc/Makefile.in gcc-4.4.2/gcc/Makefile.in ---- gcc-4.5.2.orig/gcc/Makefile.in 2010-09-02 15:05:30.000000000 +0200 -+++ gcc-4.5.2/gcc/Makefile.in 2011-01-15 14:29:18.000000000 +0100 -@@ -980,7 +980,8 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $ - # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro - # puts -I options in CPPFLAGS, our include files in the srcdir will always - # win against random include files in /usr/include. --ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) -+#ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) -+ALL_CPPFLAGS = $(INCLUDES) - - # This is the variable to use when using $(COMPILER). - ifneq ($(ENABLE_BUILD_WITH_CXX),yes) diff --git a/package/gcc/patches/gcc-cppflags.patch b/package/gcc/patches/gcc-cppflags.patch deleted file mode 100644 index 0971bbec9..000000000 --- a/package/gcc/patches/gcc-cppflags.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur gcc-4.4.4.orig/gcc/configure gcc-4.4.4/gcc/configure ---- gcc-4.4.4.orig/gcc/configure 2009-10-19 14:15:27.000000000 +0200 -+++ gcc-4.4.4/gcc/configure 2010-08-02 00:47:36.823620346 +0200 -@@ -13530,7 +13530,7 @@ - esac - saved_CFLAGS="${CFLAGS}" - CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ -- LDFLAGS="${LDFLAGS_FOR_BUILD}" \ -+ LDFLAGS="${LDFLAGS_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ - ${realsrcdir}/configure \ - --enable-languages=${enable_languages-all} \ - --target=$target_alias --host=$build_alias --build=$build_alias diff --git a/package/gcc/patches/ltmain.patch b/package/gcc/patches/ltmain.patch deleted file mode 100644 index 215889b70..000000000 --- a/package/gcc/patches/ltmain.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur gcc-4.5.2.orig/ltmain.sh gcc-4.5.2/ltmain.sh ---- gcc-4.5.2.orig/ltmain.sh 2009-12-05 18:18:53.000000000 +0100 -+++ gcc-4.5.2/ltmain.sh 2011-01-15 14:45:07.000000000 +0100 -@@ -4980,7 +4980,7 @@ - # @file GCC response files - # -tp=* Portland pgcc target processor selection - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) -+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|-fstack-protector*|-flto) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" diff --git a/package/gcc/patches/mirbsd-compat.patch b/package/gcc/patches/mirbsd-compat.patch deleted file mode 100644 index 2f3ea0c87..000000000 --- a/package/gcc/patches/mirbsd-compat.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur gcc-4.4.2.orig/gcc/configure gcc-4.4.2/gcc/configure ---- gcc-4.4.2.orig/gcc/configure Tue Mar 24 18:45:39 2009 -+++ gcc-4.4.2/gcc/configure Sat Dec 19 21:07:07 2009 -@@ -19381,7 +19381,7 @@ - dynamic_linker='ldqnx.so' - ;; - --openbsd*) -+mirbsd*|openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no diff --git a/package/gcc/patches/musl-cris.patch b/package/gcc/patches/musl-cris.patch deleted file mode 100644 index 4889263a1..000000000 --- a/package/gcc/patches/musl-cris.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur gcc-4.7.3.orig/gcc/config/cris/linux.h gcc-4.7.3/gcc/config/cris/linux.h ---- gcc-4.7.3.orig/gcc/config/cris/linux.h 2011-04-11 20:46:05.000000000 +0200 -+++ gcc-4.7.3/gcc/config/cris/linux.h 2013-10-11 10:01:51.000000000 +0200 -@@ -104,6 +104,7 @@ - #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG - - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-cris.1" - - #undef CRIS_LINK_SUBTARGET_SPEC - #define CRIS_LINK_SUBTARGET_SPEC \ diff --git a/package/gcc/patches/musl-cross.patch b/package/gcc/patches/musl-cross.patch deleted file mode 100644 index 453ba9aec..000000000 --- a/package/gcc/patches/musl-cross.patch +++ /dev/null @@ -1,825 +0,0 @@ -diff -Nur gcc-4.7.3.orig/config.sub gcc-4.7.3/config.sub ---- gcc-4.7.3.orig/config.sub 2012-08-06 16:34:27.000000000 +0200 -+++ gcc-4.7.3/config.sub 2013-09-16 15:39:42.000000000 +0200 -@@ -4,7 +4,7 @@ - # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - # 2011 Free Software Foundation, Inc. - --timestamp='2011-10-29' -+timestamp='2011-03-23' - - # This file is (in principle) common to ALL GNU software. - # The presence of a machine in this file suggests that SOME GNU software -@@ -125,6 +125,7 @@ - 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* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ -@@ -251,17 +252,13 @@ - | 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 \ -- | be32 | be64 \ - | bfin \ - | c4x | 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 \ -- | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ -@@ -295,7 +292,7 @@ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ -- | rl78 | rx \ -+ | 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 \ -@@ -304,7 +301,7 @@ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ -- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ -+ | v850 | v850e \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) -@@ -361,7 +358,6 @@ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ -- | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ -@@ -370,10 +366,8 @@ - | 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-* \ -- | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -@@ -407,7 +401,7 @@ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ -- | rl78-* | romp-* | rs6000-* | rx-* \ -+ | 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-* \ -@@ -415,11 +409,10 @@ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ -- | tile*-* \ -+ | tile-* | tilegx-* \ - | tron-* \ - | ubicom32-* \ -- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ -- | vax-* \ -+ | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ -@@ -820,10 +813,6 @@ - basic_machine=i370-ibm - os=-mvs - ;; -- nacl) -- basic_machine=le32-unknown -- os=-nacl -- ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 -@@ -1132,8 +1121,13 @@ - basic_machine=t90-cray - os=-unicos - ;; -+ # This must be matched before tile*. -+ tilegx*) -+ basic_machine=tilegx-unknown -+ os=-linux-gnu -+ ;; - tile*) -- basic_machine=$basic_machine-unknown -+ basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) -@@ -1346,6 +1340,7 @@ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ -+ | -linux-musl* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ -diff -Nur gcc-4.7.3.orig/fixincludes/mkfixinc.sh gcc-4.7.3/fixincludes/mkfixinc.sh ---- gcc-4.7.3.orig/fixincludes/mkfixinc.sh 2011-09-22 16:00:17.000000000 +0200 -+++ gcc-4.7.3/fixincludes/mkfixinc.sh 2013-09-16 15:39:42.000000000 +0200 -@@ -20,7 +20,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} -diff -Nur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h ---- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h 2011-11-02 16:03:19.000000000 +0100 -+++ gcc-4.7.3/gcc/config/arm/linux-eabi.h 2013-09-16 15:39:42.000000000 +0200 -@@ -64,6 +64,23 @@ - #undef GLIBC_DYNAMIC_LINKER - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" - -+/* For ARM musl currently supports two 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. -+ musl does not support the legacy OABI (i.e. broken) mode. -+ All the dynamic linkers live in /lib. -+ We default to soft-float, but this can be overridden by changing both -+ MUSL_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ -+#undef MUSL_DYNAMIC_LINKER -+#define MUSL_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1" -+#define MUSL_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1" -+#define MUSL_DYNAMIC_LINKER_DEFAULT MUSL_DYNAMIC_LINKER_SOFT_FLOAT -+ -+#define MUSL_DYNAMIC_LINKER \ -+ "%{mfloat-abi=hard:" MUSL_DYNAMIC_LINKER_HARD_FLOAT "} \ -+ %{mfloat-abi=soft*:" MUSL_DYNAMIC_LINKER_SOFT_FLOAT "} \ -+ %{!mfloat-abi=*:" MUSL_DYNAMIC_LINKER_DEFAULT "}" -+ - /* 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 -Nur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h ---- gcc-4.7.3.orig/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200 -+++ gcc-4.7.3/gcc/config/i386/linux64.h 2013-09-16 15:39:42.000000000 +0200 -@@ -31,3 +31,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 -Nur gcc-4.7.3.orig/gcc/config/i386/linux.h gcc-4.7.3/gcc/config/i386/linux.h ---- gcc-4.7.3.orig/gcc/config/i386/linux.h 2011-06-03 20:30:39.000000000 +0200 -+++ gcc-4.7.3/gcc/config/i386/linux.h 2013-09-16 15:39:42.000000000 +0200 -@@ -22,3 +22,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 -Nur gcc-4.7.3.orig/gcc/config/linux.h gcc-4.7.3/gcc/config/linux.h ---- gcc-4.7.3.orig/gcc/config/linux.h 2012-08-14 15:59:04.000000000 +0200 -+++ gcc-4.7.3/gcc/config/linux.h 2013-09-16 15:39:42.000000000 +0200 -@@ -33,10 +33,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() \ -@@ -54,18 +56,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 */ -@@ -85,21 +90,21 @@ - - #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) - - /* Determine whether the entire c99 runtime - is present in the runtime library. */ - #undef TARGET_C99_FUNCTIONS --#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) -+#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL) - - /* Whether we have sincos that follows the GNU extension. */ - #undef TARGET_HAS_SINCOS -@@ -108,3 +113,74 @@ - /* 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 -diff -Nur gcc-4.7.3.orig/gcc/config/linux.opt gcc-4.7.3/gcc/config/linux.opt ---- gcc-4.7.3.orig/gcc/config/linux.opt 2010-09-29 16:51:52.000000000 +0200 -+++ gcc-4.7.3/gcc/config/linux.opt 2013-09-16 15:39:42.000000000 +0200 -@@ -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 -Nur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linux.h ---- gcc-4.7.3.orig/gcc/config/mips/linux.h 2011-07-19 20:00:27.000000000 +0200 -+++ gcc-4.7.3/gcc/config/mips/linux.h 2013-09-16 15:39:43.000000000 +0200 -@@ -19,3 +19,5 @@ - . */ - - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" -+ -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" -diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h ---- gcc-4.7.3.orig/gcc/config/rs6000/linux64.h 2012-03-12 17:16:51.000000000 +0100 -+++ gcc-4.7.3/gcc/config/rs6000/linux64.h 2013-09-16 15:39:43.000000000 +0200 -@@ -362,17 +362,21 @@ - #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" - #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) - - - #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ -diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h ---- gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 +0200 -+++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2013-09-16 15:39:43.000000000 +0200 -@@ -804,15 +808,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} \ -diff -Nur gcc-4.7.3.orig/gcc/config.gcc gcc-4.7.3/gcc/config.gcc ---- gcc-4.7.3.orig/gcc/config.gcc 2013-03-06 23:54:11.000000000 +0100 -+++ gcc-4.7.3/gcc/config.gcc 2013-09-16 15:39:43.000000000 +0200 -@@ -522,7 +522,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" - - # Common parts for widely ported systems. - case ${target} in -@@ -625,6 +625,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" - ;; -@@ -2092,6 +2095,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 -Nur gcc-4.7.3.orig/gcc/configure gcc-4.7.3/gcc/configure ---- gcc-4.7.3.orig/gcc/configure 2013-02-06 16:23:55.000000000 +0100 -+++ gcc-4.7.3/gcc/configure 2013-09-16 15:39:43.000000000 +0200 -@@ -26815,7 +26815,8 @@ - gcc_cv_libc_provides_ssp=yes - fi - ;; -- *-*-gnu*) -+ *-*-gnu* | \ -+ *-linux-musl*) - # Avoid complicated tests (see - # ) and for now - # simply assert that glibc does provide this, which is true for all -@@ -26902,6 +26903,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 -Nur gcc-4.7.3.orig/gcc/configure.ac gcc-4.7.3/gcc/configure.ac ---- gcc-4.7.3.orig/gcc/configure.ac 2013-02-06 16:23:55.000000000 +0100 -+++ gcc-4.7.3/gcc/configure.ac 2013-09-16 15:39:43.000000000 +0200 -@@ -4692,7 +4692,8 @@ - gcc_cv_libc_provides_ssp=yes - fi] - ;; -- *-*-gnu*) -+ *-*-gnu* | \ -+ *-linux-musl*) - # Avoid complicated tests (see - # ) and for now - # simply assert that glibc does provide this, which is true for all -@@ -4762,6 +4763,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 -diff -Nur gcc-4.7.3.orig/gcc/ginclude/stddef.h gcc-4.7.3/gcc/ginclude/stddef.h ---- gcc-4.7.3.orig/gcc/ginclude/stddef.h 2012-02-12 02:06:04.000000000 +0100 -+++ gcc-4.7.3/gcc/ginclude/stddef.h 2013-09-16 15:39:43.000000000 +0200 -@@ -184,6 +184,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 -@@ -200,6 +201,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. */ -@@ -215,6 +217,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 */ -diff -Nur gcc-4.7.3.orig/libgcc/unwind-dw2-fde-dip.c gcc-4.7.3/libgcc/unwind-dw2-fde-dip.c ---- gcc-4.7.3.orig/libgcc/unwind-dw2-fde-dip.c 2012-10-06 23:55:06.000000000 +0200 -+++ gcc-4.7.3/libgcc/unwind-dw2-fde-dip.c 2013-09-16 15:39:43.000000000 +0200 -@@ -47,28 +47,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))) --# 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__) -+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) - # define USE_PT_GNU_EH_FRAME -+# ifdef __OpenBSD__ -+# define ElfW(type) Elf_##typ -+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7 -+# define ElfW __ElfN -+# endif - #endif - - #if defined(USE_PT_GNU_EH_FRAME) -diff -Nur gcc-4.7.3.orig/libgomp/config/posix/time.c gcc-4.7.3/libgomp/config/posix/time.c ---- gcc-4.7.3.orig/libgomp/config/posix/time.c 2009-04-09 17:00:19.000000000 +0200 -+++ gcc-4.7.3/libgomp/config/posix/time.c 2013-09-16 15:39:43.000000000 +0200 -@@ -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 - #if TIME_WITH_SYS_TIME -diff -Nur gcc-4.7.3.orig/libitm/config/arm/hwcap.cc gcc-4.7.3/libitm/config/arm/hwcap.cc ---- gcc-4.7.3.orig/libitm/config/arm/hwcap.cc 2011-12-15 04:24:05.000000000 +0100 -+++ gcc-4.7.3/libitm/config/arm/hwcap.cc 2013-09-16 15:39:43.000000000 +0200 -@@ -40,7 +40,11 @@ - - #ifdef __linux__ - #include -+#ifdef __GLIBC__ - #include -+#else -+#include -+#endif - #include - - static void __attribute__((constructor)) -diff -Nur gcc-4.7.3.orig/libitm/config/linux/x86/tls.h gcc-4.7.3/libitm/config/linux/x86/tls.h ---- gcc-4.7.3.orig/libitm/config/linux/x86/tls.h 2011-11-08 12:13:41.000000000 +0100 -+++ gcc-4.7.3/libitm/config/linux/x86/tls.h 2013-09-16 15:39:43.000000000 +0200 -@@ -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 -diff -Nur gcc-4.7.3.orig/libssp/configure gcc-4.7.3/libssp/configure ---- gcc-4.7.3.orig/libssp/configure 2012-08-06 16:34:27.000000000 +0200 -+++ gcc-4.7.3/libssp/configure 2013-09-16 15:39:43.000000000 +0200 -@@ -626,6 +626,8 @@ - ssp_have_usable_vsnprintf - EGREP - GREP -+LIBSSP_IN_LIBC_FALSE -+LIBSSP_IN_LIBC_TRUE - LIBSSP_USE_SYMVER_SUN_FALSE - LIBSSP_USE_SYMVER_SUN_TRUE - LIBSSP_USE_SYMVER_GNU_FALSE -@@ -735,6 +737,7 @@ - enable_multilib - enable_dependency_tracking - enable_symvers -+enable_ssp_in_libc - enable_shared - enable_static - with_pic -@@ -1374,6 +1377,7 @@ - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --disable-symvers disable symbol versioning for libssp -+ --enable-ssp-in-libc do not build SSP, as it is in libc - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] -@@ -4206,6 +4210,36 @@ - fi - - -+# musl provides libssp in libc -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libssp is provided in libc" >&5 -+$as_echo_n "checking whether libssp is provided in libc... " >&6; } -+# Check whether --enable-ssp_in_libc was given. -+if test "${enable_ssp_in_libc+set}" = set; then : -+ enableval=$enable_ssp_in_libc; ssp_in_libc=$enableval -+else -+ ssp_in_libc=check -+fi -+ -+if test "x$ssp_in_libc" = "xcheck"; then -+ case "$host" in -+ *-musl*) -+ ssp_in_libc=yes -+ ;; -+ -+ *) -+ ssp_in_libc=no -+ ;; -+ esac -+fi -+ if test "x$ssp_in_libc" = xyes; then -+ LIBSSP_IN_LIBC_TRUE= -+ LIBSSP_IN_LIBC_FALSE='#' -+else -+ LIBSSP_IN_LIBC_TRUE='#' -+ LIBSSP_IN_LIBC_FALSE= -+fi -+ -+ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 - $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -@@ -10650,7 +10684,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10653 "configure" -+#line 10687 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -10756,7 +10790,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10759 "configure" -+#line 10793 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11185,6 +11219,10 @@ - as_fn_error "conditional \"LIBSSP_USE_SYMVER_SUN\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${LIBSSP_IN_LIBC_TRUE}" && test -z "${LIBSSP_IN_LIBC_FALSE}"; then -+ as_fn_error "conditional \"LIBSSP_IN_LIBC\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - - : ${CONFIG_STATUS=./config.status} - ac_write_fail=0 -diff -Nur gcc-4.7.3.orig/libssp/configure.ac gcc-4.7.3/libssp/configure.ac ---- gcc-4.7.3.orig/libssp/configure.ac 2012-05-31 20:59:34.000000000 +0200 -+++ gcc-4.7.3/libssp/configure.ac 2013-09-16 15:39:43.000000000 +0200 -@@ -114,6 +114,26 @@ - AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu]) - AM_CONDITIONAL(LIBSSP_USE_SYMVER_SUN, [test "x$ssp_use_symver" = xsun]) - -+# musl provides libssp in libc -+AC_MSG_CHECKING([whether libssp is provided in libc]) -+AC_ARG_ENABLE(ssp_in_libc, -+AC_HELP_STRING([--enable-ssp-in-libc], -+ [do not build SSP, as it is in libc]), -+ssp_in_libc=$enableval, -+ssp_in_libc=check) -+if test "x$ssp_in_libc" = "xcheck"; then -+ case "$host" in -+ *-musl*) -+ ssp_in_libc=yes -+ ;; -+ -+ *) -+ ssp_in_libc=no -+ ;; -+ esac -+fi -+AM_CONDITIONAL(LIBSSP_IN_LIBC, [test "x$ssp_in_libc" = xyes]) -+ - AC_CHECK_HEADERS(alloca.h malloc.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h) - - if test x$gcc_no_link = xyes; then -diff -Nur gcc-4.7.3.orig/libssp/Makefile.am gcc-4.7.3/libssp/Makefile.am ---- gcc-4.7.3.orig/libssp/Makefile.am 2010-12-06 01:50:04.000000000 +0100 -+++ gcc-4.7.3/libssp/Makefile.am 2013-09-16 15:39:43.000000000 +0200 -@@ -36,7 +36,11 @@ - - AM_CFLAGS = -Wall - -+if LIBSSP_IN_LIBC -+toolexeclib_LTLIBRARIES = libssp_nonshared.la -+else - toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la -+endif - - target_noncanonical = @target_noncanonical@ - libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include -diff -Nur gcc-4.7.3.orig/libssp/Makefile.in gcc-4.7.3/libssp/Makefile.in ---- gcc-4.7.3.orig/libssp/Makefile.in 2011-02-13 12:45:53.000000000 +0100 -+++ gcc-4.7.3/libssp/Makefile.in 2013-09-16 15:39:43.000000000 +0200 -@@ -93,12 +93,17 @@ - libssp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libssp_la_LDFLAGS) $(LDFLAGS) -o $@ -+@LIBSSP_IN_LIBC_FALSE@am_libssp_la_rpath = -rpath $(toolexeclibdir) - am_libssp_nonshared_la_OBJECTS = libssp_nonshared_la-ssp-local.lo - libssp_nonshared_la_OBJECTS = $(am_libssp_nonshared_la_OBJECTS) - libssp_nonshared_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libssp_nonshared_la_CFLAGS) $(CFLAGS) \ - $(libssp_nonshared_la_LDFLAGS) $(LDFLAGS) -o $@ -+@LIBSSP_IN_LIBC_FALSE@am_libssp_nonshared_la_rpath = -rpath \ -+@LIBSSP_IN_LIBC_FALSE@ $(toolexeclibdir) -+@LIBSSP_IN_LIBC_TRUE@am_libssp_nonshared_la_rpath = -rpath \ -+@LIBSSP_IN_LIBC_TRUE@ $(toolexeclibdir) - DEFAULT_INCLUDES = -I.@am__isrc@ - depcomp = $(SHELL) $(top_srcdir)/../depcomp - am__depfiles_maybe = depfiles -@@ -258,7 +263,8 @@ - @LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map - @LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = ssp.map-sun - AM_CFLAGS = -Wall --toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la -+@LIBSSP_IN_LIBC_FALSE@toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la -+@LIBSSP_IN_LIBC_TRUE@toolexeclib_LTLIBRARIES = libssp_nonshared.la - libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include - nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h - libssp_la_SOURCES = \ -@@ -414,9 +420,9 @@ - rm -f "$${dir}/so_locations"; \ - done - libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES) -- $(libssp_la_LINK) -rpath $(toolexeclibdir) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) -+ $(libssp_la_LINK) $(am_libssp_la_rpath) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) - libssp_nonshared.la: $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_DEPENDENCIES) -- $(libssp_nonshared_la_LINK) -rpath $(toolexeclibdir) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS) -+ $(libssp_nonshared_la_LINK) $(am_libssp_nonshared_la_rpath) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS) - - mostlyclean-compile: - -rm -f *.$(OBJEXT) -diff -Nur gcc-4.7.3.orig/libstdc++-v3/configure.host gcc-4.7.3/libstdc++-v3/configure.host ---- gcc-4.7.3.orig/libstdc++-v3/configure.host 2012-12-18 15:27:14.000000000 +0100 -+++ gcc-4.7.3/libstdc++-v3/configure.host 2013-09-16 15:39:43.000000000 +0200 -@@ -243,6 +243,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 -@@ -251,6 +258,9 @@ - os_include_dir="os/gnu-linux" - fi - ;; -+ -+ esac -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; diff --git a/package/gcc/patches/musl-m68k.patch b/package/gcc/patches/musl-m68k.patch deleted file mode 100644 index 54c7e0eef..000000000 --- a/package/gcc/patches/musl-m68k.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur gcc-4.7.3.orig/gcc/config/m68k/linux.h gcc-4.7.3/gcc/config/m68k/linux.h ---- gcc-4.7.3.orig/gcc/config/m68k/linux.h 2011-11-27 00:57:37.000000000 +0100 -+++ gcc-4.7.3/gcc/config/m68k/linux.h 2013-09-28 22:37:22.000000000 +0200 -@@ -73,6 +73,7 @@ - done. */ - - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" - - #undef LINK_SPEC - #define LINK_SPEC "-m m68kelf %{shared} \ diff --git a/package/gcc/patches/musl-mips64.patch b/package/gcc/patches/musl-mips64.patch deleted file mode 100644 index 671ba9f28..000000000 --- a/package/gcc/patches/musl-mips64.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nur gcc-4.7.3.orig/gcc/config/mips/linux64.h gcc-4.7.3/gcc/config/mips/linux64.h ---- gcc-4.7.3.orig/gcc/config/mips/linux64.h 2011-07-19 20:00:27.000000000 +0200 -+++ gcc-4.7.3/gcc/config/mips/linux64.h 2013-09-17 09:24:36.000000000 +0200 -@@ -28,6 +28,9 @@ - #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" - #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" - #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1" -+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1" - #define GNU_USER_DYNAMIC_LINKERN32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ -- BIONIC_DYNAMIC_LINKERN32) -+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) diff --git a/package/gcc/patches/musl-ppc.patch b/package/gcc/patches/musl-ppc.patch deleted file mode 100644 index f4211ee73..000000000 --- a/package/gcc/patches/musl-ppc.patch +++ /dev/null @@ -1,155 +0,0 @@ -diff -Nur gcc-4.7.3.orig/libgcc/config/rs6000/linux-unwind.h gcc-4.7.3/libgcc/config/rs6000/linux-unwind.h ---- gcc-4.7.3.orig/libgcc/config/rs6000/linux-unwind.h 2011-11-12 18:20:58.000000000 +0100 -+++ gcc-4.7.3/libgcc/config/rs6000/linux-unwind.h 2013-09-15 18:29:20.000000000 +0200 -@@ -27,7 +27,6 @@ - #define R_CR2 70 - #define R_VR0 77 - #define R_VRSAVE 109 --#define R_VSCR 110 - - struct gcc_vregs - { -@@ -176,38 +175,6 @@ - } - #endif - --/* Find an entry in the process auxiliary vector. The canonical way to -- test for VMX is to look at AT_HWCAP. */ -- --static long --ppc_linux_aux_vector (long which) --{ -- /* __libc_stack_end holds the original stack passed to a process. */ -- extern long *__libc_stack_end; -- long argc; -- char **argv; -- char **envp; -- struct auxv -- { -- long a_type; -- long a_val; -- } *auxp; -- -- /* The Linux kernel puts argc first on the stack. */ -- argc = __libc_stack_end[0]; -- /* Followed by argv, NULL terminated. */ -- argv = (char **) __libc_stack_end + 1; -- /* Followed by environment string pointers, NULL terminated. */ -- envp = argv + argc + 1; -- while (*envp++) -- continue; -- /* Followed by the aux vector, zero terminated. */ -- for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) -- if (auxp->a_type == which) -- return auxp->a_val; -- return 0; --} -- - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -@@ -217,8 +184,8 @@ - ppc_fallback_frame_state (struct _Unwind_Context *context, - _Unwind_FrameState *fs) - { -- static long hwcap = 0; - struct gcc_regs *regs = get_regs (context); -+ struct gcc_vregs *vregs; - long new_cfa; - int i; - -@@ -230,12 +197,15 @@ - fs->regs.cfa_reg = STACK_POINTER_REGNUM; - fs->regs.cfa_offset = new_cfa - (long) context->cfa; - -- for (i = 0; i < 32; i++) -- if (i != STACK_POINTER_REGNUM) -- { -- fs->regs.reg[i].how = REG_SAVED_OFFSET; -- fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; -- } -+#ifdef __powerpc64__ -+ fs->regs.reg[2].how = REG_SAVED_OFFSET; -+ fs->regs.reg[2].loc.offset = (long) ®s->gpr[2] - new_cfa; -+#endif -+ for (i = 14; i < 32; i++) -+ { -+ fs->regs.reg[i].how = REG_SAVED_OFFSET; -+ fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; -+ } - - fs->regs.reg[R_CR2].how = REG_SAVED_OFFSET; - /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit -@@ -251,57 +221,35 @@ - fs->retaddr_column = ARG_POINTER_REGNUM; - fs->signal_frame = 1; - -- if (hwcap == 0) -+ /* If we have a FPU... */ -+ for (i = 14; i < 32; i++) - { -- hwcap = ppc_linux_aux_vector (16); -- /* These will already be set if we found AT_HWCAP. A nonzero -- value stops us looking again if for some reason we couldn't -- find AT_HWCAP. */ --#ifdef __powerpc64__ -- hwcap |= 0xc0000000; --#else -- hwcap |= 0x80000000; --#endif -+ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; -+ fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; - } - -- /* If we have a FPU... */ -- if (hwcap & 0x08000000) -- for (i = 0; i < 32; i++) -- { -- fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; -- fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; -- } -- - /* If we have a VMX unit... */ -- if (hwcap & 0x10000000) -- { -- struct gcc_vregs *vregs; - #ifdef __powerpc64__ -- vregs = regs->vp; -+ vregs = regs->vp; - #else -- vregs = ®s->vregs; -+ vregs = ®s->vregs; - #endif -- if (regs->msr & (1 << 25)) -+ if (regs->msr & (1 << 25)) -+ { -+ for (i = 20; i < 32; i++) - { -- for (i = 0; i < 32; i++) -- { -- fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET; -- fs->regs.reg[i + R_VR0].loc.offset -- = (long) &vregs->vr[i] - new_cfa; -- } -- -- fs->regs.reg[R_VSCR].how = REG_SAVED_OFFSET; -- fs->regs.reg[R_VSCR].loc.offset = (long) &vregs->vscr - new_cfa; -+ fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET; -+ fs->regs.reg[i + R_VR0].loc.offset = (long) &vregs->vr[i] - new_cfa; - } -- -- fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET; -- fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa; - } - -+ fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET; -+ fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa; -+ - /* If we have SPE register high-parts... we check at compile-time to - avoid expanding the code for all other PowerPC. */ - #ifdef __SPE__ -- for (i = 0; i < 32; i++) -+ for (i = 14; i < 32; i++) - { - fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET; - fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset diff --git a/package/gcc/patches/musl-sh.patch b/package/gcc/patches/musl-sh.patch deleted file mode 100644 index 7738f266e..000000000 --- a/package/gcc/patches/musl-sh.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur gcc-4.7.3.orig/gcc/config/sh/linux.h gcc-4.7.3/gcc/config/sh/linux.h ---- gcc-4.7.3.orig/gcc/config/sh/linux.h 2013-03-25 23:55:56.000000000 +0100 -+++ gcc-4.7.3/gcc/config/sh/linux.h 2013-09-26 21:16:39.000000000 +0200 -@@ -46,6 +46,7 @@ - #define TARGET_ASM_FILE_END file_end_indicate_exec_stack - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh.1" - - #undef SUBTARGET_LINK_EMUL_SUFFIX - #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" diff --git a/package/gcc/patches/musl-sparc.patch b/package/gcc/patches/musl-sparc.patch deleted file mode 100644 index 228b8522d..000000000 --- a/package/gcc/patches/musl-sparc.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur gcc-4.7.3.orig/gcc/config/sparc/linux64.h gcc-4.7.3/gcc/config/sparc/linux64.h ---- gcc-4.7.3.orig/gcc/config/sparc/linux64.h 2011-11-12 02:05:07.000000000 +0100 -+++ gcc-4.7.3/gcc/config/sparc/linux64.h 2013-09-19 11:37:50.000000000 +0200 -@@ -95,6 +95,9 @@ - - #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" - #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.1" -+ - - #ifdef SPARC_BI_ARCH - -diff -Nur gcc-4.7.3.orig/gcc/config/sparc/linux.h gcc-4.7.3/gcc/config/sparc/linux.h ---- gcc-4.7.3.orig/gcc/config/sparc/linux.h 2011-11-12 02:05:07.000000000 +0100 -+++ gcc-4.7.3/gcc/config/sparc/linux.h 2013-09-19 11:37:12.000000000 +0200 -@@ -85,6 +85,7 @@ - done. */ - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sparc.1" - - #undef LINK_SPEC - #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ diff --git a/package/gcc/patches/sdt.patch b/package/gcc/patches/sdt.patch deleted file mode 100644 index 7ee2cf1b7..000000000 --- a/package/gcc/patches/sdt.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nur gcc-4.7.2.orig/libgcc/unwind-dw2.c gcc-4.7.2/libgcc/unwind-dw2.c ---- gcc-4.7.2.orig/libgcc/unwind-dw2.c 2011-11-02 16:26:35.000000000 +0100 -+++ gcc-4.7.2/libgcc/unwind-dw2.c 2012-09-22 21:56:06.000000000 +0200 -@@ -38,10 +38,6 @@ - #include "gthr.h" - #include "unwind-dw2.h" - --#ifdef HAVE_SYS_SDT_H --#include --#endif -- - #ifndef __USING_SJLJ_EXCEPTIONS__ - - #ifndef STACK_GROWS_DOWNWARD diff --git a/package/glibc/files/libc.so.microblaze b/package/glibc/files/libc.so.microblaze new file mode 100644 index 000000000..4642dcbd5 --- /dev/null +++ b/package/glibc/files/libc.so.microblaze @@ -0,0 +1,5 @@ +/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT(elf32-microblaze) +GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld.so.1 ) ) diff --git a/target/microblaze/sys-available/qemu-microblaze b/target/microblaze/sys-available/qemu-microblaze index 294f793ff..8f35db842 100644 --- a/target/microblaze/sys-available/qemu-microblaze +++ b/target/microblaze/sys-available/qemu-microblaze @@ -7,6 +7,7 @@ config ADK_TARGET_SYSTEM_QEMU_MICROBLAZE select ADK_HARDWARE_QEMU select ADK_TARGET_KERNEL_LINUXBIN select ADK_USE_KERNEL_MINICONFIG + select ADK_TOOLCHAIN_GCC_SJLJ help Qemu support for microblaze big endian architecture. -- cgit v1.2.3 From bb9efd268326393ca769c38e6385216569e70e52 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 4 Jan 2014 22:21:30 +0100 Subject: update firefox and dependencies --- package/alsa-lib/patches/patch-libtool | 177 ++ package/alsa-lib/patches/patch-utils_alsa_pc_in | 12 + package/firefox/Makefile | 6 +- .../patch-ipc_chromium_src_base_file_util_h | 21 +- .../patch-ipc_chromium_src_base_file_util_posix_cc | 37 +- package/firefox/patches/patch-js_src_Makefile_in | 6 +- ...a_mtransport_third_party_nICEr_src_stun_addrs_c | 30 +- ...ia_mtransport_third_party_nICEr_src_stun_stun_h | 12 + ...trunk_webrtc_system_wrappers_source_cpu_info_cc | 12 +- ...em_wrappers_source_spreadsortlib_spreadsort_hpp | 8 +- ...thon_mozbuild_mozbuild_backend_recursivemake_py | 11 + .../patches/patch-tools_profiler_platform-linux_cc | 10 +- .../patch-tools_profiler_shared-libraries-linux_cc | 8 +- .../patches/patch-xpcom_io_nsLocalFileUnix_cpp | 6 +- .../patches/patch-xpcom_threads_nsThread_cpp | 6 +- package/libXft/patches/patch-src_xftglyphs_c | 11 +- package/libpng/Makefile | 6 +- package/libpng/patches/libpng-1.5.15-apng.patch | 1677 ------------------- package/libpng/patches/libpng-1.6.8-apng.patch | 1701 ++++++++++++++++++++ package/nspr/Makefile | 8 +- .../patch-mozilla_nsprpub_config_Makefile_in | 11 - .../nspr/patches/patch-mozilla_nsprpub_configure | 11 - .../patch-mozilla_nsprpub_pr_src_misc_prnetdb_c | 16 - target/x86/sys-available/ibm-x40 | 2 +- toolchain/musl/Makefile | 7 + 25 files changed, 2000 insertions(+), 1812 deletions(-) create mode 100644 package/alsa-lib/patches/patch-libtool create mode 100644 package/alsa-lib/patches/patch-utils_alsa_pc_in create mode 100644 package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h create mode 100644 package/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake_py delete mode 100644 package/libpng/patches/libpng-1.5.15-apng.patch create mode 100644 package/libpng/patches/libpng-1.6.8-apng.patch delete mode 100644 package/nspr/patches/patch-mozilla_nsprpub_config_Makefile_in delete mode 100644 package/nspr/patches/patch-mozilla_nsprpub_configure delete mode 100644 package/nspr/patches/patch-mozilla_nsprpub_pr_src_misc_prnetdb_c (limited to 'target') diff --git a/package/alsa-lib/patches/patch-libtool b/package/alsa-lib/patches/patch-libtool new file mode 100644 index 000000000..7879d575a --- /dev/null +++ b/package/alsa-lib/patches/patch-libtool @@ -0,0 +1,177 @@ +--- alsa-lib-1.0.27.2.orig/libtool 2013-07-08 14:32:53.000000000 +0200 ++++ alsa-lib-1.0.27.2/libtool 2013-12-30 17:42:30.000000000 +0100 +@@ -1,8 +1,8 @@ +-#! /bin/sh ++#! /bin/bash + + # libtool - Provide generalized library-building support services. + # Generated automatically by config.status (alsa-lib) 1.0.27.2 +-# Libtool was configured on host alsa.alsa-project.org: ++# Libtool was configured on host helium: + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +@@ -40,7 +40,7 @@ available_tags="" + # ### BEGIN LIBTOOL CONFIG + + # Whether or not to build static libraries. +-build_old_libs=no ++build_old_libs=yes + + # Which release of libtool.m4 was used? + macro_version=2.4.2 +@@ -56,7 +56,7 @@ pic_mode=default + fast_install=yes + + # Shell to use when invoking shell scripts. +-SHELL="/bin/sh" ++SHELL="/bin/bash" + + # An echo program that protects backslashes. + ECHO="printf %s\\n" +@@ -65,38 +65,38 @@ ECHO="printf %s\\n" + PATH_SEPARATOR=":" + + # The host system. +-host_alias= +-host=x86_64-unknown-linux-gnu ++host_alias=i686-openadk-linux ++host=i686-openadk-linux-gnu + host_os=linux-gnu + + # The build system. +-build_alias= +-build=x86_64-unknown-linux-gnu ++build_alias=x86_64-linux-gnu ++build=x86_64-pc-linux-gnu + build_os=linux-gnu + + # A sed program that does not truncate output. +-SED="/usr/bin/sed" ++SED="/home/wbx/ibmx40/scripts/sed" + + # Sed that helps us avoid accidentally triggering echo(1) options like -n. + Xsed="$SED -e 1s/^X//" + + # A grep program that handles long lines. +-GREP="/usr/bin/grep" ++GREP="/bin/grep" + + # An ERE matcher. +-EGREP="/usr/bin/grep -E" ++EGREP="/bin/grep -E" + + # A literal string matcher. +-FGREP="/usr/bin/grep -F" ++FGREP="/bin/grep -F" + + # A BSD- or MS-compatible name lister. +-NM="/usr/bin/nm -B" ++NM="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-nm" + + # Whether we need soft or hard links. + LN_S="ln -s" + + # What is the maximum length of a command? +-max_cmd_len=1572864 ++max_cmd_len=3458764513820540925 + + # Object file suffix (normally "o"). + objext=o +@@ -120,7 +120,7 @@ to_host_file_cmd=func_convert_file_noop + to_tool_file_cmd=func_convert_file_noop + + # An object symbol dumper. +-OBJDUMP="objdump" ++OBJDUMP="i686-openadk-linux-objdump" + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method="pass_all" +@@ -141,7 +141,7 @@ DLLTOOL="false" + sharedlib_from_linklib_cmd="printf %s\\n" + + # The archiver. +-AR="ar" ++AR="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-ar" + + # Flags to create an archive. + AR_FLAGS="cru" +@@ -150,10 +150,10 @@ AR_FLAGS="cru" + archiver_list_spec="@" + + # A symbol stripping program. +-STRIP="strip" ++STRIP="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-strip" + + # Commands used to install an old-style archive. +-RANLIB="ranlib" ++RANLIB="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-ranlib" + old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib" + old_postuninstall_cmds="" + +@@ -161,10 +161,10 @@ old_postuninstall_cmds="" + lock_old_archive_extraction=no + + # A C compiler. +-LTCC="gcc" ++LTCC="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-gcc" + + # LTCC compiler flags. +-LTCFLAGS="-O2 -fomit-frame-pointer -Wall -pipe -D_GNU_SOURCE" ++LTCFLAGS="-march=pentium-m -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3 -D_GNU_SOURCE" + + # Take the output of nm and produce a listing of raw symbols and C names. + global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'" +@@ -272,27 +272,27 @@ finish_eval="" + hardcode_into_libs=yes + + # Compile-time system search path for libraries. +-sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.7.2 /usr/lib64 /lib64 " ++sys_lib_search_path_spec="/home/wbx/ibmx40/host_i686_musl_musl/lib/gcc/i686-openadk-linux-musl/4.7.3 /home/wbx/ibmx40/host_i686_musl_musl/i686-openadk-linux-musl/lib /home/wbx/ibmx40/target_i686_musl_musl/lib /home/wbx/ibmx40/target_i686_musl_musl/usr/lib " + + # Run-time system search path for libraries. +-sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/mysql /usr/lib64/qt-3.3/lib " ++sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu " + + # Whether dlopen is supported. + dlopen_support=yes + + # Whether dlopen of programs is supported. +-dlopen_self=yes ++dlopen_self=unknown + + # Whether dlopen of statically linked programs is supported. +-dlopen_self_static=yes ++dlopen_self_static=unknown + + # Commands to strip libraries. +-old_striplib="strip --strip-debug" +-striplib="strip --strip-unneeded" ++old_striplib="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-strip --strip-debug" ++striplib="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-strip --strip-unneeded" + + + # The linker used to build libraries. +-LD="/usr/bin/ld -m elf_x86_64" ++LD="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-ld" + + # How to create reloadable object files. + reload_flag=" -r" +@@ -302,7 +302,7 @@ reload_cmds="\$LD\$reload_flag -o \$outp + old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib" + + # A language specific compiler. +-CC="gcc" ++CC="/home/wbx/ibmx40/host_i686_musl_musl/bin/i686-openadk-linux-musl-gcc" + + # Is the compiler the GNU compiler? + with_gcc=yes +@@ -317,7 +317,7 @@ pic_flag=" -fPIC -DPIC" + wl="-Wl," + + # Compiler flag to prevent dynamic linking. +-link_static_flag="" ++link_static_flag="-static" + + # Does compiler simultaneously support -c and -o options? + compiler_c_o="yes" diff --git a/package/alsa-lib/patches/patch-utils_alsa_pc_in b/package/alsa-lib/patches/patch-utils_alsa_pc_in new file mode 100644 index 000000000..d04f80248 --- /dev/null +++ b/package/alsa-lib/patches/patch-utils_alsa_pc_in @@ -0,0 +1,12 @@ +--- alsa-lib-1.0.27.2.orig/utils/alsa.pc.in 2013-07-08 14:31:36.000000000 +0200 ++++ alsa-lib-1.0.27.2/utils/alsa.pc.in 2014-01-01 17:07:29.000000000 +0100 +@@ -1,7 +1,7 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ +-libdir=@libdir@ +-includedir=@includedir@ ++libdir=${prefix}/lib ++includedir=${prefix}/include + + Name: alsa + Description: Advanced Linux Sound Architecture (ALSA) - Library diff --git a/package/firefox/Makefile b/package/firefox/Makefile index 69df75db1..f1764e14f 100644 --- a/package/firefox/Makefile +++ b/package/firefox/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:= firefox -PKG_VERSION:= 24.0 -PKG_RELEASE:= 2 -PKG_MD5SUM:= 06a4c0fe8d3a979aea2fce8d0fdbf328 +PKG_VERSION:= 26.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 91ce51cc6474f1269484e5327643a59c PKG_DESCR:= graphical webbrowser PKG_SECTION:= x11/apps PKG_DEPENDS:= libpthread alsa-lib glib libgtk libpng libtiff libxcursor libffi diff --git a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h index 137efacd8..5f7e30a10 100644 --- a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h +++ b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h @@ -1,23 +1,10 @@ ---- mozilla-release.orig/ipc/chromium/src/base/file_util.h 2013-09-11 01:15:04.000000000 +0200 -+++ mozilla-release/ipc/chromium/src/base/file_util.h 2013-10-23 16:28:38.000000000 +0200 -@@ -16,7 +16,11 @@ +--- mozilla-release.orig/ipc/chromium/src/base/file_util.h 2013-12-05 17:07:35.000000000 +0100 ++++ mozilla-release/ipc/chromium/src/base/file_util.h 2014-01-02 15:01:42.000000000 +0100 +@@ -16,7 +16,6 @@ #include #elif defined(OS_POSIX) #include -+#ifndef __GLIBC__ -+#define NO_FTS -+#else - #include -+#endif +-#include #include #endif -@@ -466,7 +470,7 @@ class FileEnumerator { - #if defined(OS_WIN) - WIN32_FIND_DATA find_data_; - HANDLE find_handle_; --#elif defined(ANDROID) -+#elif defined(NO_FTS) - void *fts_; - #elif defined(OS_POSIX) - FTS* fts_; diff --git a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc index 6721e44f8..7680a29c4 100644 --- a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc +++ b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc @@ -1,5 +1,5 @@ ---- mozilla-release.orig/ipc/chromium/src/base/file_util_posix.cc 2013-09-11 01:15:04.000000000 +0200 -+++ mozilla-release/ipc/chromium/src/base/file_util_posix.cc 2013-10-23 16:28:38.000000000 +0200 +--- mozilla-release.orig/ipc/chromium/src/base/file_util_posix.cc 2013-12-05 17:07:35.000000000 +0100 ++++ mozilla-release/ipc/chromium/src/base/file_util_posix.cc 2014-01-02 14:53:44.000000000 +0100 @@ -8,13 +8,16 @@ #include #include @@ -19,7 +19,7 @@ #include #define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures #include -@@ -121,7 +124,7 @@ bool Delete(const FilePath& path, bool r +@@ -67,7 +70,7 @@ bool Delete(const FilePath& path, bool r if (!recursive) return (rmdir(path_str) == 0); @@ -28,7 +28,7 @@ // XXX Need ftsless impl for bionic return false; #else -@@ -194,7 +197,7 @@ bool CopyDirectory(const FilePath& from_ +@@ -140,7 +143,7 @@ bool CopyDirectory(const FilePath& from_ return false; } @@ -37,7 +37,7 @@ // XXX Need ftsless impl for bionic return false; #else -@@ -415,7 +418,7 @@ bool CreateNewTempDirectory(const FilePa +@@ -333,7 +336,7 @@ bool CreateNewTempDirectory(const FilePa return false; tmpdir = tmpdir.Append(kTempFileName); std::string tmpdir_string = tmpdir.value(); @@ -46,30 +46,3 @@ char* dtemp = NULL; #else // this should be OK since mkdtemp just replaces characters in place -@@ -613,7 +616,7 @@ FileEnumerator::FileEnumerator(const Fil - } - - FileEnumerator::~FileEnumerator() { --#ifndef ANDROID -+#ifndef NO_FTS - if (fts_) - fts_close(fts_); - #endif -@@ -625,7 +628,7 @@ void FileEnumerator::GetFindInfo(FindInf - if (!is_in_find_op_) - return; - --#ifndef ANDROID -+#ifndef NO_FTS - memcpy(&(info->stat), fts_ent_->fts_statp, sizeof(info->stat)); - info->filename.assign(fts_ent_->fts_name); - #endif -@@ -636,7 +639,7 @@ void FileEnumerator::GetFindInfo(FindInf - // large directories with many files this can be quite deep. - // TODO(erikkay) - get rid of this recursive pattern - FilePath FileEnumerator::Next() { --#ifdef ANDROID -+#ifdef NO_FTS - return FilePath(); - #else - if (!is_in_find_op_) { diff --git a/package/firefox/patches/patch-js_src_Makefile_in b/package/firefox/patches/patch-js_src_Makefile_in index cb1b863f9..d4acee98c 100644 --- a/package/firefox/patches/patch-js_src_Makefile_in +++ b/package/firefox/patches/patch-js_src_Makefile_in @@ -1,6 +1,6 @@ ---- mozilla-release.orig/js/src/Makefile.in 2013-09-11 01:15:04.000000000 +0200 -+++ mozilla-release/js/src/Makefile.in 2013-10-14 12:36:25.000000000 +0200 -@@ -112,7 +112,7 @@ ifdef JS_HAS_CTYPES +--- mozilla-release.orig/js/src/Makefile.in 2013-12-05 17:07:35.000000000 +0100 ++++ mozilla-release/js/src/Makefile.in 2014-01-02 14:53:44.000000000 +0100 +@@ -103,7 +103,7 @@ ifdef JS_HAS_CTYPES VPATH += $(srcdir)/ctypes ifdef MOZ_NATIVE_FFI diff --git a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c index be14ca662..bf6c335de 100644 --- a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c +++ b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c @@ -1,11 +1,33 @@ ---- mozilla-release.orig/media/mtransport/third_party/nICEr/src/stun/addrs.c 2013-09-11 01:15:16.000000000 +0200 -+++ mozilla-release/media/mtransport/third_party/nICEr/src/stun/addrs.c 2013-12-10 13:18:17.000000000 +0100 -@@ -59,7 +59,7 @@ static char *RCSSTRING __UNUSED__="$Id: +--- mozilla-release.orig/media/mtransport/third_party/nICEr/src/stun/addrs.c 2013-12-05 17:07:48.000000000 +0100 ++++ mozilla-release/media/mtransport/third_party/nICEr/src/stun/addrs.c 2014-01-03 13:06:22.000000000 +0100 +@@ -53,7 +53,9 @@ static char *RCSSTRING __UNUSED__="$Id: + #undef __unused + #include + #endif ++#if defined(__GLIBC__) + #include ++#endif + #ifndef LINUX + #if !defined(__OpenBSD__) && !defined(__NetBSD__) + #include +@@ -61,14 +63,17 @@ static char *RCSSTRING __UNUSED__="$Id: #include #include #include -#else -+#elif __GLIBC__ ++#elif defined(__GLIBC__) + #include #include + #include + #include +-#ifndef ANDROID + #include +-#endif ++#else ++#include ++#include ++#include ++#include #endif #include + diff --git a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h new file mode 100644 index 000000000..7877d65cc --- /dev/null +++ b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h @@ -0,0 +1,12 @@ +--- mozilla-release.orig/media/mtransport/third_party/nICEr/src/stun/stun.h 2013-12-05 17:07:48.000000000 +0100 ++++ mozilla-release/media/mtransport/third_party/nICEr/src/stun/stun.h 2014-01-03 17:19:05.000000000 +0100 +@@ -39,7 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE + #else + #include + #include ++#if defined(__GLIBC__) + #include ++#endif + #ifndef LINUX + #if !defined(__OpenBSD__) && !defined(__NetBSD__) + #include diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc index 6083460c5..3ee2e0fdc 100644 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc +++ b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc @@ -1,23 +1,23 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2013-09-11 01:15:18.000000000 +0200 -+++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2013-10-15 12:21:59.000000000 +0200 -@@ -38,11 +38,6 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCo +--- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2013-12-05 17:07:50.000000000 +0100 ++++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2014-01-02 14:58:37.000000000 +0100 +@@ -36,11 +36,6 @@ uint32_t CpuInfo::DetectNumberOfCores() WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Available number of cores:%d", number_of_cores_); -#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK) -- number_of_cores_ = get_nprocs(); +- number_of_cores_ = static_cast(sysconf(_SC_NPROCESSORS_ONLN)); - WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, - "Available number of cores:%d", number_of_cores_); - #elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC) int name[] = { CTL_HW, -@@ -63,8 +58,6 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCo +@@ -61,8 +56,6 @@ uint32_t CpuInfo::DetectNumberOfCores() "Failed to get number of cores"); number_of_cores_ = 1; } -#elif defined(_SC_NPROCESSORS_ONLN) -- _numberOfCores = sysconf(_SC_NPROCESSORS_ONLN); +- number_of_cores_ = sysconf(_SC_NPROCESSORS_ONLN); #else WEBRTC_TRACE(kTraceWarning, kTraceUtility, -1, "No function to get number of cores"); diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp index 7c262e5ff..ac1d23267 100644 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp +++ b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp @@ -1,8 +1,8 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2013-09-11 01:15:18.000000000 +0200 -+++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2013-10-15 16:05:38.000000000 +0200 +--- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2013-12-05 17:07:50.000000000 +0100 ++++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2014-01-02 14:53:44.000000000 +0100 @@ -21,6 +21,11 @@ Scott McMurray - #include "constants.hpp" - #include + #include + #include "webrtc/system_wrappers/source/spreadsortlib/constants.hpp" +#include +#if defined(__UCLIBC__) diff --git a/package/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake_py b/package/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake_py new file mode 100644 index 000000000..30f5edd57 --- /dev/null +++ b/package/firefox/patches/patch-python_mozbuild_mozbuild_backend_recursivemake_py @@ -0,0 +1,11 @@ +--- mozilla-release.orig/python/mozbuild/mozbuild/backend/recursivemake.py 2013-12-05 17:07:53.000000000 +0100 ++++ mozilla-release/python/mozbuild/mozbuild/backend/recursivemake.py 2014-01-04 17:58:26.000000000 +0100 +@@ -421,7 +421,7 @@ class RecursiveMakeBackend(CommonBackend + def _handle_idl_manager(self, manager): + build_files = self._purge_manifests['xpidl'] + +- for p in ('Makefile', 'backend.mk', '.deps/.mkdir.done', ++ for p in ('Makefile.in', 'Makefile', 'backend.mk', '.deps/.mkdir.done', + 'xpt/.mkdir.done'): + build_files.add(p) + diff --git a/package/firefox/patches/patch-tools_profiler_platform-linux_cc b/package/firefox/patches/patch-tools_profiler_platform-linux_cc index 7e9a44eba..a331e87fe 100644 --- a/package/firefox/patches/patch-tools_profiler_platform-linux_cc +++ b/package/firefox/patches/patch-tools_profiler_platform-linux_cc @@ -1,15 +1,15 @@ ---- mozilla-release.orig/tools/profiler/platform-linux.cc 2013-09-11 01:15:26.000000000 +0200 -+++ mozilla-release/tools/profiler/platform-linux.cc 2013-10-23 16:28:38.000000000 +0200 -@@ -53,7 +53,7 @@ - #include // open +--- mozilla-release.orig/tools/profiler/platform-linux.cc 2013-12-05 17:07:58.000000000 +0100 ++++ mozilla-release/tools/profiler/platform-linux.cc 2014-01-02 14:59:20.000000000 +0100 +@@ -58,7 +58,7 @@ #include // open #include // sysconf + #include -#ifdef __GLIBC__ +#if defined(__GLIBC__) && ! defined(__UCLIBC__) #include // backtrace, backtrace_symbols #endif // def __GLIBC__ #include // index -@@ -73,14 +73,12 @@ +@@ -84,14 +84,12 @@ #define SIGNAL_SAVE_PROFILE SIGUSR2 diff --git a/package/firefox/patches/patch-tools_profiler_shared-libraries-linux_cc b/package/firefox/patches/patch-tools_profiler_shared-libraries-linux_cc index 8ffa06228..40b8b594d 100644 --- a/package/firefox/patches/patch-tools_profiler_shared-libraries-linux_cc +++ b/package/firefox/patches/patch-tools_profiler_shared-libraries-linux_cc @@ -1,11 +1,11 @@ ---- mozilla-release.orig/tools/profiler/shared-libraries-linux.cc 2013-09-11 01:15:26.000000000 +0200 -+++ mozilla-release/tools/profiler/shared-libraries-linux.cc 2013-10-23 16:28:38.000000000 +0200 +--- mozilla-release.orig/tools/profiler/shared-libraries-linux.cc 2013-12-05 17:07:58.000000000 +0100 ++++ mozilla-release/tools/profiler/shared-libraries-linux.cc 2014-01-02 15:00:00.000000000 +0100 @@ -14,7 +14,7 @@ #include "platform.h" #include "shared-libraries.h" --#ifndef __GLIBC__ +-#if !defined(__GLIBC__) && ANDROID_VERSION < 18 +#if 0 - /* a crapy version of getline, because it's not included in bionic */ + /* a crapy version of getline, because it's not included in old bionics */ static ssize_t getline(char **lineptr, size_t *n, FILE *stream) { diff --git a/package/firefox/patches/patch-xpcom_io_nsLocalFileUnix_cpp b/package/firefox/patches/patch-xpcom_io_nsLocalFileUnix_cpp index e9c2a28ad..868ad69d4 100644 --- a/package/firefox/patches/patch-xpcom_io_nsLocalFileUnix_cpp +++ b/package/firefox/patches/patch-xpcom_io_nsLocalFileUnix_cpp @@ -1,6 +1,6 @@ ---- mozilla-release.orig/xpcom/io/nsLocalFileUnix.cpp 2013-09-11 01:15:27.000000000 +0200 -+++ mozilla-release/xpcom/io/nsLocalFileUnix.cpp 2013-10-14 14:33:08.000000000 +0200 -@@ -1256,8 +1256,13 @@ nsLocalFile::GetDiskSpaceAvailable(int64 +--- mozilla-release.orig/xpcom/io/nsLocalFileUnix.cpp 2013-12-05 17:08:00.000000000 +0100 ++++ mozilla-release/xpcom/io/nsLocalFileUnix.cpp 2014-01-02 14:53:47.000000000 +0100 +@@ -1234,8 +1234,13 @@ nsLocalFile::GetDiskSpaceAvailable(int64 && dq.dqb_bhardlimit) { int64_t QuotaSpaceAvailable = 0; diff --git a/package/firefox/patches/patch-xpcom_threads_nsThread_cpp b/package/firefox/patches/patch-xpcom_threads_nsThread_cpp index eb7d1f21a..0f40d736a 100644 --- a/package/firefox/patches/patch-xpcom_threads_nsThread_cpp +++ b/package/firefox/patches/patch-xpcom_threads_nsThread_cpp @@ -1,6 +1,6 @@ ---- mozilla-release.orig/xpcom/threads/nsThread.cpp 2013-09-11 01:15:27.000000000 +0200 -+++ mozilla-release/xpcom/threads/nsThread.cpp 2013-10-14 15:49:25.000000000 +0200 -@@ -20,11 +20,13 @@ +--- mozilla-release.orig/xpcom/threads/nsThread.cpp 2013-12-05 17:08:00.000000000 +0100 ++++ mozilla-release/xpcom/threads/nsThread.cpp 2014-01-02 14:53:47.000000000 +0100 +@@ -23,11 +23,13 @@ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \ !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) diff --git a/package/libXft/patches/patch-src_xftglyphs_c b/package/libXft/patches/patch-src_xftglyphs_c index 54457857f..c8da32ca4 100644 --- a/package/libXft/patches/patch-src_xftglyphs_c +++ b/package/libXft/patches/patch-src_xftglyphs_c @@ -1,16 +1,17 @@ --- libXft-2.3.1.orig/src/xftglyphs.c 2012-06-02 18:36:35.000000000 +0200 -+++ libXft-2.3.1/src/xftglyphs.c 2013-12-07 12:17:23.000000000 +0100 ++++ libXft-2.3.1/src/xftglyphs.c 2014-01-02 14:41:02.000000000 +0100 @@ -21,10 +21,10 @@ */ #include "xftint.h" -#include -#include -+#include -+#include - +- -#include -+#include ++#include ++#include FT_OUTLINE_H ++#include FT_LCD_FILTER_H ++#include FT_SYNTHESIS_H /* * Validate the memory info for a font diff --git a/package/libpng/Makefile b/package/libpng/Makefile index 1d43a4998..ea4c3a1f8 100644 --- a/package/libpng/Makefile +++ b/package/libpng/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= libpng -PKG_VERSION:= 1.5.15 -PKG_RELEASE:= 2 -PKG_MD5SUM:= ea24254980fd820964a710e4d2a947c7 +PKG_VERSION:= 1.6.8 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 29b7065906e2551508a0d7eacd19174e PKG_DESCR:= A library for reading/writing PNG images PKG_SECTION:= libs PKG_DEPENDS:= zlib diff --git a/package/libpng/patches/libpng-1.5.15-apng.patch b/package/libpng/patches/libpng-1.5.15-apng.patch deleted file mode 100644 index b169303e9..000000000 --- a/package/libpng/patches/libpng-1.5.15-apng.patch +++ /dev/null @@ -1,1677 +0,0 @@ -diff -Naru libpng-1.5.15.org/png.h libpng-1.5.15/png.h ---- libpng-1.5.15.org/png.h 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/png.h 2013-04-02 20:39:30.000000000 +0900 -@@ -448,6 +448,10 @@ - # include "pnglibconf.h" - #endif - -+#define PNG_APNG_SUPPORTED -+#define PNG_READ_APNG_SUPPORTED -+#define PNG_WRITE_APNG_SUPPORTED -+ - #ifndef PNG_VERSION_INFO_ONLY - # ifndef PNG_BUILDING_SYMBOL_TABLE - /* -@@ -555,6 +559,17 @@ - * See pngconf.h for base types that vary by machine/system - */ - -+#ifdef PNG_APNG_SUPPORTED -+/* dispose_op flags from inside fcTL */ -+#define PNG_DISPOSE_OP_NONE 0x00 -+#define PNG_DISPOSE_OP_BACKGROUND 0x01 -+#define PNG_DISPOSE_OP_PREVIOUS 0x02 -+ -+/* blend_op flags from inside fcTL */ -+#define PNG_BLEND_OP_SOURCE 0x00 -+#define PNG_BLEND_OP_OVER 0x01 -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* This triggers a compiler error in png.c, if png.c and png.h - * do not agree upon the version number. - */ -@@ -838,6 +853,10 @@ - #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ - #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ - #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ -+#ifdef PNG_APNG_SUPPORTED -+#define PNG_INFO_acTL 0x10000 -+#define PNG_INFO_fcTL 0x20000 -+#endif - - /* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using -@@ -883,6 +902,10 @@ - #ifdef PNG_PROGRESSIVE_READ_SUPPORTED - typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); - typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); -+#ifdef PNG_APNG_SUPPORTED -+typedef PNG_CALLBACK(void, *png_progressive_frame_ptr, (png_structp, -+ png_uint_32)); -+#endif - - /* The following callback receives png_uint_32 row_number, int pass for the - * png_bytep data of the row. When transforming an interlaced image the -@@ -2702,6 +2725,74 @@ - /******************************************************************************* - * END OF HARDWARE OPTIONS - ******************************************************************************/ -+#ifdef PNG_APNG_SUPPORTED -+PNG_EXPORT(237, png_uint_32, png_get_acTL, (png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); -+ -+PNG_EXPORT(238, png_uint_32, png_set_acTL, (png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); -+ -+PNG_EXPORT(239, png_uint_32, png_get_num_frames, (png_structp png_ptr, -+ png_infop info_ptr)); -+ -+PNG_EXPORT(240, png_uint_32, png_get_num_plays, (png_structp png_ptr, -+ png_infop info_ptr)); -+ -+PNG_EXPORT(241, png_uint_32, png_get_next_frame_fcTL, -+ (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, -+ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, -+ png_byte *blend_op)); -+ -+PNG_EXPORT(242, png_uint_32, png_set_next_frame_fcTL, -+ (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, -+ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+ -+PNG_EXPORT(243, png_uint_32, png_get_next_frame_width, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(244, png_uint_32, png_get_next_frame_height, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(245, png_uint_32, png_get_next_frame_x_offset, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(246, png_uint_32, png_get_next_frame_y_offset, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(247, png_uint_16, png_get_next_frame_delay_num, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(248, png_uint_16, png_get_next_frame_delay_den, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(249, png_byte, png_get_next_frame_dispose_op, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(250, png_byte, png_get_next_frame_blend_op, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(251, png_byte, png_get_first_frame_is_hidden, -+ (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(252, png_uint_32, png_set_first_frame_is_hidden, -+ (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+PNG_EXPORT(253, void, png_read_frame_head, (png_structp png_ptr, -+ png_infop info_ptr)); -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+PNG_EXPORT(254, void, png_set_progressive_frame_fn, (png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn)); -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+PNG_EXPORT(255, void, png_write_frame_head, (png_structp png_ptr, -+ png_infop info_ptr, png_bytepp row_pointers, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+ -+PNG_EXPORT(256, void, png_write_frame_tail, (png_structp png_ptr, -+ png_infop info_ptr)); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+#endif /* PNG_APNG_SUPPORTED */ - - /* Maintainer: Put new public prototypes here ^, in libpng.3, and project - * defs -@@ -2712,7 +2803,11 @@ - * scripts/symbols.def as well. - */ - #ifdef PNG_EXPORT_LAST_ORDINAL -+#ifdef PNG_APNG_SUPPORTED -+ PNG_EXPORT_LAST_ORDINAL(256); -+#else - PNG_EXPORT_LAST_ORDINAL(236); -+#endif /* PNG_APNG_SUPPORTED */ - #endif - - #ifdef __cplusplus -diff -Naru libpng-1.5.15.org/pngget.c libpng-1.5.15/pngget.c ---- libpng-1.5.15.org/pngget.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngget.c 2013-04-02 20:39:30.000000000 +0900 -@@ -1140,4 +1140,166 @@ - # endif - #endif - -+#ifdef PNG_APNG_SUPPORTED -+png_uint_32 PNGAPI -+png_get_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *num_frames, png_uint_32 *num_plays) -+{ -+ png_debug1(1, "in %s retrieval function", "acTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_acTL) && -+ num_frames != NULL && num_plays != NULL) -+ { -+ *num_frames = info_ptr->num_frames; -+ *num_plays = info_ptr->num_plays; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_frames(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_frames()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_frames); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_plays(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_plays()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_plays); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *width, png_uint_32 *height, -+ png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, -+ png_byte *dispose_op, png_byte *blend_op) -+{ -+ png_debug1(1, "in %s retrieval function", "fcTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_fcTL) && -+ width != NULL && height != NULL && -+ x_offset != NULL && y_offset != NULL && -+ delay_num != NULL && delay_den != NULL && -+ dispose_op != NULL && blend_op != NULL) -+ { -+ *width = info_ptr->next_frame_width; -+ *height = info_ptr->next_frame_height; -+ *x_offset = info_ptr->next_frame_x_offset; -+ *y_offset = info_ptr->next_frame_y_offset; -+ *delay_num = info_ptr->next_frame_delay_num; -+ *delay_den = info_ptr->next_frame_delay_den; -+ *dispose_op = info_ptr->next_frame_dispose_op; -+ *blend_op = info_ptr->next_frame_blend_op; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_width()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_width); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_height()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_height); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_x_offset()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_x_offset); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_y_offset()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_y_offset); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_num()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_num); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_den()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_den); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_dispose_op()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_dispose_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_blend_op()"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_blend_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()"); -+ -+ if (png_ptr != NULL) -+ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); -+ -+ PNG_UNUSED(info_ptr) -+ -+ return 0; -+} -+#endif /* PNG_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ -diff -Naru libpng-1.5.15.org/pnginfo.h libpng-1.5.15/pnginfo.h ---- libpng-1.5.15.org/pnginfo.h 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pnginfo.h 2013-04-02 20:39:30.000000000 +0900 -@@ -265,5 +265,18 @@ - png_bytepp row_pointers; /* the image bits */ - #endif - -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 num_frames; /* including default image */ -+ png_uint_32 num_plays; -+ png_uint_32 next_frame_width; -+ png_uint_32 next_frame_height; -+ png_uint_32 next_frame_x_offset; -+ png_uint_32 next_frame_y_offset; -+ png_uint_16 next_frame_delay_num; -+ png_uint_16 next_frame_delay_den; -+ png_byte next_frame_dispose_op; -+ png_byte next_frame_blend_op; -+#endif -+ - }; - #endif /* PNGINFO_H */ -diff -Naru libpng-1.5.15.org/pngpread.c libpng-1.5.15/pngpread.c ---- libpng-1.5.15.org/pngpread.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngpread.c 2013-04-02 20:39:30.000000000 +0900 -@@ -215,6 +215,109 @@ - - chunk_name = png_ptr->chunk_name; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->num_frames_read > 0 && -+ png_ptr->num_frames_read < info_ptr->num_frames) -+ { -+ if (chunk_name == png_IDAT) -+ { -+ /* Discard trailing IDATs for the first frame */ -+ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "out of place IDAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else if (chunk_name == png_fdAT) -+ { -+ if (png_ptr->buffer_size < 4) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_ensure_sequence_number(png_ptr, 4); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ { -+ /* Discard trailing fdATs for frames other than the first */ -+ if (png_ptr->num_frames_read < 2) -+ png_error(png_ptr, "out of place fdAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ else -+ { -+ /* frame data follows */ -+ png_ptr->idat_size = png_ptr->push_length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ png_ptr->process_mode = PNG_READ_IDAT_MODE; -+ -+ return; -+ } -+ } -+ -+ else if (chunk_name == png_fcTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ png_error(png_ptr, "missing required fcTL chunk"); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ png_progressive_read_reset(png_ptr); -+ -+ if (png_ptr->frame_info_fn != NULL) -+ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ -+ return; -+ } -+ -+ else -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ return; -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - if (chunk_name == png_IDAT) - { - /* This is here above the if/else case statement below because if the -@@ -318,6 +421,10 @@ - png_benign_error(png_ptr, "Too many IDATs found"); - } - -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_have_info(png_ptr, info_ptr); -+#endif -+ - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; -@@ -551,6 +658,28 @@ - - #endif - -+#ifdef PNG_READ_APNG_SUPPORTED -+ else if (chunk_name == png_acTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ -+ else if (chunk_name == png_fcTL) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - else - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) -@@ -758,7 +887,11 @@ - png_byte chunk_tag[4]; - - /* TODO: this code can be commoned up with the same code in push_read */ -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->buffer_size < 12) -+#else - if (png_ptr->buffer_size < 8) -+#endif - { - png_push_save_buffer(png_ptr); - return; -@@ -771,17 +904,64 @@ - png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0) -+ { -+ if (png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) -+ { -+ png_ptr->process_mode = PNG_READ_CHUNK_MODE; -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+ return; -+ } -+ else -+ { -+ if (png_ptr->chunk_name == png_IEND) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipping (ignoring) a chunk between " -+ "APNG chunks"); -+ png_crc_finish(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ } -+ else -+#endif -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0) -+#else - if (png_ptr->chunk_name != png_IDAT) -+#endif - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); - -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+#endif -+ - return; - } - - png_ptr->idat_size = png_ptr->push_length; -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->num_frames_read > 0) -+ { -+ png_ensure_sequence_number(png_ptr, 4); -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - - if (png_ptr->idat_size && png_ptr->save_buffer_size) -@@ -859,6 +1039,15 @@ - if (!(buffer_length > 0) || buffer == NULL) - png_error(png_ptr, "No IDAT data (internal error)"); - -+#ifdef PNG_READ_APNG_SUPPORTED -+ /* If the app is not APNG-aware, decode only the first frame */ -+ if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read > 0) -+ { -+ png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; -+ return; -+ } -+#endif -+ - /* This routine must process all the data it has been given - * before returning, calling the row callback as required to - * handle the uncompressed results. -@@ -1304,6 +1493,18 @@ - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); - } - -+#ifdef PNG_READ_APNG_SUPPORTED -+void PNGAPI -+png_set_progressive_frame_fn(png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn) -+{ -+ png_ptr->frame_info_fn = frame_info_fn; -+ png_ptr->frame_end_fn = frame_end_fn; -+ png_ptr->apng_flags |= PNG_APNG_APP; -+} -+#endif -+ - png_voidp PNGAPI - png_get_progressive_ptr(png_const_structp png_ptr) - { -diff -Naru libpng-1.5.15.org/pngpriv.h libpng-1.5.15/pngpriv.h ---- libpng-1.5.15.org/pngpriv.h 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngpriv.h 2013-04-02 20:39:30.000000000 +0900 -@@ -461,6 +461,10 @@ - #define PNG_HAVE_PNG_SIGNATURE 0x1000 - #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ - #define PNG_HAVE_iCCP 0x4000 -+#ifdef PNG_APNG_SUPPORTED -+#define PNG_HAVE_acTL 0x8000 -+#define PNG_HAVE_fcTL 0x10000 -+#endif - - /* Flags for the transformations the PNG library does on the image data */ - #define PNG_BGR 0x0001 -@@ -658,6 +662,16 @@ - #define png_tRNS PNG_CHUNK(116, 82, 78, 83) - #define png_zTXt PNG_CHUNK(122, 84, 88, 116) - -+#ifdef PNG_APNG_SUPPORTED -+#define png_acTL PNG_CHUNK( 97, 99, 84, 76) -+#define png_fcTL PNG_CHUNK(102, 99, 84, 76) -+#define png_fdAT PNG_CHUNK(102, 100, 65, 84) -+ -+/* For png_struct.apng_flags: */ -+#define PNG_FIRST_FRAME_HIDDEN 0x0001 -+#define PNG_APNG_APP 0x0002 -+#endif -+ - /* The following will work on (signed char*) strings, whereas the get_uint_32 - * macro will fail on top-bit-set values because of the sign extension. - */ -@@ -1349,6 +1363,45 @@ - png_bytep row)); - #endif - -+#ifdef PNG_APNG_SUPPORTED -+PNG_EXTERN void png_ensure_fcTL_is_valid PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+PNG_EXTERN void png_handle_acTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_handle_fcTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_handle_fdAT PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_have_info PNGARG((png_structp png_ptr, png_infop info_ptr)); -+PNG_EXTERN void png_ensure_sequence_number PNGARG((png_structp png_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_read_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_read_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+PNG_EXTERN void png_progressive_read_reset PNGARG((png_structp png_ptr)); -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+PNG_EXTERN void png_write_acTL PNGARG((png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays)); -+PNG_EXTERN void png_write_fcTL PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+PNG_EXTERN void png_write_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_write_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 width, png_uint_32 height)); -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* Added at libpng version 1.4.0 */ - #ifdef PNG_CHECK_cHRM_SUPPORTED - PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, -diff -Naru libpng-1.5.15.org/pngread.c libpng-1.5.15/pngread.c ---- libpng-1.5.15.org/pngread.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngread.c 2013-04-02 20:39:30.000000000 +0900 -@@ -240,6 +240,9 @@ - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; - break; -@@ -330,12 +333,90 @@ - png_handle_iTXt(png_ptr, info_ptr, length); - #endif - -+#ifdef PNG_READ_APNG_SUPPORTED -+ else if (chunk_name == png_acTL) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ -+ else if (chunk_name == png_fcTL) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ -+ else if (chunk_name == png_fdAT) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif -+ - else - png_handle_unknown(png_ptr, info_ptr, length); - } - } - #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ - -+#ifdef PNG_READ_APNG_SUPPORTED -+void PNGAPI -+png_read_frame_head(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ -+ -+ png_debug(0, "Reading frame head"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_acTL)) -+ png_error(png_ptr, "attempt to png_read_frame_head() but " -+ "no acTL present"); -+ -+ /* do nothing for the main IDAT */ -+ if (png_ptr->num_frames_read == 0) -+ return; -+ -+ png_crc_finish(png_ptr, 0); /* CRC from last IDAT or fdAT chunk */ -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ have_chunk_after_DAT = 0; -+ for (;;) -+ { -+ png_uint_32 length = png_read_chunk_header(png_ptr); -+ -+ if (png_ptr->chunk_name == png_IDAT) -+ { -+ /* discard trailing IDATs for the first frame */ -+ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); -+ png_crc_finish(png_ptr, length); -+ } -+ -+ else if (png_ptr->chunk_name == png_fcTL) -+ { -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ have_chunk_after_DAT = 1; -+ } -+ -+ else if (png_ptr->chunk_name == png_fdAT) -+ { -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* discard trailing fdATs for frames other than the first */ -+ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) -+ png_crc_finish(png_ptr, length - 4); -+ else if(png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_ptr->idat_size = length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ -+ break; -+ } -+ else -+ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); -+ } -+ else -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_crc_finish(png_ptr, length); -+ } -+ } -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* Optional call to update the users info_ptr structure */ - void PNGAPI - png_read_update_info(png_structp png_ptr, png_infop info_ptr) -@@ -537,6 +618,38 @@ - { - if (!(png_ptr->zstream.avail_in)) - { -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_uint_32 bytes_to_skip = 0; -+ -+ while (!png_ptr->idat_size || bytes_to_skip != 0) -+ { -+ png_crc_finish(png_ptr, bytes_to_skip); -+ bytes_to_skip = 0; -+ -+ png_ptr->idat_size = png_read_chunk_header(png_ptr); -+ if (png_ptr->num_frames_read == 0) -+ { -+ if (png_ptr->chunk_name != png_IDAT) -+ png_error(png_ptr, "Not enough image data"); -+ } -+ else -+ { -+ if (png_ptr->chunk_name == png_IEND) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->chunk_name != png_fdAT) -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ bytes_to_skip = png_ptr->idat_size; -+ continue; -+ } -+ -+ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); -+ -+ png_ptr->idat_size -= 4; -+ } -+ } -+#else - while (!png_ptr->idat_size) - { - png_crc_finish(png_ptr, 0); -@@ -545,6 +658,7 @@ - if (png_ptr->chunk_name != png_IDAT) - png_error(png_ptr, "Not enough image data"); - } -+#endif - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) -@@ -563,6 +677,9 @@ - png_benign_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_ptr->num_frames_read++; -+#endif - break; - } - -diff -Naru libpng-1.5.15.org/pngrutil.c libpng-1.5.15/pngrutil.c ---- libpng-1.5.15.org/pngrutil.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngrutil.c 2013-04-02 20:39:30.000000000 +0900 -@@ -547,6 +547,11 @@ - filter_type = buf[11]; - interlace_type = buf[12]; - -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* Set internal variables */ - png_ptr->width = width; - png_ptr->height = height; -@@ -2624,6 +2629,179 @@ - } - #endif - -+#ifdef PNG_READ_APNG_SUPPORTED -+void /* PRIVATE */ -+png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[8]; -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+ png_uint_32 didSet; -+ -+ png_debug(1, "in png_handle_acTL"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before acTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_acTL) -+ { -+ png_warning(png_ptr, "Duplicate acTL skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 8) -+ { -+ png_warning(png_ptr, "acTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 8); -+ png_crc_finish(png_ptr, 0); -+ -+ num_frames = png_get_uint_31(png_ptr, data); -+ num_plays = png_get_uint_31(png_ptr, data + 4); -+ -+ /* the set function will do error checking on num_frames */ -+ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); -+ if(didSet) -+ png_ptr->mode |= PNG_HAVE_acTL; -+} -+ -+void /* PRIVATE */ -+png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[22]; -+ png_uint_32 width; -+ png_uint_32 height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ -+ png_debug(1, "in png_handle_fcTL"); -+ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before fcTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ /* for any frames other then the first this message may be misleading, -+ * but correct. PNG_HAVE_IDAT is unset before the frame head is read -+ * i can't think of a better message */ -+ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ else if (length != 26) -+ { -+ png_warning(png_ptr, "fcTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length-4); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 22); -+ png_crc_finish(png_ptr, 0); -+ -+ width = png_get_uint_31(png_ptr, data); -+ height = png_get_uint_31(png_ptr, data + 4); -+ x_offset = png_get_uint_31(png_ptr, data + 8); -+ y_offset = png_get_uint_31(png_ptr, data + 12); -+ delay_num = png_get_uint_16(data + 16); -+ delay_den = png_get_uint_16(data + 18); -+ dispose_op = data[20]; -+ blend_op = data[21]; -+ -+ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) -+ { -+ png_warning(png_ptr, "fcTL for the first frame must have zero offset"); -+ return; -+ } -+ -+ if (info_ptr != NULL) -+ { -+ if (png_ptr->num_frames_read == 0 && -+ (width != info_ptr->width || height != info_ptr->height)) -+ { -+ png_warning(png_ptr, "size in first frame's fcTL must match " -+ "the size in IHDR"); -+ return; -+ } -+ -+ /* The set function will do more error checking */ -+ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, -+ x_offset, y_offset, delay_num, delay_den, -+ dispose_op, blend_op); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ -+ png_ptr->mode |= PNG_HAVE_fcTL; -+ } -+} -+ -+void /* PRIVATE */ -+png_have_info(png_structp png_ptr, png_infop info_ptr) -+{ -+ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) -+ { -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ info_ptr->num_frames++; -+ } -+} -+ -+void /* PRIVATE */ -+png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* This function is only called from png_read_end(), png_read_info(), -+ * and png_push_read_chunk() which means that: -+ * - the user doesn't want to read this frame -+ * - or this is an out-of-place fdAT -+ * in either case it is safe to ignore the chunk with a warning */ -+ png_warning(png_ptr, "ignoring fdAT chunk"); -+ png_crc_finish(png_ptr, length - 4); -+ PNG_UNUSED(info_ptr) -+} -+ -+void /* PRIVATE */ -+png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) -+{ -+ png_byte data[4]; -+ png_uint_32 sequence_number; -+ -+ if (length < 4) -+ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); -+ -+ png_crc_read(png_ptr, data, 4); -+ sequence_number = png_get_uint_31(png_ptr, data); -+ -+ if (sequence_number != png_ptr->next_seq_num) -+ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " -+ "number found"); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* This function is called when we haven't found a handler for a - * chunk. If there isn't a problem with the chunk itself (ie bad - * chunk name, CRC, or a critical chunk), the chunk is silently ignored -@@ -4114,4 +4292,81 @@ - - png_ptr->flags |= PNG_FLAG_ROW_INIT; - } -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+/* This function is to be called after the main IDAT set has been read and -+ * before a new IDAT is read. It resets some parts of png_ptr -+ * to make them usable by the read functions again */ -+void /* PRIVATE */ -+png_read_reset(png_structp png_ptr) -+{ -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+ png_ptr->mode &= ~PNG_AFTER_IDAT; -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -+} -+ -+void /* PRIVATE */ -+png_read_reinit(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_ptr->width = info_ptr->next_frame_width; -+ png_ptr->height = info_ptr->next_frame_height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); -+ png_ptr->info_rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, -+ png_ptr->width); -+ if (png_ptr->prev_row) -+ png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); -+} -+ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+/* same as png_read_reset() but for the progressive reader */ -+void /* PRIVATE */ -+png_progressive_read_reset(png_structp png_ptr) -+{ -+#ifdef PNG_READ_INTERLACING_SUPPORTED -+ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ -+ -+ /* Start of interlace block */ -+ const int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; -+ -+ /* Offset to next interlace block */ -+ const int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; -+ -+ /* Start of interlace block in the y direction */ -+ const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; -+ -+ /* Offset to next interlace block in the y direction */ -+ const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; -+ -+ if (png_ptr->interlaced) -+ { -+ if (!(png_ptr->transformations & PNG_INTERLACE)) -+ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - -+ png_pass_ystart[0]) / png_pass_yinc[0]; -+ else -+ png_ptr->num_rows = png_ptr->height; -+ -+ png_ptr->iwidth = (png_ptr->width + -+ png_pass_inc[png_ptr->pass] - 1 - -+ png_pass_start[png_ptr->pass]) / -+ png_pass_inc[png_ptr->pass]; -+ } -+ else -+#endif /* PNG_READ_INTERLACING_SUPPORTED */ -+ { -+ png_ptr->num_rows = png_ptr->height; -+ png_ptr->iwidth = png_ptr->width; -+ } -+ png_ptr->flags &= ~PNG_FLAG_ZLIB_FINISHED; -+ if (inflateReset(&(png_ptr->zstream)) != Z_OK) -+ png_error(png_ptr, "inflateReset failed"); -+ png_ptr->zstream.avail_in = 0; -+ png_ptr->zstream.next_in = 0; -+ png_ptr->zstream.next_out = png_ptr->row_buf; -+ png_ptr->zstream.avail_out = (uInt)PNG_ROWBYTES(png_ptr->pixel_depth, -+ png_ptr->iwidth) + 1; -+} -+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -+#endif /* PNG_READ_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED */ -diff -Naru libpng-1.5.15.org/pngset.c libpng-1.5.15/pngset.c ---- libpng-1.5.15.org/pngset.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngset.c 2013-04-02 20:39:30.000000000 +0900 -@@ -262,6 +262,11 @@ - info_ptr->rowbytes = 0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); -+ -+#ifdef PNG_APNG_SUPPORTED -+ /* for non-animated png. this may be overwritten from an acTL chunk later */ -+ info_ptr->num_frames = 1; -+#endif - } - - #ifdef PNG_oFFs_SUPPORTED -@@ -1048,6 +1053,147 @@ - } - #endif /* PNG_sPLT_SUPPORTED */ - -+#ifdef PNG_APNG_SUPPORTED -+png_uint_32 PNGAPI -+png_set_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_debug1(1, "in %s storage function", "acTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_acTL() with NULL png_ptr " -+ "or info_ptr ignored"); -+ return (0); -+ } -+ if (num_frames == 0) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames zero"); -+ return (0); -+ } -+ if (num_frames > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames > 2^31-1"); -+ return (0); -+ } -+ if (num_plays > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_plays " -+ "> 2^31-1"); -+ return (0); -+ } -+ -+ info_ptr->num_frames = num_frames; -+ info_ptr->num_plays = num_plays; -+ -+ info_ptr->valid |= PNG_INFO_acTL; -+ -+ return (1); -+} -+ -+/* delay_num and delay_den can hold any 16-bit values including zero */ -+png_uint_32 PNGAPI -+png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug1(1, "in %s storage function", "fcTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " -+ "ignored"); -+ return (0); -+ } -+ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ if (blend_op == PNG_BLEND_OP_OVER) -+ { -+ if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) && -+ !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) -+ { -+ png_warning(png_ptr, "PNG_BLEND_OP_OVER is meaningless " -+ "and wasteful for opaque images, ignored"); -+ blend_op = PNG_BLEND_OP_SOURCE; -+ } -+ } -+ -+ info_ptr->next_frame_width = width; -+ info_ptr->next_frame_height = height; -+ info_ptr->next_frame_x_offset = x_offset; -+ info_ptr->next_frame_y_offset = y_offset; -+ info_ptr->next_frame_delay_num = delay_num; -+ info_ptr->next_frame_delay_den = delay_den; -+ info_ptr->next_frame_dispose_op = dispose_op; -+ info_ptr->next_frame_blend_op = blend_op; -+ -+ info_ptr->valid |= PNG_INFO_fcTL; -+ -+ return (1); -+} -+ -+void /* PRIVATE */ -+png_ensure_fcTL_is_valid(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ if (width + x_offset > png_ptr->first_frame_width || -+ height + y_offset > png_ptr->first_frame_height) -+ png_error(png_ptr, "dimensions of a frame are greater than" -+ "the ones in IHDR"); -+ if (width > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); -+ if (height > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); -+ if (x_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); -+ if (y_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); -+ -+ if (dispose_op != PNG_DISPOSE_OP_NONE && -+ dispose_op != PNG_DISPOSE_OP_BACKGROUND && -+ dispose_op != PNG_DISPOSE_OP_PREVIOUS) -+ png_error(png_ptr, "invalid dispose_op in fcTL"); -+ -+ if (blend_op != PNG_BLEND_OP_SOURCE && -+ blend_op != PNG_BLEND_OP_OVER) -+ png_error(png_ptr, "invalid blend_op in fcTL"); -+ -+ PNG_UNUSED(delay_num) -+ PNG_UNUSED(delay_den) -+} -+ -+png_uint_32 PNGAPI -+png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, -+ png_byte is_hidden) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()"); -+ -+ if (png_ptr == NULL) -+ return 0; -+ -+ if (is_hidden) -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ else -+ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; -+ -+ PNG_UNUSED(info_ptr) -+ -+ return 1; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED - void PNGAPI - png_set_unknown_chunks(png_structp png_ptr, -diff -Naru libpng-1.5.15.org/pngstruct.h libpng-1.5.15/pngstruct.h ---- libpng-1.5.15.org/pngstruct.h 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngstruct.h 2013-04-02 20:39:30.000000000 +0900 -@@ -293,6 +293,27 @@ - png_byte filter_type; - #endif - -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 apng_flags; -+ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ -+ png_uint_32 first_frame_width; -+ png_uint_32 first_frame_height; -+ -+#ifdef PNG_READ_APNG_SUPPORTED -+ png_uint_32 num_frames_read; /* incremented after all image data of */ -+ /* a frame is read */ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ -+ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ -+#endif -+#endif -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_uint_32 num_frames_to_write; -+ png_uint_32 num_frames_written; -+#endif -+#endif /* PNG_APNG_SUPPORTED */ -+ - /* New members added in libpng-1.2.0 */ - - /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -diff -Naru libpng-1.5.15.org/pngtest.c libpng-1.5.15/pngtest.c ---- libpng-1.5.15.org/pngtest.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngtest.c 2013-04-02 20:39:30.000000000 +0900 -@@ -822,6 +822,10 @@ - png_uint_32 width, height; - int num_pass, pass; - int bit_depth, color_type; -+#ifdef PNG_APNG_SUPPORTED -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+#endif - - row_buf = NULL; - error_parameters.file_name = inname; -@@ -1271,6 +1275,20 @@ - } - } - #endif -+#ifdef PNG_APNG_SUPPORTED -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) -+ { -+ if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays)) -+ { -+ png_byte is_hidden; -+ pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)", -+ num_frames, num_plays); -+ png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays); -+ is_hidden = png_get_first_frame_is_hidden(read_ptr, read_info_ptr); -+ png_set_first_frame_is_hidden(write_ptr, write_info_ptr, is_hidden); -+ } -+ } -+#endif - #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - { - png_unknown_chunkp unknowns; -@@ -1336,6 +1354,89 @@ - t_misc += (t_stop - t_start); - t_start = t_stop; - #endif -+#ifdef PNG_APNG_SUPPORTED -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) -+ { -+ png_uint_32 frame; -+ for (frame = 0; frame < num_frames; frame++) -+ { -+ png_uint_32 frame_width; -+ png_uint_32 frame_height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ png_read_frame_head(read_ptr, read_info_ptr); -+ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL)) -+ { -+ png_get_next_frame_fcTL(read_ptr, read_info_ptr, -+ &frame_width, &frame_height, -+ &x_offset, &y_offset, -+ &delay_num, &delay_den, -+ &dispose_op, &blend_op); -+ } -+ else -+ { -+ frame_width = width; -+ frame_height = height; -+ x_offset = 0; -+ y_offset = 0; -+ delay_num = 1; -+ delay_den = 1; -+ dispose_op = PNG_DISPOSE_OP_NONE; -+ blend_op = PNG_BLEND_OP_SOURCE; -+ } -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_write_frame_head(write_ptr, write_info_ptr, (png_bytepp)&row_buf, -+ frame_width, frame_height, -+ x_offset, y_offset, -+ delay_num, delay_den, -+ dispose_op, blend_op); -+#endif -+ for (pass = 0; pass < num_pass; pass++) -+ { -+ pngtest_debug1("Writing row data for pass %d", pass); -+ for (y = 0; y < frame_height; y++) -+ { -+#ifndef SINGLE_ROWBUF_ALLOC -+ pngtest_debug2("Allocating row buffer (pass %d, y = %ld)...", pass, y); -+ row_buf = (png_bytep)png_malloc(read_ptr, -+ png_get_rowbytes(read_ptr, read_info_ptr)); -+ pngtest_debug2("0x%08lx (%ld bytes)", (unsigned long)row_buf, -+ png_get_rowbytes(read_ptr, read_info_ptr)); -+#endif /* !SINGLE_ROWBUF_ALLOC */ -+ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); -+ -+#ifdef PNG_WRITE_SUPPORTED -+#ifdef PNGTEST_TIMING -+ t_stop = (float)clock(); -+ t_decode += (t_stop - t_start); -+ t_start = t_stop; -+#endif -+ png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); -+#ifdef PNGTEST_TIMING -+ t_stop = (float)clock(); -+ t_encode += (t_stop - t_start); -+ t_start = t_stop; -+#endif -+#endif /* PNG_WRITE_SUPPORTED */ -+ -+#ifndef SINGLE_ROWBUF_ALLOC -+ pngtest_debug2("Freeing row buffer (pass %d, y = %ld)", pass, y); -+ png_free(read_ptr, row_buf); -+ row_buf = NULL; -+#endif /* !SINGLE_ROWBUF_ALLOC */ -+ } -+ } -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_write_frame_tail(write_ptr, write_info_ptr); -+#endif -+ } -+ } -+ else -+#endif - for (pass = 0; pass < num_pass; pass++) - { - pngtest_debug1("Writing row data for pass %d", pass); -diff -Naru libpng-1.5.15.org/pngwrite.c libpng-1.5.15/pngwrite.c ---- libpng-1.5.15.org/pngwrite.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngwrite.c 2013-04-02 20:39:30.000000000 +0900 -@@ -58,6 +58,10 @@ - /* The rest of these check to see if the valid field has the appropriate - * flag set, and if it does, writes the chunk. - */ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (info_ptr->valid & PNG_INFO_acTL) -+ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); -+#endif - #ifdef PNG_WRITE_gAMA_SUPPORTED - if (info_ptr->valid & PNG_INFO_gAMA) - png_write_gAMA_fixed(png_ptr, info_ptr->gamma); -@@ -310,6 +314,11 @@ - png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); - #endif - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) -+ png_error(png_ptr, "Not enough frames written"); -+#endif -+ - /* See if user wants us to write information chunks */ - if (info_ptr != NULL) - { -@@ -1667,4 +1676,42 @@ - PNG_UNUSED(params) - } - #endif -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void PNGAPI -+png_write_frame_head(png_structp png_ptr, png_infop info_ptr, -+ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+ png_debug(1, "in png_write_frame_head"); -+ -+ /* there is a chance this has been set after png_write_info was called, -+ * so it would be set but not written. is there a way to be sure? */ -+ if (!(info_ptr->valid & PNG_INFO_acTL)) -+ png_error(png_ptr, "png_write_frame_head(): acTL not set"); -+ -+ png_write_reset(png_ptr); -+ -+ png_write_reinit(png_ptr, info_ptr, width, height); -+ -+ if ( !(png_ptr->num_frames_written == 0 && -+ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) -+ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ PNG_UNUSED(row_pointers) -+} -+ -+void PNGAPI -+png_write_frame_tail(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_write_frame_tail"); -+ -+ png_ptr->num_frames_written++; -+ -+ PNG_UNUSED(info_ptr) -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ - #endif /* PNG_WRITE_SUPPORTED */ -diff -Naru libpng-1.5.15.org/pngwutil.c libpng-1.5.15/pngwutil.c ---- libpng-1.5.15.org/pngwutil.c 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/pngwutil.c 2013-04-02 20:39:30.000000000 +0900 -@@ -818,6 +818,11 @@ - /* Write the chunk */ - png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* Initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; -@@ -1032,7 +1037,28 @@ - } - #endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */ - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ if (png_ptr->num_frames_written == 0) -+#endif - png_write_complete_chunk(png_ptr, png_IDAT, data, length); -+#ifdef PNG_WRITE_APNG_SUPPORTED -+ else -+ { -+ png_byte buf[4]; -+ -+ png_write_chunk_header(png_ptr, png_fdAT, 4 + length); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_write_chunk_data(png_ptr, buf, 4); -+ -+ png_write_chunk_data(png_ptr, data, length); -+ -+ png_write_chunk_end(png_ptr); -+ -+ png_ptr->next_seq_num++; -+ } -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - png_ptr->mode |= PNG_HAVE_IDAT; - - /* Prior to 1.5.4 this code was replicated in every caller (except at the -@@ -1995,6 +2021,64 @@ - } - #endif - -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void /* PRIVATE */ -+png_write_acTL(png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_byte buf[8]; -+ -+ png_debug(1, "in png_write_acTL"); -+ -+ png_ptr->num_frames_to_write = num_frames; -+ -+ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) -+ num_frames--; -+ -+ png_save_uint_32(buf, num_frames); -+ png_save_uint_32(buf + 4, num_plays); -+ -+ png_write_complete_chunk(png_ptr, png_acTL, buf, (png_size_t)8); -+} -+ -+void /* PRIVATE */ -+png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+ png_byte buf[26]; -+ -+ png_debug(1, "in png_write_fcTL"); -+ -+ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "x and/or y offset for the first frame aren't 0"); -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR"); -+ -+ /* more error checking */ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_save_uint_32(buf + 4, width); -+ png_save_uint_32(buf + 8, height); -+ png_save_uint_32(buf + 12, x_offset); -+ png_save_uint_32(buf + 16, y_offset); -+ png_save_uint_16(buf + 20, delay_num); -+ png_save_uint_16(buf + 22, delay_den); -+ buf[24] = dispose_op; -+ buf[25] = blend_op; -+ -+ png_write_complete_chunk(png_ptr, png_fcTL, buf, (png_size_t)26); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - /* Initializes the row writing capability of libpng */ - void /* PRIVATE */ - png_write_start_row(png_structp png_ptr) -@@ -3174,4 +3258,39 @@ - } - #endif - } -+ -+#ifdef PNG_WRITE_APNG_SUPPORTED -+void /* PRIVATE */ -+png_write_reset(png_structp png_ptr) -+{ -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+} -+ -+void /* PRIVATE */ -+png_write_reinit(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height) -+{ -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR"); -+ if (width > png_ptr->first_frame_width || -+ height > png_ptr->first_frame_height) -+ png_error(png_ptr, "width and/or height for a frame greater than" -+ "the ones in IHDR"); -+ -+ png_set_IHDR(png_ptr, info_ptr, width, height, -+ info_ptr->bit_depth, info_ptr->color_type, -+ info_ptr->interlace_type, info_ptr->compression_type, -+ info_ptr->filter_type); -+ -+ png_ptr->width = width; -+ png_ptr->height = height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); -+ png_ptr->usr_width = png_ptr->width; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ - #endif /* PNG_WRITE_SUPPORTED */ -diff -Naru libpng-1.5.15.org/scripts/symbols.def libpng-1.5.15/scripts/symbols.def ---- libpng-1.5.15.org/scripts/symbols.def 2013-04-02 20:39:30.000000000 +0900 -+++ libpng-1.5.15/scripts/symbols.def 2013-04-02 20:39:30.000000000 +0900 -@@ -242,3 +242,23 @@ - png_set_check_for_invalid_index @234 - png_get_palette_max @235 - png_set_option @236 -+ png_get_acTL @237 -+ png_set_acTL @238 -+ png_get_num_frames @239 -+ png_get_num_plays @240 -+ png_get_next_frame_fcTL @241 -+ png_set_next_frame_fcTL @242 -+ png_get_next_frame_width @243 -+ png_get_next_frame_height @244 -+ png_get_next_frame_x_offset @245 -+ png_get_next_frame_y_offset @246 -+ png_get_next_frame_delay_num @247 -+ png_get_next_frame_delay_den @248 -+ png_get_next_frame_dispose_op @249 -+ png_get_next_frame_blend_op @250 -+ png_get_first_frame_is_hidden @251 -+ png_set_first_frame_is_hidden @252 -+ png_read_frame_head @253 -+ png_set_progressive_frame_fn @254 -+ png_write_frame_head @255 -+ png_write_frame_tail @256 diff --git a/package/libpng/patches/libpng-1.6.8-apng.patch b/package/libpng/patches/libpng-1.6.8-apng.patch new file mode 100644 index 000000000..02cf32620 --- /dev/null +++ b/package/libpng/patches/libpng-1.6.8-apng.patch @@ -0,0 +1,1701 @@ +diff -Naru libpng-1.6.8.org/png.h libpng-1.6.8/png.h +--- libpng-1.6.8.org/png.h 2013-12-22 17:03:17.220988502 +0900 ++++ libpng-1.6.8/png.h 2013-12-22 17:03:17.287990651 +0900 +@@ -451,6 +451,10 @@ + # include "pnglibconf.h" + #endif + ++#define PNG_APNG_SUPPORTED ++#define PNG_READ_APNG_SUPPORTED ++#define PNG_WRITE_APNG_SUPPORTED ++ + #ifndef PNG_VERSION_INFO_ONLY + /* Machine specific configuration. */ + # include "pngconf.h" +@@ -541,6 +545,17 @@ + * See pngconf.h for base types that vary by machine/system + */ + ++#ifdef PNG_APNG_SUPPORTED ++/* dispose_op flags from inside fcTL */ ++#define PNG_DISPOSE_OP_NONE 0x00 ++#define PNG_DISPOSE_OP_BACKGROUND 0x01 ++#define PNG_DISPOSE_OP_PREVIOUS 0x02 ++ ++/* blend_op flags from inside fcTL */ ++#define PNG_BLEND_OP_SOURCE 0x00 ++#define PNG_BLEND_OP_OVER 0x01 ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +@@ -861,6 +876,10 @@ + #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ + #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ + #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_INFO_acTL 0x10000 ++#define PNG_INFO_fcTL 0x20000 ++#endif + + /* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using +@@ -898,6 +917,10 @@ + #ifdef PNG_PROGRESSIVE_READ_SUPPORTED + typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); + typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); ++#ifdef PNG_APNG_SUPPORTED ++typedef PNG_CALLBACK(void, *png_progressive_frame_ptr, (png_structp, ++ png_uint_32)); ++#endif + + /* The following callback receives png_uint_32 row_number, int pass for the + * png_bytep data of the row. When transforming an interlaced image the +@@ -3300,6 +3323,74 @@ + /******************************************************************************* + * END OF HARDWARE OPTIONS + ******************************************************************************/ ++#ifdef PNG_APNG_SUPPORTED ++PNG_EXPORT(245, png_uint_32, png_get_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); ++ ++PNG_EXPORT(246, png_uint_32, png_set_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); ++ ++PNG_EXPORT(247, png_uint_32, png_get_num_frames, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(248, png_uint_32, png_get_num_plays, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(249, png_uint_32, png_get_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, ++ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, ++ png_byte *blend_op)); ++ ++PNG_EXPORT(250, png_uint_32, png_set_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, ++ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(251, png_uint_32, png_get_next_frame_width, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(252, png_uint_32, png_get_next_frame_height, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(253, png_uint_32, png_get_next_frame_x_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(254, png_uint_32, png_get_next_frame_y_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(255, png_uint_16, png_get_next_frame_delay_num, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(256, png_uint_16, png_get_next_frame_delay_den, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(257, png_byte, png_get_next_frame_dispose_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(258, png_byte, png_get_next_frame_blend_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(259, png_byte, png_get_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(260, png_uint_32, png_set_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_EXPORT(261, void, png_read_frame_head, (png_structp png_ptr, ++ png_infop info_ptr)); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_EXPORT(262, void, png_set_progressive_frame_fn, (png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn)); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_EXPORT(263, void, png_write_frame_head, (png_structp png_ptr, ++ png_infop info_ptr, png_bytepp row_pointers, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(264, void, png_write_frame_tail, (png_structp png_ptr, ++ png_infop info_ptr)); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ + + /* Maintainer: Put new public prototypes here ^, in libpng.3, and project + * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt +@@ -3310,7 +3401,11 @@ + * scripts/symbols.def as well. + */ + #ifdef PNG_EXPORT_LAST_ORDINAL ++#ifdef PNG_APNG_SUPPORTED ++ PNG_EXPORT_LAST_ORDINAL(264); ++#else + PNG_EXPORT_LAST_ORDINAL(244); ++#endif /* PNG_APNG_SUPPORTED */ + #endif + + #ifdef __cplusplus +diff -Naru libpng-1.6.8.org/pngget.c libpng-1.6.8/pngget.c +--- libpng-1.6.8.org/pngget.c 2013-12-22 17:03:17.220988502 +0900 ++++ libpng-1.6.8/pngget.c 2013-12-22 17:03:17.288990684 +0900 +@@ -1174,4 +1174,166 @@ + # endif + #endif + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_get_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *num_frames, png_uint_32 *num_plays) ++{ ++ png_debug1(1, "in %s retrieval function", "acTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_acTL) && ++ num_frames != NULL && num_plays != NULL) ++ { ++ *num_frames = info_ptr->num_frames; ++ *num_plays = info_ptr->num_plays; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_frames(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_frames()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_frames); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_plays(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_plays()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_plays); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *width, png_uint_32 *height, ++ png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, ++ png_byte *dispose_op, png_byte *blend_op) ++{ ++ png_debug1(1, "in %s retrieval function", "fcTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_fcTL) && ++ width != NULL && height != NULL && ++ x_offset != NULL && y_offset != NULL && ++ delay_num != NULL && delay_den != NULL && ++ dispose_op != NULL && blend_op != NULL) ++ { ++ *width = info_ptr->next_frame_width; ++ *height = info_ptr->next_frame_height; ++ *x_offset = info_ptr->next_frame_x_offset; ++ *y_offset = info_ptr->next_frame_y_offset; ++ *delay_num = info_ptr->next_frame_delay_num; ++ *delay_den = info_ptr->next_frame_delay_den; ++ *dispose_op = info_ptr->next_frame_dispose_op; ++ *blend_op = info_ptr->next_frame_blend_op; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_width()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_width); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_height()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_height); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_x_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_x_offset); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_y_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_y_offset); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_num()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_num); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_den()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_den); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_dispose_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_dispose_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_blend_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_blend_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr != NULL) ++ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 0; ++} ++#endif /* PNG_APNG_SUPPORTED */ + #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ +diff -Naru libpng-1.6.8.org/pnginfo.h libpng-1.6.8/pnginfo.h +--- libpng-1.6.8.org/pnginfo.h 2013-12-22 17:03:17.220988502 +0900 ++++ libpng-1.6.8/pnginfo.h 2013-12-22 17:03:17.288990684 +0900 +@@ -256,5 +256,18 @@ + png_bytepp row_pointers; /* the image bits */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; /* including default image */ ++ png_uint_32 num_plays; ++ png_uint_32 next_frame_width; ++ png_uint_32 next_frame_height; ++ png_uint_32 next_frame_x_offset; ++ png_uint_32 next_frame_y_offset; ++ png_uint_16 next_frame_delay_num; ++ png_uint_16 next_frame_delay_den; ++ png_byte next_frame_dispose_op; ++ png_byte next_frame_blend_op; ++#endif ++ + }; + #endif /* PNGINFO_H */ +diff -Naru libpng-1.6.8.org/pngpread.c libpng-1.6.8/pngpread.c +--- libpng-1.6.8.org/pngpread.c 2013-12-22 17:03:17.221988534 +0900 ++++ libpng-1.6.8/pngpread.c 2013-12-22 17:03:17.288990684 +0900 +@@ -217,6 +217,109 @@ + + chunk_name = png_ptr->chunk_name; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0 && ++ png_ptr->num_frames_read < info_ptr->num_frames) ++ { ++ if (chunk_name == png_IDAT) ++ { ++ /* Discard trailing IDATs for the first frame */ ++ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "out of place IDAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_push_crc_skip(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ else if (chunk_name == png_fdAT) ++ { ++ if (png_ptr->buffer_size < 4) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ensure_sequence_number(png_ptr, 4); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ { ++ /* Discard trailing fdATs for frames other than the first */ ++ if (png_ptr->num_frames_read < 2) ++ png_error(png_ptr, "out of place fdAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_push_crc_skip(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ else ++ { ++ /* frame data follows */ ++ png_ptr->idat_size = png_ptr->push_length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ png_ptr->process_mode = PNG_READ_IDAT_MODE; ++ ++ return; ++ } ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_read_reset(png_ptr); ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ png_error(png_ptr, "missing required fcTL chunk"); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ png_progressive_read_reset(png_ptr); ++ ++ if (png_ptr->frame_info_fn != NULL) ++ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ ++ return; ++ } ++ ++ else ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_push_crc_skip(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ return; ++ } ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + if (chunk_name == png_IDAT) + { + if (png_ptr->mode & PNG_AFTER_IDAT) +@@ -299,6 +402,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = png_ptr->push_length; + png_ptr->process_mode = PNG_READ_IDAT_MODE; + png_push_have_info(png_ptr, info_ptr); +@@ -529,6 +635,30 @@ + png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); + } + #endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++#endif /* PNG_READ_APNG_SUPPORTED */ + + else + { +@@ -731,7 +861,11 @@ + png_byte chunk_tag[4]; + + /* TODO: this code can be commoned up with the same code in push_read */ ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->buffer_size < 12) ++#else + if (png_ptr->buffer_size < 8) ++#endif + { + png_push_save_buffer(png_ptr); + return; +@@ -744,17 +878,64 @@ + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); + png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0) ++ { ++ if (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) ++ { ++ png_ptr->process_mode = PNG_READ_CHUNK_MODE; ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++ return; ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipping (ignoring) a chunk between " ++ "APNG chunks"); ++ png_crc_finish(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ } ++ else ++#endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0) ++#else + if (png_ptr->chunk_name != png_IDAT) ++#endif + { + png_ptr->process_mode = PNG_READ_CHUNK_MODE; + + if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) + png_error(png_ptr, "Not enough compressed data"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++#endif ++ + return; + } + + png_ptr->idat_size = png_ptr->push_length; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0) ++ { ++ png_ensure_sequence_number(png_ptr, 4); ++ png_ptr->idat_size -= 4; ++ } ++#endif + } + + if (png_ptr->idat_size && png_ptr->save_buffer_size) +@@ -832,6 +1013,15 @@ + if (!(buffer_length > 0) || buffer == NULL) + png_error(png_ptr, "No IDAT data (internal error)"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ /* If the app is not APNG-aware, decode only the first frame */ ++ if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read > 0) ++ { ++ png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++ return; ++ } ++#endif ++ + /* This routine must process all the data it has been given + * before returning, calling the row callback as required to + * handle the uncompressed results. +@@ -1280,6 +1470,18 @@ + png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); + } + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_set_progressive_frame_fn(png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn) ++{ ++ png_ptr->frame_info_fn = frame_info_fn; ++ png_ptr->frame_end_fn = frame_end_fn; ++ png_ptr->apng_flags |= PNG_APNG_APP; ++} ++#endif ++ + png_voidp PNGAPI + png_get_progressive_ptr(png_const_structrp png_ptr) + { +diff -Naru libpng-1.6.8.org/pngpriv.h libpng-1.6.8/pngpriv.h +--- libpng-1.6.8.org/pngpriv.h 2013-12-22 17:03:17.221988534 +0900 ++++ libpng-1.6.8/pngpriv.h 2013-12-22 17:03:17.289990716 +0900 +@@ -550,6 +550,10 @@ + #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ + /* 0x4000 (unused) */ + #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_HAVE_acTL 0x10000 ++#define PNG_HAVE_fcTL 0x20000 ++#endif + + /* Flags for the transformations the PNG library does on the image data */ + #define PNG_BGR 0x0001 +@@ -771,6 +775,16 @@ + #define png_tRNS PNG_U32(116, 82, 78, 83) + #define png_zTXt PNG_U32(122, 84, 88, 116) + ++#ifdef PNG_APNG_SUPPORTED ++#define png_acTL PNG_U32( 97, 99, 84, 76) ++#define png_fcTL PNG_U32(102, 99, 84, 76) ++#define png_fdAT PNG_U32(102, 100, 65, 84) ++ ++/* For png_struct.apng_flags: */ ++#define PNG_FIRST_FRAME_HIDDEN 0x0001 ++#define PNG_APNG_APP 0x0002 ++#endif ++ + /* The following will work on (signed char*) strings, whereas the get_uint_32 + * macro will fail on top-bit-set values because of the sign extension. + */ +@@ -1583,6 +1597,47 @@ + */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_ensure_fcTL_is_valid,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op), PNG_EMPTY); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_handle_acTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fcTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fdAT,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_have_info,(png_structp png_ptr, png_infop info_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_ensure_sequence_number,(png_structp png_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reinit,(png_structp png_ptr, ++ png_infop info_ptr),PNG_EMPTY); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_progressive_read_reset,(png_structp png_ptr),PNG_EMPTY); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_write_acTL,(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fcTL,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fdAT,(png_structp png_ptr, ++ png_const_bytep data, png_size_t length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reinit,(png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 width, png_uint_32 height),PNG_EMPTY); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* Added at libpng version 1.4.0 */ + #ifdef PNG_COLORSPACE_SUPPORTED + /* These internal functions are for maintaining the colorspace structure within +diff -Naru libpng-1.6.8.org/pngread.c libpng-1.6.8/pngread.c +--- libpng-1.6.8.org/pngread.c 2013-12-22 17:03:17.222988566 +0900 ++++ libpng-1.6.8/pngread.c 2013-12-22 17:03:17.290990748 +0900 +@@ -158,6 +158,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = length; + break; + } +@@ -247,6 +250,17 @@ + png_handle_iTXt(png_ptr, info_ptr, length); + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ png_handle_acTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fcTL) ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fdAT) ++ png_handle_fdAT(png_ptr, info_ptr, length); ++#endif ++ + else + png_handle_unknown(png_ptr, info_ptr, length, + PNG_HANDLE_CHUNK_AS_DEFAULT); +@@ -254,6 +268,72 @@ + } + #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_read_frame_head(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ ++ ++ png_debug(0, "Reading frame head"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_acTL)) ++ png_error(png_ptr, "attempt to png_read_frame_head() but " ++ "no acTL present"); ++ ++ /* do nothing for the main IDAT */ ++ if (png_ptr->num_frames_read == 0) ++ return; ++ ++ png_read_reset(png_ptr); ++ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ have_chunk_after_DAT = 0; ++ for (;;) ++ { ++ png_uint_32 length = png_read_chunk_header(png_ptr); ++ ++ if (png_ptr->chunk_name == png_IDAT) ++ { ++ /* discard trailing IDATs for the first frame */ ++ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); ++ png_crc_finish(png_ptr, length); ++ } ++ ++ else if (png_ptr->chunk_name == png_fcTL) ++ { ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ have_chunk_after_DAT = 1; ++ } ++ ++ else if (png_ptr->chunk_name == png_fdAT) ++ { ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* discard trailing fdATs for frames other than the first */ ++ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) ++ png_crc_finish(png_ptr, length - 4); ++ else if(png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_ptr->idat_size = length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ ++ break; ++ } ++ else ++ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); ++ } ++ else ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_crc_finish(png_ptr, length); ++ } ++ } ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + /* Optional call to update the users info_ptr structure */ + void PNGAPI + png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) +diff -Naru libpng-1.6.8.org/pngrutil.c libpng-1.6.8/pngrutil.c +--- libpng-1.6.8.org/pngrutil.c 2013-12-22 17:03:17.224988631 +0900 ++++ libpng-1.6.8/pngrutil.c 2013-12-22 17:03:17.291990780 +0900 +@@ -826,6 +826,11 @@ + filter_type = buf[11]; + interlace_type = buf[12]; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + /* Set internal variables */ + png_ptr->width = width; + png_ptr->height = height; +@@ -2700,6 +2705,179 @@ + } + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++void /* PRIVATE */ ++png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[8]; ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++ png_uint_32 didSet; ++ ++ png_debug(1, "in png_handle_acTL"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before acTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_acTL) ++ { ++ png_warning(png_ptr, "Duplicate acTL skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (length != 8) ++ { ++ png_warning(png_ptr, "acTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 8); ++ png_crc_finish(png_ptr, 0); ++ ++ num_frames = png_get_uint_31(png_ptr, data); ++ num_plays = png_get_uint_31(png_ptr, data + 4); ++ ++ /* the set function will do error checking on num_frames */ ++ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); ++ if(didSet) ++ png_ptr->mode |= PNG_HAVE_acTL; ++} ++ ++void /* PRIVATE */ ++png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[22]; ++ png_uint_32 width; ++ png_uint_32 height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ ++ png_debug(1, "in png_handle_fcTL"); ++ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before fcTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ /* for any frames other then the first this message may be misleading, ++ * but correct. PNG_HAVE_IDAT is unset before the frame head is read ++ * i can't think of a better message */ ++ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (length != 26) ++ { ++ png_warning(png_ptr, "fcTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 22); ++ png_crc_finish(png_ptr, 0); ++ ++ width = png_get_uint_31(png_ptr, data); ++ height = png_get_uint_31(png_ptr, data + 4); ++ x_offset = png_get_uint_31(png_ptr, data + 8); ++ y_offset = png_get_uint_31(png_ptr, data + 12); ++ delay_num = png_get_uint_16(data + 16); ++ delay_den = png_get_uint_16(data + 18); ++ dispose_op = data[20]; ++ blend_op = data[21]; ++ ++ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) ++ { ++ png_warning(png_ptr, "fcTL for the first frame must have zero offset"); ++ return; ++ } ++ ++ if (info_ptr != NULL) ++ { ++ if (png_ptr->num_frames_read == 0 && ++ (width != info_ptr->width || height != info_ptr->height)) ++ { ++ png_warning(png_ptr, "size in first frame's fcTL must match " ++ "the size in IHDR"); ++ return; ++ } ++ ++ /* The set function will do more error checking */ ++ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, ++ x_offset, y_offset, delay_num, delay_den, ++ dispose_op, blend_op); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ ++ png_ptr->mode |= PNG_HAVE_fcTL; ++ } ++} ++ ++void /* PRIVATE */ ++png_have_info(png_structp png_ptr, png_infop info_ptr) ++{ ++ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) ++ { ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ info_ptr->num_frames++; ++ } ++} ++ ++void /* PRIVATE */ ++png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* This function is only called from png_read_end(), png_read_info(), ++ * and png_push_read_chunk() which means that: ++ * - the user doesn't want to read this frame ++ * - or this is an out-of-place fdAT ++ * in either case it is safe to ignore the chunk with a warning */ ++ png_warning(png_ptr, "ignoring fdAT chunk"); ++ png_crc_finish(png_ptr, length - 4); ++ PNG_UNUSED(info_ptr) ++} ++ ++void /* PRIVATE */ ++png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) ++{ ++ png_byte data[4]; ++ png_uint_32 sequence_number; ++ ++ if (length < 4) ++ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); ++ ++ png_crc_read(png_ptr, data, 4); ++ sequence_number = png_get_uint_31(png_ptr, data); ++ ++ if (sequence_number != png_ptr->next_seq_num) ++ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " ++ "number found"); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ + static int +@@ -3956,7 +4134,38 @@ + { + uInt avail_in; + png_bytep buffer; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 bytes_to_skip = 0; ++ ++ while (png_ptr->idat_size == 0 || bytes_to_skip != 0) ++ { ++ png_crc_finish(png_ptr, bytes_to_skip); ++ bytes_to_skip = 0; + ++ png_ptr->idat_size = png_read_chunk_header(png_ptr); ++ if (png_ptr->num_frames_read == 0) ++ { ++ if (png_ptr->chunk_name != png_IDAT) ++ png_error(png_ptr, "Not enough image data"); ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->chunk_name != png_fdAT) ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ bytes_to_skip = png_ptr->idat_size; ++ continue; ++ } ++ ++ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); ++ ++ png_ptr->idat_size -= 4; ++ } ++ } ++#else + while (png_ptr->idat_size == 0) + { + png_crc_finish(png_ptr, 0); +@@ -3968,7 +4177,7 @@ + if (png_ptr->chunk_name != png_IDAT) + png_error(png_ptr, "Not enough image data"); + } +- ++#endif /* PNG_READ_APNG_SUPPORTED */ + avail_in = png_ptr->IDAT_read_size; + + if (avail_in > png_ptr->idat_size) +@@ -4031,6 +4240,9 @@ + + png_ptr->mode |= PNG_AFTER_IDAT; + png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->num_frames_read++; ++#endif + + if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) + png_chunk_benign_error(png_ptr, "Extra compressed data"); +@@ -4476,4 +4688,80 @@ + + png_ptr->flags |= PNG_FLAG_ROW_INIT; + } ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++/* This function is to be called after the main IDAT set has been read and ++ * before a new IDAT is read. It resets some parts of png_ptr ++ * to make them usable by the read functions again */ ++void /* PRIVATE */ ++png_read_reset(png_structp png_ptr) ++{ ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++ png_ptr->mode &= ~PNG_AFTER_IDAT; ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++} ++ ++void /* PRIVATE */ ++png_read_reinit(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_ptr->width = info_ptr->next_frame_width; ++ png_ptr->height = info_ptr->next_frame_height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); ++ png_ptr->info_rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, ++ png_ptr->width); ++ if (png_ptr->prev_row) ++ memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); ++} ++ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++/* same as png_read_reset() but for the progressive reader */ ++void /* PRIVATE */ ++png_progressive_read_reset(png_structp png_ptr) ++{ ++#ifdef PNG_READ_INTERLACING_SUPPORTED ++ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ ++ ++ /* Start of interlace block */ ++ const int png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; ++ ++ /* Offset to next interlace block */ ++ const int png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; ++ ++ /* Start of interlace block in the y direction */ ++ const int png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; ++ ++ /* Offset to next interlace block in the y direction */ ++ const int png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; ++ ++ if (png_ptr->interlaced) ++ { ++ if (!(png_ptr->transformations & PNG_INTERLACE)) ++ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - ++ png_pass_ystart[0]) / png_pass_yinc[0]; ++ else ++ png_ptr->num_rows = png_ptr->height; ++ ++ png_ptr->iwidth = (png_ptr->width + ++ png_pass_inc[png_ptr->pass] - 1 - ++ png_pass_start[png_ptr->pass]) / ++ png_pass_inc[png_ptr->pass]; ++ } ++ else ++#endif /* PNG_READ_INTERLACING_SUPPORTED */ ++ { ++ png_ptr->num_rows = png_ptr->height; ++ png_ptr->iwidth = png_ptr->width; ++ } ++ png_ptr->flags &= ~PNG_FLAG_ZSTREAM_ENDED; ++ if (inflateReset(&(png_ptr->zstream)) != Z_OK) ++ png_error(png_ptr, "inflateReset failed"); ++ png_ptr->zstream.avail_in = 0; ++ png_ptr->zstream.next_in = 0; ++ png_ptr->zstream.next_out = png_ptr->row_buf; ++ png_ptr->zstream.avail_out = (uInt)PNG_ROWBYTES(png_ptr->pixel_depth, ++ png_ptr->iwidth) + 1; ++} ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ + #endif /* PNG_READ_SUPPORTED */ +diff -Naru libpng-1.6.8.org/pngset.c libpng-1.6.8/pngset.c +--- libpng-1.6.8.org/pngset.c 2013-12-22 17:03:17.224988631 +0900 ++++ libpng-1.6.8/pngset.c 2013-12-22 17:03:17.292990812 +0900 +@@ -239,6 +239,11 @@ + info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); + + info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); ++ ++#ifdef PNG_APNG_SUPPORTED ++ /* for non-animated png. this may be overwritten from an acTL chunk later */ ++ info_ptr->num_frames = 1; ++#endif + } + + #ifdef PNG_oFFs_SUPPORTED +@@ -1065,6 +1070,147 @@ + } + #endif /* PNG_sPLT_SUPPORTED */ + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_set_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_debug1(1, "in %s storage function", "acTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_acTL() with NULL png_ptr " ++ "or info_ptr ignored"); ++ return (0); ++ } ++ if (num_frames == 0) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames zero"); ++ return (0); ++ } ++ if (num_frames > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames > 2^31-1"); ++ return (0); ++ } ++ if (num_plays > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_plays " ++ "> 2^31-1"); ++ return (0); ++ } ++ ++ info_ptr->num_frames = num_frames; ++ info_ptr->num_plays = num_plays; ++ ++ info_ptr->valid |= PNG_INFO_acTL; ++ ++ return (1); ++} ++ ++/* delay_num and delay_den can hold any 16-bit values including zero */ ++png_uint_32 PNGAPI ++png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ png_debug1(1, "in %s storage function", "fcTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " ++ "ignored"); ++ return (0); ++ } ++ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ if (blend_op == PNG_BLEND_OP_OVER) ++ { ++ if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) && ++ !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) ++ { ++ png_warning(png_ptr, "PNG_BLEND_OP_OVER is meaningless " ++ "and wasteful for opaque images, ignored"); ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++ } ++ ++ info_ptr->next_frame_width = width; ++ info_ptr->next_frame_height = height; ++ info_ptr->next_frame_x_offset = x_offset; ++ info_ptr->next_frame_y_offset = y_offset; ++ info_ptr->next_frame_delay_num = delay_num; ++ info_ptr->next_frame_delay_den = delay_den; ++ info_ptr->next_frame_dispose_op = dispose_op; ++ info_ptr->next_frame_blend_op = blend_op; ++ ++ info_ptr->valid |= PNG_INFO_fcTL; ++ ++ return (1); ++} ++ ++void /* PRIVATE */ ++png_ensure_fcTL_is_valid(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ if (width > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); ++ if (height > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); ++ if (x_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); ++ if (y_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); ++ if (width + x_offset > png_ptr->first_frame_width || ++ height + y_offset > png_ptr->first_frame_height) ++ png_error(png_ptr, "dimensions of a frame are greater than" ++ "the ones in IHDR"); ++ ++ if (dispose_op != PNG_DISPOSE_OP_NONE && ++ dispose_op != PNG_DISPOSE_OP_BACKGROUND && ++ dispose_op != PNG_DISPOSE_OP_PREVIOUS) ++ png_error(png_ptr, "invalid dispose_op in fcTL"); ++ ++ if (blend_op != PNG_BLEND_OP_SOURCE && ++ blend_op != PNG_BLEND_OP_OVER) ++ png_error(png_ptr, "invalid blend_op in fcTL"); ++ ++ PNG_UNUSED(delay_num) ++ PNG_UNUSED(delay_den) ++} ++ ++png_uint_32 PNGAPI ++png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, ++ png_byte is_hidden) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr == NULL) ++ return 0; ++ ++ if (is_hidden) ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ else ++ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 1; ++} ++#endif /* PNG_APNG_SUPPORTED */ ++ + #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED + static png_byte + check_location(png_const_structrp png_ptr, int location) +diff -Naru libpng-1.6.8.org/pngstruct.h libpng-1.6.8/pngstruct.h +--- libpng-1.6.8.org/pngstruct.h 2013-12-22 17:03:17.224988631 +0900 ++++ libpng-1.6.8/pngstruct.h 2013-12-22 17:03:17.292990812 +0900 +@@ -409,6 +409,27 @@ + png_byte filter_type; + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 apng_flags; ++ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ ++ png_uint_32 first_frame_width; ++ png_uint_32 first_frame_height; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 num_frames_read; /* incremented after all image data of */ ++ /* a frame is read */ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ ++ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ ++#endif ++#endif ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_uint_32 num_frames_to_write; ++ png_uint_32 num_frames_written; ++#endif ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* New members added in libpng-1.2.0 */ + + /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +diff -Naru libpng-1.6.8.org/pngtest.c libpng-1.6.8/pngtest.c +--- libpng-1.6.8.org/pngtest.c 2013-12-22 17:03:17.224988631 +0900 ++++ libpng-1.6.8/pngtest.c 2013-12-22 17:03:17.292990812 +0900 +@@ -840,6 +840,10 @@ + png_uint_32 width, height; + int num_pass, pass; + int bit_depth, color_type; ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++#endif + + row_buf = NULL; + error_parameters.file_name = inname; +@@ -1290,6 +1294,20 @@ + } + } + #endif ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays)) ++ { ++ png_byte is_hidden; ++ pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)", ++ num_frames, num_plays); ++ png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays); ++ is_hidden = png_get_first_frame_is_hidden(read_ptr, read_info_ptr); ++ png_set_first_frame_is_hidden(write_ptr, write_info_ptr, is_hidden); ++ } ++ } ++#endif + #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + { + png_unknown_chunkp unknowns; +@@ -1355,6 +1373,89 @@ + t_misc += (t_stop - t_start); + t_start = t_stop; + #endif ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ png_uint_32 frame; ++ for (frame = 0; frame < num_frames; frame++) ++ { ++ png_uint_32 frame_width; ++ png_uint_32 frame_height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ png_read_frame_head(read_ptr, read_info_ptr); ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL)) ++ { ++ png_get_next_frame_fcTL(read_ptr, read_info_ptr, ++ &frame_width, &frame_height, ++ &x_offset, &y_offset, ++ &delay_num, &delay_den, ++ &dispose_op, &blend_op); ++ } ++ else ++ { ++ frame_width = width; ++ frame_height = height; ++ x_offset = 0; ++ y_offset = 0; ++ delay_num = 1; ++ delay_den = 1; ++ dispose_op = PNG_DISPOSE_OP_NONE; ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_head(write_ptr, write_info_ptr, (png_bytepp)&row_buf, ++ frame_width, frame_height, ++ x_offset, y_offset, ++ delay_num, delay_den, ++ dispose_op, blend_op); ++#endif ++ for (pass = 0; pass < num_pass; pass++) ++ { ++ pngtest_debug1("Writing row data for pass %d", pass); ++ for (y = 0; y < frame_height; y++) ++ { ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Allocating row buffer (pass %d, y = %ld)...", pass, y); ++ row_buf = (png_bytep)png_malloc(read_ptr, ++ png_get_rowbytes(read_ptr, read_info_ptr)); ++ pngtest_debug2("0x%08lx (%ld bytes)", (unsigned long)row_buf, ++ png_get_rowbytes(read_ptr, read_info_ptr)); ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); ++ ++#ifdef PNG_WRITE_SUPPORTED ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_decode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++ png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_encode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++#endif /* PNG_WRITE_SUPPORTED */ ++ ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Freeing row buffer (pass %d, y = %ld)", pass, y); ++ png_free(read_ptr, row_buf); ++ row_buf = NULL; ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ } ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_tail(write_ptr, write_info_ptr); ++#endif ++ } ++ } ++ else ++#endif + for (pass = 0; pass < num_pass; pass++) + { + pngtest_debug1("Writing row data for pass %d", pass); +diff -Naru libpng-1.6.8.org/pngwrite.c libpng-1.6.8/pngwrite.c +--- libpng-1.6.8.org/pngwrite.c 2013-12-22 17:03:17.225988663 +0900 ++++ libpng-1.6.8/pngwrite.c 2013-12-22 17:03:17.310991389 +0900 +@@ -127,6 +127,10 @@ + * application continues writing the PNG. So check the 'invalid' flag here + * too. + */ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (info_ptr->valid & PNG_INFO_acTL) ++ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); ++#endif + #ifdef PNG_GAMMA_SUPPORTED + # ifdef PNG_WRITE_gAMA_SUPPORTED + if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) && +@@ -357,6 +361,11 @@ + png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) ++ png_error(png_ptr, "Not enough frames written"); ++#endif ++ + /* See if user wants us to write information chunks */ + if (info_ptr != NULL) + { +@@ -1560,6 +1569,43 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void PNGAPI ++png_write_frame_head(png_structp png_ptr, png_infop info_ptr, ++ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_debug(1, "in png_write_frame_head"); ++ ++ /* there is a chance this has been set after png_write_info was called, ++ * so it would be set but not written. is there a way to be sure? */ ++ if (!(info_ptr->valid & PNG_INFO_acTL)) ++ png_error(png_ptr, "png_write_frame_head(): acTL not set"); ++ ++ png_write_reset(png_ptr); ++ ++ png_write_reinit(png_ptr, info_ptr, width, height); ++ ++ if ( !(png_ptr->num_frames_written == 0 && ++ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) ++ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ PNG_UNUSED(row_pointers) ++} ++ ++void PNGAPI ++png_write_frame_tail(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_write_frame_tail"); ++ ++ png_ptr->num_frames_written++; ++ ++ PNG_UNUSED(info_ptr) ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + + #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED + #ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */ +diff -Naru libpng-1.6.8.org/pngwutil.c libpng-1.6.8/pngwutil.c +--- libpng-1.6.8.org/pngwutil.c 2013-12-22 17:03:17.226988695 +0900 ++++ libpng-1.6.8/pngwutil.c 2013-12-22 17:03:17.311991421 +0900 +@@ -898,6 +898,11 @@ + /* Write the chunk */ + png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + if (!(png_ptr->do_filter)) + { + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || +@@ -1076,7 +1081,14 @@ + optimize_cmf(data, png_image_size(png_ptr)); + # endif + ++# ifdef PNG_WRITE_APNG_SUPPORTED ++ if (png_ptr->num_frames_written == 0) ++# endif + png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++# ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++# endif /* PNG_WRITE_APNG_SUPPORTED */ + png_ptr->mode |= PNG_HAVE_IDAT; + + png_ptr->zstream.next_out = data; +@@ -1122,7 +1134,15 @@ + optimize_cmf(data, png_image_size(png_ptr)); + # endif + ++# ifdef PNG_WRITE_APNG_SUPPORTED ++ if (png_ptr->num_frames_written == 0) ++# endif + png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++# ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++# endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + png_ptr->zstream.avail_out = 0; + png_ptr->zstream.next_out = NULL; + png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; +@@ -1934,6 +1954,82 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_acTL(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_byte buf[8]; ++ ++ png_debug(1, "in png_write_acTL"); ++ ++ png_ptr->num_frames_to_write = num_frames; ++ ++ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ++ num_frames--; ++ ++ png_save_uint_32(buf, num_frames); ++ png_save_uint_32(buf + 4, num_plays); ++ ++ png_write_complete_chunk(png_ptr, png_acTL, buf, (png_size_t)8); ++} ++ ++void /* PRIVATE */ ++png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_byte buf[26]; ++ ++ png_debug(1, "in png_write_fcTL"); ++ ++ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) ++ png_error(png_ptr, "x and/or y offset for the first frame aren't 0"); ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ ++ /* more error checking */ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_save_uint_32(buf + 4, width); ++ png_save_uint_32(buf + 8, height); ++ png_save_uint_32(buf + 12, x_offset); ++ png_save_uint_32(buf + 16, y_offset); ++ png_save_uint_16(buf + 20, delay_num); ++ png_save_uint_16(buf + 22, delay_den); ++ buf[24] = dispose_op; ++ buf[25] = blend_op; ++ ++ png_write_complete_chunk(png_ptr, png_fcTL, buf, (png_size_t)26); ++ ++ png_ptr->next_seq_num++; ++} ++ ++void /* PRIVATE */ ++png_write_fdAT(png_structp png_ptr, ++ png_const_bytep data, png_size_t length) ++{ ++ png_byte buf[4]; ++ ++ png_write_chunk_header(png_ptr, png_fdAT, (png_uint_32)(4 + length)); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_write_chunk_data(png_ptr, buf, 4); ++ ++ png_write_chunk_data(png_ptr, data, length); ++ ++ png_write_chunk_end(png_ptr); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + /* Initializes the row writing capability of libpng */ + void /* PRIVATE */ + png_write_start_row(png_structrp png_ptr) +@@ -3020,4 +3116,39 @@ + } + #endif + } ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_reset(png_structp png_ptr) ++{ ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++} ++ ++void /* PRIVATE */ ++png_write_reinit(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height) ++{ ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ if (width > png_ptr->first_frame_width || ++ height > png_ptr->first_frame_height) ++ png_error(png_ptr, "width and/or height for a frame greater than" ++ "the ones in IHDR"); ++ ++ png_set_IHDR(png_ptr, info_ptr, width, height, ++ info_ptr->bit_depth, info_ptr->color_type, ++ info_ptr->interlace_type, info_ptr->compression_type, ++ info_ptr->filter_type); ++ ++ png_ptr->width = width; ++ png_ptr->height = height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); ++ png_ptr->usr_width = png_ptr->width; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + #endif /* PNG_WRITE_SUPPORTED */ +diff -Naru libpng-1.6.8.org/scripts/symbols.def libpng-1.6.8/scripts/symbols.def +--- libpng-1.6.8.org/scripts/symbols.def 2013-12-22 17:03:17.232988887 +0900 ++++ libpng-1.6.8/scripts/symbols.def 2013-12-22 17:03:17.317991614 +0900 +@@ -249,3 +249,23 @@ + png_set_check_for_invalid_index @242 + png_get_palette_max @243 + png_set_option @244 ++ png_get_acTL @245 ++ png_set_acTL @246 ++ png_get_num_frames @247 ++ png_get_num_plays @248 ++ png_get_next_frame_fcTL @249 ++ png_set_next_frame_fcTL @250 ++ png_get_next_frame_width @251 ++ png_get_next_frame_height @252 ++ png_get_next_frame_x_offset @253 ++ png_get_next_frame_y_offset @254 ++ png_get_next_frame_delay_num @255 ++ png_get_next_frame_delay_den @256 ++ png_get_next_frame_dispose_op @257 ++ png_get_next_frame_blend_op @258 ++ png_get_first_frame_is_hidden @259 ++ png_set_first_frame_is_hidden @260 ++ png_read_frame_head @261 ++ png_set_progressive_frame_fn @262 ++ png_write_frame_head @263 ++ png_write_frame_tail @264 diff --git a/package/nspr/Makefile b/package/nspr/Makefile index eaa679d95..33063d67f 100644 --- a/package/nspr/Makefile +++ b/package/nspr/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:= nspr -PKG_VERSION:= 4.9.6 -PKG_RELEASE:= 2 -PKG_MD5SUM:= 62b1e9d376d503d972f90c3c0031d879 +PKG_VERSION:= 4.10.2 +PKG_RELEASE:= 1 +PKG_MD5SUM:= f0d254da0b2b870d9a5fa094e879d4b8 PKG_DESCR:= Netscape Portable Runtime library PKG_SECTION:= libs PKG_URL:= http://www.mozilla.org/projects/nspr/ @@ -15,7 +15,7 @@ PKG_OPTS:= dev PKG_ARCH_DEPENDS:= !cris -WRKSRC= ${WRKDIST}/mozilla/nsprpub +WRKSRC= ${WRKDIST}/nspr include $(TOPDIR)/mk/package.mk diff --git a/package/nspr/patches/patch-mozilla_nsprpub_config_Makefile_in b/package/nspr/patches/patch-mozilla_nsprpub_config_Makefile_in deleted file mode 100644 index 9e925158b..000000000 --- a/package/nspr/patches/patch-mozilla_nsprpub_config_Makefile_in +++ /dev/null @@ -1,11 +0,0 @@ ---- nspr-4.9.5.orig/mozilla/nsprpub/config/Makefile.in 2012-11-14 00:17:57.000000000 +0100 -+++ nspr-4.9.5/mozilla/nsprpub/config/Makefile.in 2013-02-27 16:29:38.000000000 +0100 -@@ -113,7 +113,7 @@ endif - - $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) - @$(MAKE_OBJDIR) -- $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ -+ $(CC_FOR_BUILD) $(HOSTCFLAGS) $< $(HOSTLDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ - - install:: nspr.m4 - $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal diff --git a/package/nspr/patches/patch-mozilla_nsprpub_configure b/package/nspr/patches/patch-mozilla_nsprpub_configure deleted file mode 100644 index cfaa795ed..000000000 --- a/package/nspr/patches/patch-mozilla_nsprpub_configure +++ /dev/null @@ -1,11 +0,0 @@ ---- nspr-4.9.6.orig/mozilla/nsprpub/configure 2013-03-14 18:34:31.000000000 +0100 -+++ nspr-4.9.6/mozilla/nsprpub/configure 2013-10-21 15:29:36.000000000 +0200 -@@ -2855,7 +2855,7 @@ esac - if test "$cross_compiling" = "yes"; then - CROSS_COMPILE=1 - else -- CROSS_COMPILE= -+ CROSS_COMPILE=1 - fi - - echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6 diff --git a/package/nspr/patches/patch-mozilla_nsprpub_pr_src_misc_prnetdb_c b/package/nspr/patches/patch-mozilla_nsprpub_pr_src_misc_prnetdb_c deleted file mode 100644 index 99ecc22dc..000000000 --- a/package/nspr/patches/patch-mozilla_nsprpub_pr_src_misc_prnetdb_c +++ /dev/null @@ -1,16 +0,0 @@ -* patch from alpinelinux - ---- nspr-4.9.6.orig/mozilla/nsprpub/pr/src/misc/prnetdb.c 2012-09-28 16:33:48.000000000 +0200 -+++ nspr-4.9.6/mozilla/nsprpub/pr/src/misc/prnetdb.c 2013-10-21 18:07:57.000000000 +0200 -@@ -61,10 +61,7 @@ PRLock *_pr_dnsLock = NULL; - #define _PR_HAVE_GETPROTO_R_POINTER - #endif - --#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ -- || (defined(LINUX) && defined(_REENTRANT) \ -- && !(defined(__GLIBC__) && __GLIBC__ >= 2) \ -- && !defined(ANDROID)) -+#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) - #define _PR_HAVE_GETPROTO_R - #define _PR_HAVE_GETPROTO_R_POINTER - #endif diff --git a/target/x86/sys-available/ibm-x40 b/target/x86/sys-available/ibm-x40 index 1327fb922..7dc75ebf4 100644 --- a/target/x86/sys-available/ibm-x40 +++ b/target/x86/sys-available/ibm-x40 @@ -1,6 +1,5 @@ config ADK_TARGET_SYSTEM_IBM_X40 bool "IBM X40 laptop" - depends on ADK_BROKEN select ADK_x86 select ADK_ibm_x40 select ADK_CPU_PENTIUM_M @@ -22,6 +21,7 @@ config ADK_TARGET_SYSTEM_IBM_X40 select ADK_TARGET_WITH_ACPI # with docking station select ADK_TARGET_WITH_PP + select ADK_TARGET_KERNEL_BZIMAGE help System profile for IBM X40 laptop. diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile index f647939b5..25bd9e56c 100644 --- a/toolchain/musl/Makefile +++ b/toolchain/musl/Makefile @@ -27,6 +27,13 @@ $(WRKBUILD)/.headers: touch $@ $(WRKBUILD)/.compiled: + # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled + $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean + (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \ + ./configure --prefix=/usr \ + --target=$(REAL_GNU_TARGET_NAME) \ + --disable-gcc-wrapper \ + ) $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all touch $@ -- cgit v1.2.3