Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: libtool --with-libtool-sysroot
From: Jack Mitchell @ 2016-11-11 17:31 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core
In-Reply-To: <CAJTo0LaY5K8gY97hXbLgGkaRNbKGv-DwvLU0H1jt8oSkXg+rug@mail.gmail.com>

On 11/11/16 15:34, Burton, Ross wrote:
>
> On 11 November 2016 at 14:34, Jack Mitchell <ml@embed.me.uk
> <mailto:ml@embed.me.uk>> wrote:
>
>     However, looking at the libtool recipe in OE it has a patch which
>     changes the libtool flag from --with-sysroot to
>     --with-libtool-sysroot. The question is, how is this version not
>     making it into my SDK, I have sourced the environment script and a
>     which libtoolize points to the right path.
>
>
> Is the package you are trying to build using its own libtool (or the
> host libtool), and not our prefixed libtool?
>
> Ross

This may be happening but it's just a generic autotools project. No 
references to libtool in the project apart from the ones automatically 
generated.

autoreconf -i
./configure ${CONFIGURE_FLAGS}
make

How would one check which libtool was being used, or influence which one 
autotools chooses?

Cheers,


^ permalink raw reply

* Re: [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Maciej Borzęcki @ 2016-11-11 17:16 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <20161110003935.1858-1-raj.khem@gmail.com>

On Thu, Nov 10, 2016 at 1:39 AM, Khem Raj <raj.khem@gmail.com> wrote:
> This is converging the recipes for go from
> meta-virtualization and oe-meta-go
>
> Add recipes for go 1.7
>
> go.bbclass is added to ease out writing
> recipes for go packages
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/go.bbclass                            |  74 +++++++
>  meta/classes/goarch.bbclass                        |  40 ++++
>  meta/recipes-devtools/go/go-1.4.inc                |  15 ++
>  .../go/go-1.4/016-armhf-elf-header.patch           |  24 +++
>  ...ckport-cmd-link-support-new-386-amd64-rel.patch | 225 +++++++++++++++++++++
>  meta/recipes-devtools/go/go-1.4/syslog.patch       |  62 ++++++
>  meta/recipes-devtools/go/go-1.6.inc                |  19 ++
>  .../go/go-1.6/armhf-elf-header.patch               |  23 +++
>  .../go/go-1.6/fix-cc-handling.patch                |  50 +++++
>  .../go/go-1.6/fix-target-cc-for-build.patch        |  17 ++
>  meta/recipes-devtools/go/go-1.6/gotooldir.patch    |  30 +++
>  .../go/go-1.6/split-host-and-target-build.patch    |  63 ++++++
>  meta/recipes-devtools/go/go-1.6/syslog.patch       |  62 ++++++
>  meta/recipes-devtools/go/go-1.7.inc                |  18 ++
>  .../go/go-1.7/armhf-elf-header.patch               |  23 +++
>  .../go/go-1.7/fix-cc-handling.patch                |  50 +++++
>  .../go/go-1.7/fix-target-cc-for-build.patch        |  17 ++
>  meta/recipes-devtools/go/go-1.7/gotooldir.patch    |  30 +++
>  .../go/go-1.7/split-host-and-target-build.patch    |  62 ++++++
>  meta/recipes-devtools/go/go-1.7/syslog.patch       |  62 ++++++
>  meta/recipes-devtools/go/go-common.inc             |  21 ++
>  meta/recipes-devtools/go/go-native.inc             |  54 +++++
>  meta/recipes-devtools/go/go-native_1.4.bb          |   2 +
>  meta/recipes-devtools/go/go.inc                    |  74 +++++++
>  meta/recipes-devtools/go/go_1.6.bb                 |   4 +
>  meta/recipes-devtools/go/go_1.7.bb                 |   4 +
>  26 files changed, 1125 insertions(+)
>  create mode 100644 meta/classes/go.bbclass
>  create mode 100644 meta/classes/goarch.bbclass
>  create mode 100644 meta/recipes-devtools/go/go-1.4.inc
>  create mode 100644 meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.4/syslog.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6.inc
>  create mode 100644 meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6/gotooldir.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.6/syslog.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7.inc
>  create mode 100644 meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7/gotooldir.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
>  create mode 100644 meta/recipes-devtools/go/go-1.7/syslog.patch
>  create mode 100644 meta/recipes-devtools/go/go-common.inc
>  create mode 100644 meta/recipes-devtools/go/go-native.inc
>  create mode 100644 meta/recipes-devtools/go/go-native_1.4.bb
>  create mode 100644 meta/recipes-devtools/go/go.inc
>  create mode 100644 meta/recipes-devtools/go/go_1.6.bb
>  create mode 100644 meta/recipes-devtools/go/go_1.7.bb
>
> diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> new file mode 100644
> index 0000000..e10864d
> --- /dev/null
> +++ b/meta/classes/go.bbclass
> @@ -0,0 +1,74 @@
> +inherit goarch
> +
> +GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
> +GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
> +GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
> +GOBIN_FINAL = "${GOROOT_FINAL}/bin/${GOOS}_${GOARCH}"
> +
> +export GOOS = "${TARGET_GOOS}"
> +export GOARCH = "${TARGET_GOARCH}"
> +export GOARM = "${TARGET_GOARM}"
> +export CGO_ENABLED = "1"
> +export GOROOT
> +export GOROOT_FINAL = "${libdir}/${TARGET_SYS}/go"
> +export GOBIN_FINAL
> +export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${GOOS}_${GOARCH}"
> +export GOSRC_FINAL = "${GOROOT_FINAL}/src"
> +export GO_GCFLAGS = "${TARGET_CFLAGS}"
> +export GO_LDFLAGS = "${TARGET_LDFLAGS}"
> +export CGO_CFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CFLAGS}"
> +export CGO_CPPFLAGS = "${TARGET_CPPFLAGS}"
> +export CGO_CXXFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CXXFLAGS}"
> +export CGO_LDFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_LDFLAGS}"
> +
> +DEPENDS += "go-cross"
> +DEPENDS_class-native += "go-native"
> +
> +INHIBIT_PACKAGE_STRIP = "1"
> +
> +FILES_${PN}-staticdev += "${GOSRC_FINAL}/${GO_IMPORT}"
> +FILES_${PN}-staticdev += "${GOPKG_FINAL}/${GO_IMPORT}*"
> +
> +GO_INSTALL ?= "${GO_IMPORT}/..."
> +
> +do_go_compile() {
> +       GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
> +       if test -n "${GO_INSTALL}" ; then
> +               GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL}
> +       fi
> +}
> +
> +do_go_install() {
> +       rm -rf ${WORKDIR}/staging
> +       install -d ${WORKDIR}/staging${GOROOT_FINAL} ${D}${GOROOT_FINAL}
> +       tar -C ${S} -cf - . | tar -C ${WORKDIR}/staging${GOROOT_FINAL} -xpvf -
> +
> +       find ${WORKDIR}/staging${GOROOT_FINAL} \( \
> +               -name \*.indirectionsymlink -o \
> +               -name .git\* -o                \
> +               -name .hg -o                   \
> +               -name .svn -o                  \
> +               -name .pc\* -o                 \
> +               -name patches\*                \
> +               \) -print0 | \
> +       xargs -r0 rm -rf
> +
> +       tar -C ${WORKDIR}/staging${GOROOT_FINAL} -cf - . | \
> +       tar -C ${D}${GOROOT_FINAL} -xpvf -
> +
> +       chown -R root:root "${D}${GOROOT_FINAL}"
> +
> +       if test -e "${D}${GOBIN_FINAL}" ; then
> +               install -d -m 0755 "${D}${bindir}"
> +               find "${D}${GOBIN_FINAL}" ! -type d -print0 | xargs -r0 mv --target-directory="${D}${bindir}"
> +               rmdir -p "${D}${GOBIN_FINAL}" || true
> +       fi
> +}
> +
> +do_compile() {
> +       do_go_compile
> +}
> +
> +do_install() {
> +       do_go_install
> +}
> diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
> new file mode 100644
> index 0000000..bb330b1
> --- /dev/null
> +++ b/meta/classes/goarch.bbclass
> @@ -0,0 +1,40 @@
> +BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS', True), d)}"
> +BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH', True), d)}"
> +BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"
> +HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS', True), d)}"
> +HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH', True), d)}"
> +HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
> +HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
> +TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS', True), d)}"
> +TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH', True), d)}"
> +TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
> +TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
> +GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}"
> +
> +def go_map_arch(a, d):
> +    import re
> +    if re.match('i.86', a):
> +        return '386'
> +    elif a == 'x86_64':
> +        return 'amd64'
> +    elif re.match('arm.*', a):
> +        return 'arm'
> +    elif re.match('aarch64.*', a):
> +        return 'arm64'
> +    elif re.match('p(pc|owerpc)(|64)', a):
> +        return 'powerpc'
> +    else:
> +        bb.error("cannot map '%s' to a Go architecture" % a)
> +
> +def go_map_arm(a, f, d):
> +    import re
> +    if re.match('arm.*', a) and re.match('arm.*7.*', f):
> +        return '7'
> +    return ''
> +
> +def go_map_os(o, d):
> +    if o.startswith('linux'):
> +        return 'linux'
> +    return o
> +
> +
> diff --git a/meta/recipes-devtools/go/go-1.4.inc b/meta/recipes-devtools/go/go-1.4.inc
> new file mode 100644
> index 0000000..a65459f
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.4.inc
> @@ -0,0 +1,15 @@
> +require go-common.inc
> +
> +PV = "1.4.3"
> +GO_BASEVERSION = "1.4"
> +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
> +
> +SRC_URI += "\
> +        file://016-armhf-elf-header.patch \
> +        file://go-cross-backport-cmd-link-support-new-386-amd64-rel.patch \
> +        file://syslog.patch \
> +"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
> +SRC_URI[md5sum] = "dfb604511115dd402a77a553a5923a04"
> +SRC_URI[sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
> diff --git a/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
> new file mode 100644
> index 0000000..e6e414e
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
> @@ -0,0 +1,24 @@
> +Description: Use correct ELF header for armhf binaries.
> +Author: Adam Conrad <adconrad@ubuntu.com>
> +Last-Update: 2013-07-08
> +
> +Upstream-Status: Pending
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> +Index: go/src/cmd/ld/elf.c
> +===================================================================
> +--- go.orig/src/cmd/ld/elf.c   2015-02-20 10:49:58.763451586 -0800
> ++++ go/src/cmd/ld/elf.c        2015-02-20 10:49:27.895478521 -0800
> +@@ -57,7 +57,11 @@
> +       case '5':
> +               // we use EABI on both linux/arm and freebsd/arm.
> +               if(HEADTYPE == Hlinux || HEADTYPE == Hfreebsd)
> +-                      hdr.flags = 0x5000002; // has entry point, Version5 EABI
> ++#ifdef __ARM_PCS_VFP
> ++                      hdr.flags = 0x5000402; // has entry point, Version5 EABI, hard-float ABI
> ++#else
> ++                      hdr.flags = 0x5000202; // has entry point, Version5 EABI, soft-float ABI
> ++#endif
> +               // fallthrough
> +       default:
> +               hdr.phoff = ELF32HDRSIZE;       /* Must be be ELF32HDRSIZE: first PHdr must follow ELF header */
> diff --git a/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch b/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
> new file mode 100644
> index 0000000..95ca9d3
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
> @@ -0,0 +1,225 @@
> +From d6eefad445831c161fca130f9bdf7b3848aac23c Mon Sep 17 00:00:00 2001
> +From: Paul Gortmaker <paul.gortmaker@windriver.com>
> +Date: Tue, 29 Mar 2016 21:14:33 -0400
> +Subject: [PATCH] go-cross: backport "cmd/link: support new 386/amd64
> + relocations"
> +
> +Newer binutils won't support building older go-1.4.3 as per:
> +
> +https://github.com/golang/go/issues/13114
> +
> +Upstream commit 914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7 (see subj)
> +was identified as the fix and nominated for 1.4.4 but that release
> +never happened.  The paths in 1.4.3 aren't the same as go1.6beta1~662
> +where this commit appeared, but the NetBSD folks indicated what a
> +1.4.3 backport would look like here: https://gnats.netbsd.org/50777
> +
> +This is based on that, but without the BSD wrapper infrastructure
> +layer that makes things look like patches of patches.
> +
> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> +
> +Upstream-Status: Backport [ Partial ]
> +
> +diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
> +index 18b5aa311981..2e9d339aef87 100644
> +--- a/src/cmd/6l/asm.c
> ++++ b/src/cmd/6l/asm.c
> +@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
> +               return;
> +
> +       case 256 + R_X86_64_GOTPCREL:
> ++      case 256 + R_X86_64_GOTPCRELX:
> ++      case 256 + R_X86_64_REX_GOTPCRELX:
> +               if(targ->type != SDYNIMPORT) {
> +                       // have symbol
> +                       if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
> +diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
> +index 98c04240374f..cff29488e8af 100644
> +--- a/src/cmd/8l/asm.c
> ++++ b/src/cmd/8l/asm.c
> +@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
> +               return;
> +
> +       case 256 + R_386_GOT32:
> ++      case 256 + R_386_GOT32X:
> +               if(targ->type != SDYNIMPORT) {
> +                       // have symbol
> +                       if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
> +diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
> +index e84d996f2596..bbf2cfaa3cc0 100644
> +--- a/src/cmd/ld/elf.h
> ++++ b/src/cmd/ld/elf.h
> +@@ -478,32 +478,47 @@ typedef struct {
> +  * Relocation types.
> +  */
> +
> +-#define       R_X86_64_NONE   0       /* No relocation. */
> +-#define       R_X86_64_64     1       /* Add 64 bit symbol value. */
> +-#define       R_X86_64_PC32   2       /* PC-relative 32 bit signed sym value. */
> +-#define       R_X86_64_GOT32  3       /* PC-relative 32 bit GOT offset. */
> +-#define       R_X86_64_PLT32  4       /* PC-relative 32 bit PLT offset. */
> +-#define       R_X86_64_COPY   5       /* Copy data from shared object. */
> +-#define       R_X86_64_GLOB_DAT 6     /* Set GOT entry to data address. */
> +-#define       R_X86_64_JMP_SLOT 7     /* Set GOT entry to code address. */
> +-#define       R_X86_64_RELATIVE 8     /* Add load address of shared object. */
> +-#define       R_X86_64_GOTPCREL 9     /* Add 32 bit signed pcrel offset to GOT. */
> +-#define       R_X86_64_32     10      /* Add 32 bit zero extended symbol value */
> +-#define       R_X86_64_32S    11      /* Add 32 bit sign extended symbol value */
> +-#define       R_X86_64_16     12      /* Add 16 bit zero extended symbol value */
> +-#define       R_X86_64_PC16   13      /* Add 16 bit signed extended pc relative symbol value */
> +-#define       R_X86_64_8      14      /* Add 8 bit zero extended symbol value */
> +-#define       R_X86_64_PC8    15      /* Add 8 bit signed extended pc relative symbol value */
> +-#define       R_X86_64_DTPMOD64 16    /* ID of module containing symbol */
> +-#define       R_X86_64_DTPOFF64 17    /* Offset in TLS block */
> +-#define       R_X86_64_TPOFF64 18     /* Offset in static TLS block */
> +-#define       R_X86_64_TLSGD  19      /* PC relative offset to GD GOT entry */
> +-#define       R_X86_64_TLSLD  20      /* PC relative offset to LD GOT entry */
> +-#define       R_X86_64_DTPOFF32 21    /* Offset in TLS block */
> +-#define       R_X86_64_GOTTPOFF 22    /* PC relative offset to IE GOT entry */
> +-#define       R_X86_64_TPOFF32 23     /* Offset in static TLS block */
> +-
> +-#define       R_X86_64_COUNT  24      /* Count of defined relocation types. */
> ++#define       R_X86_64_NONE           0
> ++#define       R_X86_64_64             1
> ++#define       R_X86_64_PC32           2
> ++#define       R_X86_64_GOT32          3
> ++#define       R_X86_64_PLT32          4
> ++#define       R_X86_64_COPY           5
> ++#define       R_X86_64_GLOB_DAT       6
> ++#define       R_X86_64_JMP_SLOT       7
> ++#define       R_X86_64_RELATIVE       8
> ++#define       R_X86_64_GOTPCREL       9
> ++#define       R_X86_64_32             10
> ++#define       R_X86_64_32S            11
> ++#define       R_X86_64_16             12
> ++#define       R_X86_64_PC16           13
> ++#define       R_X86_64_8              14
> ++#define       R_X86_64_PC8            15
> ++#define       R_X86_64_DTPMOD64       16
> ++#define       R_X86_64_DTPOFF64       17
> ++#define       R_X86_64_TPOFF64        18
> ++#define       R_X86_64_TLSGD          19
> ++#define       R_X86_64_TLSLD          20
> ++#define       R_X86_64_DTPOFF32       21
> ++#define       R_X86_64_GOTTPOFF       22
> ++#define       R_X86_64_TPOFF32        23
> ++#define       R_X86_64_PC64           24
> ++#define       R_X86_64_GOTOFF64       25
> ++#define       R_X86_64_GOTPC32        26
> ++#define       R_X86_64_GOT64          27
> ++#define       R_X86_64_GOTPCREL64     28
> ++#define       R_X86_64_GOTPC64        29
> ++#define       R_X86_64_GOTPLT64       30
> ++#define       R_X86_64_PLTOFF64       31
> ++#define       R_X86_64_SIZE32         32
> ++#define       R_X86_64_SIZE64         33
> ++#define       R_X86_64_GOTPC32_TLSDEC 34
> ++#define       R_X86_64_TLSDESC_CALL   35
> ++#define       R_X86_64_TLSDESC        36
> ++#define       R_X86_64_IRELATIVE      37
> ++#define       R_X86_64_PC32_BND       40
> ++#define       R_X86_64_GOTPCRELX      41
> ++#define       R_X86_64_REX_GOTPCRELX  42
> +
> +
> + #define       R_ALPHA_NONE            0       /* No reloc */
> +@@ -581,39 +596,42 @@ typedef struct {
> + #define       R_ARM_COUNT             38      /* Count of defined relocation types. */
> +
> +
> +-#define       R_386_NONE      0       /* No relocation. */
> +-#define       R_386_32        1       /* Add symbol value. */
> +-#define       R_386_PC32      2       /* Add PC-relative symbol value. */
> +-#define       R_386_GOT32     3       /* Add PC-relative GOT offset. */
> +-#define       R_386_PLT32     4       /* Add PC-relative PLT offset. */
> +-#define       R_386_COPY      5       /* Copy data from shared object. */
> +-#define       R_386_GLOB_DAT  6       /* Set GOT entry to data address. */
> +-#define       R_386_JMP_SLOT  7       /* Set GOT entry to code address. */
> +-#define       R_386_RELATIVE  8       /* Add load address of shared object. */
> +-#define       R_386_GOTOFF    9       /* Add GOT-relative symbol address. */
> +-#define       R_386_GOTPC     10      /* Add PC-relative GOT table address. */
> +-#define       R_386_TLS_TPOFF 14      /* Negative offset in static TLS block */
> +-#define       R_386_TLS_IE    15      /* Absolute address of GOT for -ve static TLS */
> +-#define       R_386_TLS_GOTIE 16      /* GOT entry for negative static TLS block */
> +-#define       R_386_TLS_LE    17      /* Negative offset relative to static TLS */
> +-#define       R_386_TLS_GD    18      /* 32 bit offset to GOT (index,off) pair */
> +-#define       R_386_TLS_LDM   19      /* 32 bit offset to GOT (index,zero) pair */
> +-#define       R_386_TLS_GD_32 24      /* 32 bit offset to GOT (index,off) pair */
> +-#define       R_386_TLS_GD_PUSH 25    /* pushl instruction for Sun ABI GD sequence */
> +-#define       R_386_TLS_GD_CALL 26    /* call instruction for Sun ABI GD sequence */
> +-#define       R_386_TLS_GD_POP 27     /* popl instruction for Sun ABI GD sequence */
> +-#define       R_386_TLS_LDM_32 28     /* 32 bit offset to GOT (index,zero) pair */
> +-#define       R_386_TLS_LDM_PUSH 29   /* pushl instruction for Sun ABI LD sequence */
> +-#define       R_386_TLS_LDM_CALL 30   /* call instruction for Sun ABI LD sequence */
> +-#define       R_386_TLS_LDM_POP 31    /* popl instruction for Sun ABI LD sequence */
> +-#define       R_386_TLS_LDO_32 32     /* 32 bit offset from start of TLS block */
> +-#define       R_386_TLS_IE_32 33      /* 32 bit offset to GOT static TLS offset entry */
> +-#define       R_386_TLS_LE_32 34      /* 32 bit offset within static TLS block */
> +-#define       R_386_TLS_DTPMOD32 35   /* GOT entry containing TLS index */
> +-#define       R_386_TLS_DTPOFF32 36   /* GOT entry containing TLS offset */
> +-#define       R_386_TLS_TPOFF32 37    /* GOT entry of -ve static TLS offset */
> +-
> +-#define       R_386_COUNT     38      /* Count of defined relocation types. */
> ++#define       R_386_NONE          0
> ++#define       R_386_32            1
> ++#define       R_386_PC32          2
> ++#define       R_386_GOT32         3
> ++#define       R_386_PLT32         4
> ++#define       R_386_COPY          5
> ++#define       R_386_GLOB_DAT      6
> ++#define       R_386_JMP_SLOT      7
> ++#define       R_386_RELATIVE      8
> ++#define       R_386_GOTOFF        9
> ++#define       R_386_GOTPC         10
> ++#define       R_386_TLS_TPOFF     14
> ++#define       R_386_TLS_IE        15
> ++#define       R_386_TLS_GOTIE     16
> ++#define       R_386_TLS_LE        17
> ++#define       R_386_TLS_GD        18
> ++#define       R_386_TLS_LDM       19
> ++#define       R_386_TLS_GD_32     24
> ++#define       R_386_TLS_GD_PUSH   25
> ++#define       R_386_TLS_GD_CALL   26
> ++#define       R_386_TLS_GD_POP    27
> ++#define       R_386_TLS_LDM_32    28
> ++#define       R_386_TLS_LDM_PUSH  29
> ++#define       R_386_TLS_LDM_CALL  30
> ++#define       R_386_TLS_LDM_POP   31
> ++#define       R_386_TLS_LDO_32    32
> ++#define       R_386_TLS_IE_32     33
> ++#define       R_386_TLS_LE_32     34
> ++#define       R_386_TLS_DTPMOD32  35
> ++#define       R_386_TLS_DTPOFF32  36
> ++#define       R_386_TLS_TPOFF32   37
> ++#define       R_386_TLS_GOTDESC   39
> ++#define       R_386_TLS_DESC_CALL 40
> ++#define       R_386_TLS_DESC      41
> ++#define       R_386_IRELATIVE     42
> ++#define       R_386_GOT32X        43
> +
> + #define       R_PPC_NONE              0       /* No relocation. */
> + #define       R_PPC_ADDR32            1
> +diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
> +index dd5fa0d2a839..2e2fbd17377f 100644
> +--- a/src/cmd/ld/ldelf.c
> ++++ b/src/cmd/ld/ldelf.c
> +@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
> +       case R('6', R_X86_64_PC32):
> +       case R('6', R_X86_64_PLT32):
> +       case R('6', R_X86_64_GOTPCREL):
> ++      case R('6', R_X86_64_GOTPCRELX):
> ++      case R('6', R_X86_64_REX_GOTPCRELX):
> +       case R('8', R_386_32):
> +       case R('8', R_386_PC32):
> +       case R('8', R_386_GOT32):
> +       case R('8', R_386_PLT32):
> +       case R('8', R_386_GOTOFF):
> +       case R('8', R_386_GOTPC):
> ++      case R('8', R_386_GOT32X):
> +               *siz = 4;
> +               break;
> +       case R('6', R_X86_64_64):
> +--
> +2.7.2
> +
> diff --git a/meta/recipes-devtools/go/go-1.4/syslog.patch b/meta/recipes-devtools/go/go-1.4/syslog.patch
> new file mode 100644
> index 0000000..29be06f
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.4/syslog.patch
> @@ -0,0 +1,62 @@
> +Add timeouts to logger
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +
> +diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
> +--- go/src/log/syslog/syslog.go        2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go    2014-10-03 11:44:37.710403200 -0700
> +@@ -33,6 +33,9 @@
> + const severityMask = 0x07
> + const facilityMask = 0xf8
> +
> ++var writeTimeout = 1 * time.Second
> ++var connectTimeout = 1 * time.Second
> ++
> + const (
> +       // Severity.
> +
> +@@ -100,6 +103,7 @@
> + type serverConn interface {
> +       writeString(p Priority, hostname, tag, s, nl string) error
> +       close() error
> ++      setWriteDeadline(t time.Time) error
> + }
> +
> + type netConn struct {
> +@@ -273,7 +277,11 @@
> +               nl = "\n"
> +       }
> +
> +-      err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> ++      err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
> ++      if err != nil {
> ++              return 0, err
> ++      }
> ++      err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> +       if err != nil {
> +               return 0, err
> +       }
> +@@ -305,6 +313,10 @@
> +       return n.conn.Close()
> + }
> +
> ++func (n *netConn) setWriteDeadline(t time.Time) error {
> ++      return n.conn.SetWriteDeadline(t)
> ++}
> ++
> + // NewLogger creates a log.Logger whose output is written to
> + // the system log service with the specified priority. The logFlag
> + // argument is the flag set passed through to log.New to create
> +diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
> +--- go/src/log/syslog/syslog_unix.go   2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go       2014-10-03 11:44:39.010403175 -0700
> +@@ -19,7 +19,7 @@
> +       logPaths := []string{"/dev/log", "/var/run/syslog"}
> +       for _, network := range logTypes {
> +               for _, path := range logPaths {
> +-                      conn, err := net.Dial(network, path)
> ++                      conn, err := net.DialTimeout(network, path, connectTimeout)
> +                       if err != nil {
> +                               continue
> +                       } else {
> diff --git a/meta/recipes-devtools/go/go-1.6.inc b/meta/recipes-devtools/go/go-1.6.inc
> new file mode 100644
> index 0000000..769c1d8
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6.inc
> @@ -0,0 +1,19 @@
> +require go-common.inc
> +
> +PV = "1.6.3"
> +GO_BASEVERSION = "1.6"
> +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
> +
> +SRC_URI += "\
> +       file://armhf-elf-header.patch \
> +       file://syslog.patch \
> +       file://fix-target-cc-for-build.patch \
> +       file://fix-cc-handling.patch \
> +       file://split-host-and-target-build.patch \
> +       file://gotooldir.patch \
> +"
> +SRC_URI[md5sum] = "bf3fce6ccaadd310159c9e874220e2a2"
> +SRC_URI[sha256sum] = "6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00"
> +
> diff --git a/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
> new file mode 100644
> index 0000000..1e3a16b
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
> @@ -0,0 +1,23 @@
> +Encode arm EABI ( hard/soft ) calling convention in ELF header
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/cmd/link/internal/ld/elf.go
> +===================================================================
> +--- go.orig/src/cmd/link/internal/ld/elf.go
> ++++ go/src/cmd/link/internal/ld/elf.go
> +@@ -827,7 +827,13 @@
> +       // 32-bit architectures
> +       case '5':
> +               // we use EABI on both linux/arm and freebsd/arm.
> +-              if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
> ++              if HEADTYPE == obj.Hlinux {
> ++                      if Ctxt.Goarm == 7 {
> ++                              ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
> ++                      } else {
> ++                              ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
> ++                      }
> ++              } else if HEADTYPE == obj.Hfreebsd {
> +                       // We set a value here that makes no indication of which
> +                       // float ABI the object uses, because this is information
> +                       // used by the dynamic linker to compare executables and
> diff --git a/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
> new file mode 100644
> index 0000000..983323a
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
> @@ -0,0 +1,50 @@
> +Accept CC with multiple words in its name
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/cmd/go/build.go
> +===================================================================
> +--- go.orig/src/cmd/go/build.go        2015-07-29 14:48:40.323185807 -0700
> ++++ go/src/cmd/go/build.go     2015-07-30 07:37:40.529818586 -0700
> +@@ -2805,12 +2805,24 @@
> +       return b.ccompilerCmd("CC", defaultCC, objdir)
> + }
> +
> ++// gccCmd returns a gcc command line prefix
> ++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
> ++func (b *builder) gccCmdForReal() []string {
> ++      return envList("CC", defaultCC)
> ++}
> ++
> + // gxxCmd returns a g++ command line prefix
> + // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
> + func (b *builder) gxxCmd(objdir string) []string {
> +       return b.ccompilerCmd("CXX", defaultCXX, objdir)
> + }
> +
> ++// gxxCmd returns a g++ command line prefix
> ++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
> ++func (b *builder) gxxCmdForReal() []string {
> ++      return envList("CXX", defaultCXX)
> ++}
> ++
> + // ccompilerCmd returns a command line prefix for the given environment
> + // variable and using the default command when the variable is empty.
> + func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
> +Index: go/src/cmd/go/env.go
> +===================================================================
> +--- go.orig/src/cmd/go/env.go  2015-07-29 14:48:40.323185807 -0700
> ++++ go/src/cmd/go/env.go       2015-07-30 07:40:54.461655721 -0700
> +@@ -52,10 +52,9 @@
> +
> +       if goos != "plan9" {
> +               cmd := b.gccCmd(".")
> +-              env = append(env, envVar{"CC", cmd[0]})
> ++              env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
> +               env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
> +-              cmd = b.gxxCmd(".")
> +-              env = append(env, envVar{"CXX", cmd[0]})
> ++              env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
> +       }
> +
> +       if buildContext.CgoEnabled {
> diff --git a/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch b/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
> new file mode 100644
> index 0000000..2f6156e
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
> @@ -0,0 +1,17 @@
> +Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/make.bash
> +===================================================================
> +--- go.orig/src/make.bash      2015-07-29 13:28:11.334031696 -0700
> ++++ go/src/make.bash   2015-07-29 13:36:55.814465630 -0700
> +@@ -158,7 +158,7 @@
> + fi
> +
> + echo "##### Building packages and commands for $GOOS/$GOARCH."
> +-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> ++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> + echo
> +
> + rm -f "$GOTOOLDIR"/go_bootstrap
> diff --git a/meta/recipes-devtools/go/go-1.6/gotooldir.patch b/meta/recipes-devtools/go/go-1.6/gotooldir.patch
> new file mode 100644
> index 0000000..9467025
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/gotooldir.patch
> @@ -0,0 +1,30 @@
> +Define tooldir in relation to GOTOOLDIR env var
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/go/build/build.go
> +===================================================================
> +--- go.orig/src/go/build/build.go
> ++++ go/src/go/build/build.go
> +@@ -1388,7 +1388,7 @@ func init() {
> + }
> +
> + // ToolDir is the directory containing build tools.
> +-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
> ++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
> +
> + // IsLocalImport reports whether the import path is
> + // a local import path, like ".", "..", "./foo", or "../foo".
> +Index: go/src/cmd/go/build.go
> +===================================================================
> +--- go.orig/src/cmd/go/build.go
> ++++ go/src/cmd/go/build.go
> +@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
> +               }
> +
> +               cgoExe := tool("cgo")
> +-              if a.cgo != nil && a.cgo.target != "" {
> ++              if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
> +                       cgoExe = a.cgo.target
> +               }
> +               outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
> diff --git a/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
> new file mode 100644
> index 0000000..afbae02
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
> @@ -0,0 +1,63 @@
> +Add new option --target-only to build target components
> +Separates the host and target pieces of build
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/make.bash
> +===================================================================
> +--- go.orig/src/make.bash
> ++++ go/src/make.bash
> +@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
> +       buildall=""
> +       shift
> + fi
> +-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
> +-# Delay move of dist tool to now, because bootstrap may clear tool directory.
> +-mv cmd/dist/dist "$GOTOOLDIR"/dist
> +-echo
> +
> +-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
> ++do_host_build="yes"
> ++do_target_build="yes"
> ++if [ "$1" = "--target-only" ]; then
> ++      do_host_build="no"
> ++      shift
> ++elif [ "$1" = "--host-only" ]; then
> ++      do_target_build="no"
> ++      shift
> ++fi
> ++
> ++if [ "$do_host_build" = "yes" ]; then
> ++      ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
> ++      # Delay move of dist tool to now, because bootstrap may clear tool directory.
> ++      mv cmd/dist/dist "$GOTOOLDIR"/dist
> ++      echo
> ++
> +       echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
> +       # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
> +       # use the host compiler, CC, from `cmd/dist/dist env` instead.
> +@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
> +       echo
> + fi
> +
> +-echo "##### Building packages and commands for $GOOS/$GOARCH."
> +-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> +-echo
> ++if [ "$do_target_build" = "yes" ]; then
> ++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
> ++    echo "##### Building packages and commands for $GOOS/$GOARCH."
> ++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
> ++      rm -rf ./host-tools
> ++      mkdir ./host-tools
> ++      mv "$GOTOOLDIR"/* ./host-tools
> ++      GOTOOLDIR="$PWD/host-tools"
> ++    fi
> ++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
> ++    echo
> +
> +-rm -f "$GOTOOLDIR"/go_bootstrap
> ++    rm -f "$GOTOOLDIR"/go_bootstrap
> ++fi
> +
> + if [ "$1" != "--no-banner" ]; then
> +       "$GOTOOLDIR"/dist banner
> diff --git a/meta/recipes-devtools/go/go-1.6/syslog.patch b/meta/recipes-devtools/go/go-1.6/syslog.patch
> new file mode 100644
> index 0000000..29be06f
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.6/syslog.patch
> @@ -0,0 +1,62 @@
> +Add timeouts to logger
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +
> +diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
> +--- go/src/log/syslog/syslog.go        2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go    2014-10-03 11:44:37.710403200 -0700
> +@@ -33,6 +33,9 @@
> + const severityMask = 0x07
> + const facilityMask = 0xf8
> +
> ++var writeTimeout = 1 * time.Second
> ++var connectTimeout = 1 * time.Second
> ++
> + const (
> +       // Severity.
> +
> +@@ -100,6 +103,7 @@
> + type serverConn interface {
> +       writeString(p Priority, hostname, tag, s, nl string) error
> +       close() error
> ++      setWriteDeadline(t time.Time) error
> + }
> +
> + type netConn struct {
> +@@ -273,7 +277,11 @@
> +               nl = "\n"
> +       }
> +
> +-      err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> ++      err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
> ++      if err != nil {
> ++              return 0, err
> ++      }
> ++      err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> +       if err != nil {
> +               return 0, err
> +       }
> +@@ -305,6 +313,10 @@
> +       return n.conn.Close()
> + }
> +
> ++func (n *netConn) setWriteDeadline(t time.Time) error {
> ++      return n.conn.SetWriteDeadline(t)
> ++}
> ++
> + // NewLogger creates a log.Logger whose output is written to
> + // the system log service with the specified priority. The logFlag
> + // argument is the flag set passed through to log.New to create
> +diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
> +--- go/src/log/syslog/syslog_unix.go   2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go       2014-10-03 11:44:39.010403175 -0700
> +@@ -19,7 +19,7 @@
> +       logPaths := []string{"/dev/log", "/var/run/syslog"}
> +       for _, network := range logTypes {
> +               for _, path := range logPaths {
> +-                      conn, err := net.Dial(network, path)
> ++                      conn, err := net.DialTimeout(network, path, connectTimeout)
> +                       if err != nil {
> +                               continue
> +                       } else {
> diff --git a/meta/recipes-devtools/go/go-1.7.inc b/meta/recipes-devtools/go/go-1.7.inc
> new file mode 100644
> index 0000000..1f73715
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7.inc
> @@ -0,0 +1,18 @@
> +require go-common.inc
> +
> +PV = "1.7.3"
> +GO_BASEVERSION = "1.7"
> +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
> +
> +SRC_URI += "\
> +       file://armhf-elf-header.patch \
> +       file://syslog.patch \
> +       file://fix-target-cc-for-build.patch \
> +       file://fix-cc-handling.patch \
> +       file://split-host-and-target-build.patch \
> +       file://gotooldir.patch \
> +"
> +SRC_URI[md5sum] = "83d1b7bd4281479ab7d153e5152c9fc9"
> +SRC_URI[sha256sum] = "79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44"
> diff --git a/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
> new file mode 100644
> index 0000000..1e3a16b
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
> @@ -0,0 +1,23 @@
> +Encode arm EABI ( hard/soft ) calling convention in ELF header
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/cmd/link/internal/ld/elf.go
> +===================================================================
> +--- go.orig/src/cmd/link/internal/ld/elf.go
> ++++ go/src/cmd/link/internal/ld/elf.go
> +@@ -827,7 +827,13 @@
> +       // 32-bit architectures
> +       case '5':
> +               // we use EABI on both linux/arm and freebsd/arm.
> +-              if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
> ++              if HEADTYPE == obj.Hlinux {
> ++                      if Ctxt.Goarm == 7 {
> ++                              ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
> ++                      } else {
> ++                              ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
> ++                      }
> ++              } else if HEADTYPE == obj.Hfreebsd {
> +                       // We set a value here that makes no indication of which
> +                       // float ABI the object uses, because this is information
> +                       // used by the dynamic linker to compare executables and
> diff --git a/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
> new file mode 100644
> index 0000000..a67caf4
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
> @@ -0,0 +1,50 @@
> +Accept CC with multiple words in its name
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/cmd/go/build.go
> +===================================================================
> +--- go.orig/src/cmd/go/build.go
> ++++ go/src/cmd/go/build.go
> +@@ -2991,12 +2991,24 @@ func (b *builder) gccCmd(objdir string)
> +       return b.ccompilerCmd("CC", defaultCC, objdir)
> + }
> +
> ++// gccCmd returns a gcc command line prefix
> ++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
> ++func (b *builder) gccCmdForReal() []string {
> ++      return envList("CC", defaultCC)
> ++}
> ++
> + // gxxCmd returns a g++ command line prefix
> + // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
> + func (b *builder) gxxCmd(objdir string) []string {
> +       return b.ccompilerCmd("CXX", defaultCXX, objdir)
> + }
> +
> ++// gxxCmd returns a g++ command line prefix
> ++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
> ++func (b *builder) gxxCmdForReal() []string {
> ++      return envList("CXX", defaultCXX)
> ++}
> ++
> + // gfortranCmd returns a gfortran command line prefix.
> + func (b *builder) gfortranCmd(objdir string) []string {
> +       return b.ccompilerCmd("FC", "gfortran", objdir)
> +Index: go/src/cmd/go/env.go
> +===================================================================
> +--- go.orig/src/cmd/go/env.go
> ++++ go/src/cmd/go/env.go
> +@@ -51,10 +51,9 @@ func mkEnv() []envVar {
> +
> +       if goos != "plan9" {
> +               cmd := b.gccCmd(".")
> +-              env = append(env, envVar{"CC", cmd[0]})
> ++              env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
> +               env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
> +-              cmd = b.gxxCmd(".")
> +-              env = append(env, envVar{"CXX", cmd[0]})
> ++              env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
> +       }
> +
> +       if buildContext.CgoEnabled {
> diff --git a/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch b/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
> new file mode 100644
> index 0000000..2f6156e
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
> @@ -0,0 +1,17 @@
> +Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/make.bash
> +===================================================================
> +--- go.orig/src/make.bash      2015-07-29 13:28:11.334031696 -0700
> ++++ go/src/make.bash   2015-07-29 13:36:55.814465630 -0700
> +@@ -158,7 +158,7 @@
> + fi
> +
> + echo "##### Building packages and commands for $GOOS/$GOARCH."
> +-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> ++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> + echo
> +
> + rm -f "$GOTOOLDIR"/go_bootstrap
> diff --git a/meta/recipes-devtools/go/go-1.7/gotooldir.patch b/meta/recipes-devtools/go/go-1.7/gotooldir.patch
> new file mode 100644
> index 0000000..9467025
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/gotooldir.patch
> @@ -0,0 +1,30 @@
> +Define tooldir in relation to GOTOOLDIR env var
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/go/build/build.go
> +===================================================================
> +--- go.orig/src/go/build/build.go
> ++++ go/src/go/build/build.go
> +@@ -1388,7 +1388,7 @@ func init() {
> + }
> +
> + // ToolDir is the directory containing build tools.
> +-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
> ++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
> +
> + // IsLocalImport reports whether the import path is
> + // a local import path, like ".", "..", "./foo", or "../foo".
> +Index: go/src/cmd/go/build.go
> +===================================================================
> +--- go.orig/src/cmd/go/build.go
> ++++ go/src/cmd/go/build.go
> +@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
> +               }
> +
> +               cgoExe := tool("cgo")
> +-              if a.cgo != nil && a.cgo.target != "" {
> ++              if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
> +                       cgoExe = a.cgo.target
> +               }
> +               outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
> diff --git a/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
> new file mode 100644
> index 0000000..b0dd95b
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
> @@ -0,0 +1,62 @@
> +Add new option --target-only to build target components
> +Separates the host and target pieces of build
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +Index: go/src/make.bash
> +===================================================================
> +--- go.orig/src/make.bash
> ++++ go/src/make.bash
> +@@ -154,13 +154,22 @@ if [ "$1" = "--no-clean" ]; then
> +       buildall=""
> +       shift
> + fi
> +-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
> ++do_host_build="yes"
> ++do_target_build="yes"
> ++if [ "$1" = "--target-only" ]; then
> ++      do_host_build="no"
> ++      shift
> ++elif [ "$1" = "--host-only" ]; then
> ++      do_target_build="no"
> ++      shift
> ++fi
> +
> +-# Delay move of dist tool to now, because bootstrap may clear tool directory.
> +-mv cmd/dist/dist "$GOTOOLDIR"/dist
> +-echo
> ++if [ "$do_host_build" = "yes" ]; then
> ++      ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
> ++      # Delay move of dist tool to now, because bootstrap may clear tool directory.
> ++      mv cmd/dist/dist "$GOTOOLDIR"/dist
> ++      echo
> +
> +-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
> +       echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
> +       # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
> +       # use the host compiler, CC, from `cmd/dist/dist env` instead.
> +@@ -169,11 +178,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
> +       echo
> + fi
> +
> +-echo "##### Building packages and commands for $GOOS/$GOARCH."
> +-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
> +-echo
> ++if [ "$do_target_build" = "yes" ]; then
> ++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
> ++    echo "##### Building packages and commands for $GOOS/$GOARCH."
> ++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
> ++      rm -rf ./host-tools
> ++      mkdir ./host-tools
> ++      mv "$GOTOOLDIR"/* ./host-tools
> ++      GOTOOLDIR="$PWD/host-tools"
> ++    fi
> ++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
> ++    echo
> +
> +-rm -f "$GOTOOLDIR"/go_bootstrap
> ++    rm -f "$GOTOOLDIR"/go_bootstrap
> ++fi
> +
> + if [ "$1" != "--no-banner" ]; then
> +       "$GOTOOLDIR"/dist banner
> diff --git a/meta/recipes-devtools/go/go-1.7/syslog.patch b/meta/recipes-devtools/go/go-1.7/syslog.patch
> new file mode 100644
> index 0000000..29be06f
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-1.7/syslog.patch
> @@ -0,0 +1,62 @@
> +Add timeouts to logger
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +
> +diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
> +--- go/src/log/syslog/syslog.go        2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go    2014-10-03 11:44:37.710403200 -0700
> +@@ -33,6 +33,9 @@
> + const severityMask = 0x07
> + const facilityMask = 0xf8
> +
> ++var writeTimeout = 1 * time.Second
> ++var connectTimeout = 1 * time.Second
> ++
> + const (
> +       // Severity.
> +
> +@@ -100,6 +103,7 @@
> + type serverConn interface {
> +       writeString(p Priority, hostname, tag, s, nl string) error
> +       close() error
> ++      setWriteDeadline(t time.Time) error
> + }
> +
> + type netConn struct {
> +@@ -273,7 +277,11 @@
> +               nl = "\n"
> +       }
> +
> +-      err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> ++      err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
> ++      if err != nil {
> ++              return 0, err
> ++      }
> ++      err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
> +       if err != nil {
> +               return 0, err
> +       }
> +@@ -305,6 +313,10 @@
> +       return n.conn.Close()
> + }
> +
> ++func (n *netConn) setWriteDeadline(t time.Time) error {
> ++      return n.conn.SetWriteDeadline(t)
> ++}
> ++
> + // NewLogger creates a log.Logger whose output is written to
> + // the system log service with the specified priority. The logFlag
> + // argument is the flag set passed through to log.New to create
> +diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
> +--- go/src/log/syslog/syslog_unix.go   2013-11-28 13:38:28.000000000 -0800
> ++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go       2014-10-03 11:44:39.010403175 -0700
> +@@ -19,7 +19,7 @@
> +       logPaths := []string{"/dev/log", "/var/run/syslog"}
> +       for _, network := range logTypes {
> +               for _, path := range logPaths {
> +-                      conn, err := net.Dial(network, path)
> ++                      conn, err := net.DialTimeout(network, path, connectTimeout)
> +                       if err != nil {
> +                               continue
> +                       } else {
> diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
> new file mode 100644
> index 0000000..8897cb1
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-common.inc
> @@ -0,0 +1,21 @@
> +SUMMARY = "Go programming language compiler"
> +DESCRIPTION = " The Go programming language is an open source project to make \
> + programmers more productive. Go is expressive, concise, clean, and\
> + efficient. Its concurrency mechanisms make it easy to write programs\
> + that get the most out of multicore and networked machines, while its\
> + novel type system enables flexible and modular program construction.\
> + Go compiles quickly to machine code yet has the convenience of\
> + garbage collection and the power of run-time reflection. It's a\
> + fast, statically typed, compiled language that feels like a\
> + dynamically typed, interpreted language."
> +
> +HOMEPAGE = " http://golang.org/"
> +LICENSE = "BSD-3-Clause"
> +
> +inherit goarch
> +
> +SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
> +S = "${WORKDIR}/go"
> +B = "${S}"
> +
> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
> new file mode 100644
> index 0000000..cb2dd2a
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-native.inc
> @@ -0,0 +1,54 @@
> +inherit native
> +
> +export GOOS = "${BUILD_GOOS}"
> +export GOARCH = "${BUILD_GOARCH}"
> +export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go"
> +export CGO_ENABLED = "1"
> +
> +do_configure[noexec] = "1"
> +
> +do_compile() {
> +    export GOBIN="${B}/bin"
> +    rm -rf ${GOBIN}
> +    mkdir ${GOBIN}
> +
> +    export TMPDIR=${WORKDIR}/build-tmp
> +    mkdir -p ${WORKDIR}/build-tmp
> +
> +    cd src
> +    CGO_ENABLED=0 ./make.bash --host-only
> +}
> +
> +
> +make_wrapper() {
> +    rm -f ${D}${bindir}/$2
> +    cat <<END >${D}${bindir}/$2
> +#!/bin/bash
> +here=\`dirname \$0\`
> +export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
> +\$here/../lib/go/bin/$1 "\$@"
> +END
> +    chmod +x ${D}${bindir}/$2
> +}
> +
> +do_install() {
> +    install -d ${D}${libdir}/go
> +    cp -a ${B}/pkg ${D}${libdir}/go/
> +    install -d ${D}${libdir}/go/src
> +    (cd ${S}/src; for d in *; do \
> +        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
> +    done)
> +    install -d ${D}${bindir} ${D}${libdir}/go/bin
> +    for f in ${B}/bin/*
> +    do
> +        base=`basename $f`
> +        install -m755 $f ${D}${libdir}/go/bin
> +        make_wrapper $base $base
> +    done
> +}
> +
> +do_package[noexec] = "1"
> +do_packagedata[noexec] = "1"
> +do_package_write_ipk[noexec] = "1"
> +do_package_write_deb[noexec] = "1"
> +do_package_write_rpm[noexec] = "1"
> diff --git a/meta/recipes-devtools/go/go-native_1.4.bb b/meta/recipes-devtools/go/go-native_1.4.bb
> new file mode 100644
> index 0000000..bbf3c0d
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go-native_1.4.bb
> @@ -0,0 +1,2 @@
> +require ${PN}.inc
> +require go-${PV}.inc
> diff --git a/meta/recipes-devtools/go/go.inc b/meta/recipes-devtools/go/go.inc
> new file mode 100644
> index 0000000..732ffa4
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go.inc
> @@ -0,0 +1,74 @@
> +inherit goarch
> +# libgcc is required for the target specific libraries to build properly
> +DEPENDS += " go-native libgcc"
> +# Prevent runstrip from running because you get errors when the host arch != target arch
> +INHIBIT_PACKAGE_STRIP = "1"
> +INHIBIT_SYSROOT_STRIP = "1"
> +
> +export GOHOSTOS = "${BUILD_GOOS}"
> +export GOHOSTARCH = "${BUILD_GOARCH}"
> +export GOOS = "${TARGET_GOOS}"
> +export GOARCH = "${TARGET_GOARCH}"
> +export GOARM = "${TARGET_GOARM}"
> +export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
> +export GOROOT_FINAL = "${libdir}/go"
> +export CGO_ENABLED = "1"
> +export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
> +export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
> +
> +do_configure[noexec] = "1"
> +
> +do_compile() {
> +    export GOBIN="${B}/bin"
> +    export CC="${@d.getVar('BUILD_CC', True).strip()}"
> +    rm -rf ${GOBIN} ${B}/pkg
> +    mkdir ${GOBIN}
> +
> +    export TMPDIR=${WORKDIR}/build-tmp
> +    mkdir -p ${WORKDIR}/build-tmp
> +
> +    cd src
> +    ./make.bash --host-only
> +    # Ensure cgo.a is built with the target toolchain
> +    export GOBIN="${B}/target/bin"
> +    rm -rf ${GOBIN}
> +    mkdir -p ${GOBIN}
> +    GO_FLAGS="-a" ./make.bash
> +}
> +
> +do_install_class-target() {
> +    install -d ${D}${libdir}/go
> +    cp -a ${B}/pkg ${D}${libdir}/go/
> +    install -d ${D}${libdir}/go/src
> +    (cd ${S}/src; for d in *; do \
> +        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
> +    done)
> +    install -d ${D}${bindir}
> +    for f in ${B}/bin/${GOOS}_${GOARCH}/*
> +    do
> +        install -m755 $f ${D}${bindir}
> +    done
> +}
> +
> +do_install_class-cross() {
> +    install -d ${D}${libdir}/go
> +    cp -a ${B}/pkg ${D}${libdir}/go/
> +    install -d ${D}${libdir}/go/src
> +    (cd ${S}/src; for d in *; do \
> +        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
> +    done)
> +    install -d ${D}${bindir}
> +    for f in ${B}/bin/go*
> +    do
> +        install -m755 $f ${D}${bindir}
> +    done
> +}
> +
> +INSANE_SKIP_${PN} += "staticdev"
> +RDEPENDS_${PN} += "perl"
> +
> +do_package[noexec] = "1"
> +do_packagedata[noexec] = "1"
> +do_package_write_ipk[noexec] = "1"
> +do_package_write_deb[noexec] = "1"
> +do_package_write_rpm[noexec] = "1"
> diff --git a/meta/recipes-devtools/go/go_1.6.bb b/meta/recipes-devtools/go/go_1.6.bb
> new file mode 100644
> index 0000000..2f59033
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go_1.6.bb
> @@ -0,0 +1,4 @@
> +require go.inc
> +require go-${PV}.inc
> +
> +BBCLASSEXTEND = "cross"
> diff --git a/meta/recipes-devtools/go/go_1.7.bb b/meta/recipes-devtools/go/go_1.7.bb
> new file mode 100644
> index 0000000..8186427
> --- /dev/null
> +++ b/meta/recipes-devtools/go/go_1.7.bb
> @@ -0,0 +1,4 @@
> +require go-${PV}.inc
> +require go.inc
> +
> +BBCLASSEXTEND = "cross"


+1 for adding Go to oe-core. We already use it in Mender and are
currently including oe-meta-go. This way we could limit the number of
layers that meta-mender depends on.

As for the patch itself, can you include information about oe-meta-go
revision that you used? I recall there was a policy commit messages in
patches including commits/recipes from other layers, though I'm not
sure if it's still in place or not.

BTW. one thing that I particularly dislike is the find/tar trampoline
and destsuffix. Though, I'm not sure if there's a sensible way around
it. Go enforces a particular project structure that's not entirely
flexible in use outside of one's private workspace.

I've also seen destsuffix break recipes that always build the latest
version. I believe the issue is caused by git fetcher but have not had
time to get down a debug it thoroughly.


-- 
Maciej Borzecki
RnDity


^ permalink raw reply

* Re: [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Burton, Ross @ 2016-11-11 16:52 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CAMKF1sou_spk+SLREA6v8TBynki-2Au+x+sNXM0cMniJYpOA9w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On 11 November 2016 at 16:02, Khem Raj <raj.khem@gmail.com> wrote:

> Nothing thats enabled in OE-Core depends on go yet, however, thats not
> always the reason
> for something to be in OE-Core, if you look out, you will see there is
> no single layer for golang ( I see atleast 5 )
> support, each one of them is done differently, some are better than
> others depending upon what you need,
> This causes a lot of confusion for users who have golang needs.
>  golang is a fast growing language being adopted in verticals where OE is
> used,
> This would offer a consolidated place for golang in OE ecosystem.
>

I'm not a massive fan of throwing everything into oe-core, attempting to
stop the proliferation of go layers and having everyone agree that a single
layer hosted at git.yp or whatever is canonical (even if they decide to
copy and paste from it, meta-virtualisation I'm looking at you...) seems
more logical.

Ross

[-- Attachment #2: Type: text/html, Size: 1366 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Bruce Ashfield @ 2016-11-11 16:44 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CAMKF1sou_spk+SLREA6v8TBynki-2Au+x+sNXM0cMniJYpOA9w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

On Fri, Nov 11, 2016 at 11:02 AM, Khem Raj <raj.khem@gmail.com> wrote:

> On Fri, Nov 11, 2016 at 5:10 AM, Alexander Kanavin
> <alexander.kanavin@linux.intel.com> wrote:
> > On 11/10/2016 02:39 AM, Khem Raj wrote:
> >>
> >> This is converging the recipes for go from
> >> meta-virtualization and oe-meta-go
> >
> >
> > Wait a moment, why this should go to oe-core and not to meta-go? Is there
> > something in oe-core itself that requires presence of go compiler?
>
> Nothing thats enabled in OE-Core depends on go yet, however, thats not
> always the reason
> for something to be in OE-Core, if you look out, you will see there is
> no single layer for golang ( I see atleast 5 )
> support, each one of them is done differently, some are better than
> others depending upon what you need,
> This causes a lot of confusion for users who have golang needs.
>  golang is a fast growing language being adopted in verticals where OE is
> used,
> This would offer a consolidated place for golang in OE ecosystem.
>

Agreed.

There's a reason why meta-virt has such extensive go support .. we never
could
get consistent behaviour from the other layers, and changes took a while to
coordinate.

Getting a good baseline in oe-core would simplify a lot of layers, and it
is only
a matter of time before there's a direct user in oe-core.

Bruce


> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

[-- Attachment #2: Type: text/html, Size: 2735 bytes --]

^ permalink raw reply

* Yocto Project Status WW46
From: Jolley, Stephen K @ 2016-11-11 16:31 UTC (permalink / raw)
  To: yocto@yoctoproject.org, openembedded-core@lists.openembedded.org

[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]

Current Dev Position: YP 2.3 M1

Next Deadline: YP 2.3 M1 by Dec. 12, 2016


SWAT team rotation: Randy -> Leo

https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team


Key Status/Updates:

*        2.1.2 is in QA. This did not build 100% cleanly, there is a separate email about that.

*        2.3 planning is ongoing and making good progress. This can be seen by looking at the 2.3 targeted bugs in bugzilla.

*        We are going to make a strong effort to load balance things up front this time so work is spread over M1-3 rather than the usual 'front loaded' everything in M1 approach which is currently how bugzilla looks.

*        WDD is now climbing again unfortunately.


Proposed upcoming dot releases:

YP 2.1.2 Release by Nov. 18, 2016

YP 2.0.3 Release by Dec. 9, 2016

YP 2.2.1 Release by Jan. 20, 2017


Key YP 2.3 Dates:

YP 2.3 M1 Cutoff is Dec. 12, 2016

YP 2.3 M1 Release is Dec. 23, 2016

YP 2.3 M2 Cutoff is Jan. 23, 2017

YP 2.3 M2 Release is Feb. 3, 2017

YP 2.3 M3 Cutoff is Feb 27, 2017

YP 2.3 M3 Release is Mar. 10, 2017

YP 2.3 M4 Cutoff is April 3, 2017

YP 2.3 M4 Release is April 28, 2017


Tracking Metrics:

            WDD 2497 (last week 2422)

(https://wiki.yoctoproject.org/charts/combo.html)


Key Status Links for YP:

https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.3_Status

https://wiki.yoctoproject.org/wiki/Yocto_2.3_Schedule

https://wiki.yoctoproject.org/wiki/Yocto_2.3_Features

[If anyone has suggestions for other information you'd like to see on this weekly status update, let us know!]

Thanks,

Stephen K. Jolley
Yocto Project Program Manager
INTEL, MS JF1-255, 2111 N.E. 25th Avenue, Hillsboro, OR 97124
*   Work Telephone:        (503) 712-0534
*    Cell:               (208) 244-4460
* Email:                            stephen.k.jolley@intel.com


[-- Attachment #2: Type: text/html, Size: 17877 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Khem Raj @ 2016-11-11 16:02 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <d8dfb2d5-66de-8daf-99c3-13c611a7f5b2@linux.intel.com>

On Fri, Nov 11, 2016 at 5:10 AM, Alexander Kanavin
<alexander.kanavin@linux.intel.com> wrote:
> On 11/10/2016 02:39 AM, Khem Raj wrote:
>>
>> This is converging the recipes for go from
>> meta-virtualization and oe-meta-go
>
>
> Wait a moment, why this should go to oe-core and not to meta-go? Is there
> something in oe-core itself that requires presence of go compiler?

Nothing thats enabled in OE-Core depends on go yet, however, thats not
always the reason
for something to be in OE-Core, if you look out, you will see there is
no single layer for golang ( I see atleast 5 )
support, each one of them is done differently, some are better than
others depending upon what you need,
This causes a lot of confusion for users who have golang needs.
 golang is a fast growing language being adopted in verticals where OE is used,
This would offer a consolidated place for golang in OE ecosystem.


^ permalink raw reply

* Re: libtool --with-libtool-sysroot
From: Burton, Ross @ 2016-11-11 15:34 UTC (permalink / raw)
  To: Jack Mitchell; +Cc: OE-core
In-Reply-To: <0e379627-328b-cd37-0310-67a14156d90e@embed.me.uk>

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

On 11 November 2016 at 14:34, Jack Mitchell <ml@embed.me.uk> wrote:

> However, looking at the libtool recipe in OE it has a patch which changes
> the libtool flag from --with-sysroot to --with-libtool-sysroot. The
> question is, how is this version not making it into my SDK, I have sourced
> the environment script and a which libtoolize points to the right path.
>

Is the package you are trying to build using its own libtool (or the host
libtool), and not our prefixed libtool?

Ross

[-- Attachment #2: Type: text/html, Size: 891 bytes --]

^ permalink raw reply

* libtool --with-libtool-sysroot
From: Jack Mitchell @ 2016-11-11 14:34 UTC (permalink / raw)
  To: OE-core

I've run into an issue where libtool isn't using the right prefix in an 
SDK built with -c populate_sdk. Looking at the configure log I can see:

configure: WARNING: unrecognized options: --with-libtool-sysroot

However, looking at the libtool recipe in OE it has a patch which 
changes the libtool flag from --with-sysroot to --with-libtool-sysroot. 
The question is, how is this version not making it into my SDK, I have 
sourced the environment script and a which libtoolize points to the 
right path.

/openembedded/sdk/latest/sysroots/x86_64-oecore-linux/usr/bin/libtoolize

Any ideas?


^ permalink raw reply

* Re: [PATCH] [krogoth] nss: Disable warning on deprecated API usage
From: Burton, Ross @ 2016-11-11 14:59 UTC (permalink / raw)
  To: Zeeshan Ali; +Cc: Zeeshan Ali, OE-core
In-Reply-To: <20161111142525.20700-1-zeeshan.ali@pelagicore.com>

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

On 11 November 2016 at 14:25, Zeeshan Ali <zeeshanak@gnome.org> wrote:

> nss itself enables Werror if gcc is version 4.8 of greater, which fails
> the build against new glibc (2.24) because of use of readdir_r(), which
> is now deprecated. Let's just disable warnings on deprecated API usage.
>
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=10644
>

Oh, and please sign-off the commit message as well as the patch.

Ross

[-- Attachment #2: Type: text/html, Size: 963 bytes --]

^ permalink raw reply

* Re: [PATCH] [krogoth] nss: Disable warning on deprecated API usage
From: Burton, Ross @ 2016-11-11 14:55 UTC (permalink / raw)
  To: Zeeshan Ali; +Cc: Zeeshan Ali, OE-core
In-Reply-To: <20161111142525.20700-1-zeeshan.ali@pelagicore.com>

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

On 11 November 2016 at 14:25, Zeeshan Ali <zeeshanak@gnome.org> wrote:

> +Upstream-Status: Pending
>

Please use either Backport (upstream did the same change) or Inappropriate
(upstream did an invasive change, this is easier to audit for a stable
release).

Ross

[-- Attachment #2: Type: text/html, Size: 679 bytes --]

^ permalink raw reply

* [PATCH] [krogoth] nss: Disable warning on deprecated API usage
From: Zeeshan Ali @ 2016-11-11 14:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zeeshan Ali

nss itself enables Werror if gcc is version 4.8 of greater, which fails
the build against new glibc (2.24) because of use of readdir_r(), which
is now deprecated. Let's just disable warnings on deprecated API usage.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=10644
---

This patch is not needed for master or morty, cause they use the latest version of nss. 

 .../nss/nss-disable-werror-on-deprecated-api.patch | 22 ++++++++++++++++++++++
 meta/recipes-support/nss/nss_3.21.bb               |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-support/nss/nss/nss-disable-werror-on-deprecated-api.patch

diff --git a/meta/recipes-support/nss/nss/nss-disable-werror-on-deprecated-api.patch b/meta/recipes-support/nss/nss/nss-disable-werror-on-deprecated-api.patch
new file mode 100644
index 0000000..bbd5243
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss-disable-werror-on-deprecated-api.patch
@@ -0,0 +1,22 @@
+Disable Werror on deprecated API
+
+nss itself enables Werror if gcc is version 4.8 of greater, which fails
+the build against new glibc (2.24) because of use of readdir_r(), which is
+now deprecated. Let's just disable warnings on deprecated API usage.
+
+Upstream-Status: Pending
+
+Signed-off-by: Zeeshan Ali <zeeshan.ali@pelagicore.com>
+===================================================
+diff -u -r a/nss/coreconf/Werror.mk b/nss/coreconf/Werror.mk
+--- a/nss/coreconf/Werror.mk	2015-11-09 06:12:59.000000000 +0100
++++ b/nss/coreconf/Werror.mk	2016-11-11 14:36:36.301062957 +0100
+@@ -60,7 +60,7 @@
+   endif #ndef NSS_ENABLE_WERROR
+ 
+   ifeq ($(NSS_ENABLE_WERROR),1)
+-    WARNING_CFLAGS += -Werror
++    WARNING_CFLAGS += -Werror -Wno-deprecated -Wno-deprecated-declarations
+   else
+     # Old versions of gcc (< 4.8) don't support #pragma diagnostic in functions.
+     # Use this to disable use of that #pragma and the warnings it suppresses.
diff --git a/meta/recipes-support/nss/nss_3.21.bb b/meta/recipes-support/nss/nss_3.21.bb
index 05d81c2..7933883 100644
--- a/meta/recipes-support/nss/nss_3.21.bb
+++ b/meta/recipes-support/nss/nss_3.21.bb
@@ -22,6 +22,7 @@ SRC_URI = "\
     file://nss-fix-nsinstall-build.patch \
     file://0001-Fix-build-failure-on-opensuse-13.1.patch \
     file://nss-gcc6-fix.patch \
+    file://nss-disable-werror-on-deprecated-api.patch \
     file://nss.pc.in \
     file://signlibs.sh \
 "
-- 
2.9.3



^ permalink raw reply related

* Re: [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Alexander Kanavin @ 2016-11-11 13:10 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <20161110003935.1858-1-raj.khem@gmail.com>

On 11/10/2016 02:39 AM, Khem Raj wrote:
> This is converging the recipes for go from
> meta-virtualization and oe-meta-go

Wait a moment, why this should go to oe-core and not to meta-go? Is 
there something in oe-core itself that requires presence of go compiler?

Alex



^ permalink raw reply

* Re: [PATCH] devtool: fix handling of unicode characters from subprocess stdout
From: Burton, Ross @ 2016-11-11 12:22 UTC (permalink / raw)
  To: Jiajie Hu; +Cc: OE-core
In-Reply-To: <1478844138-13407-1-git-send-email-jiajie.hu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On 11 November 2016 at 06:02, Jiajie Hu <jiajie.hu@intel.com> wrote:

> +    reader = codecs.getreader('utf-8')(process.stdout)
>      buf = ''
>      while True:
> -        out = process.stdout.read(1)
> -        out = out.decode('utf-8')
> +        out = reader.read(1, 1)
>

A reader is definitely the right thing here, but I'm wondering why this
needs to loop on single characters.  As I understand it doing a read() on a
reader wrapping stdout will read until it blocks (because the process
hasn't got anything to output) so result in less pointless iterating.

Ross

[-- Attachment #2: Type: text/html, Size: 1055 bytes --]

^ permalink raw reply

* [PATCHv4][krogoth] curl: CVE-2016-8625
From: Sona Sarmadi @ 2016-11-11 11:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona

IDNA 2003 makes curl use wrong host

Affected versions: curl 7.12.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102K.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8625.patch | 615 +++++++++++++++++++++
 .../url-remove-unconditional-idn2.h-include.patch  |  29 +
 meta/recipes-support/curl/curl_7.47.1.bb           |   2 +
 3 files changed, 646 insertions(+)
 create mode 100755 meta/recipes-support/curl/curl/CVE-2016-8625.patch
 create mode 100644 meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8625.patch b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
new file mode 100755
index 0000000..b618277
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
@@ -0,0 +1,615 @@
+commit 914aae739463ec72340130ea9ad42e04b02a5338
+Author: Daniel Stenberg <daniel@haxx.se>
+Date:   Wed Oct 12 09:01:06 2016 +0200
+
+idn: switch to libidn2 use and IDNA2008 support
+
+CVE: CVE-2016-8625
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102K.html
+Reported-by: Christian Heimes
+
+Conflicts:
+	CMakeLists.txt
+	lib/url.c
+
+Signed-off-by: Martin Borg <martin.borg@enea.com>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 06f18cf..c3e5c7c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -440,7 +440,7 @@ if(NOT CURL_DISABLE_LDAPS)
+ endif()
+ 
+ # Check for idn
+-check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
++check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+ 
+ # Check for symbol dlopen (same as HAVE_LIBDL)
+ check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
+@@ -608,7 +608,7 @@ check_include_file_concat("des.h"            HAVE_DES_H)
+ check_include_file_concat("err.h"            HAVE_ERR_H)
+ check_include_file_concat("errno.h"          HAVE_ERRNO_H)
+ check_include_file_concat("fcntl.h"          HAVE_FCNTL_H)
+-check_include_file_concat("idn-free.h"       HAVE_IDN_FREE_H)
++check_include_file_concat("idn2.h"           HAVE_IDN2_H)
+ check_include_file_concat("ifaddrs.h"        HAVE_IFADDRS_H)
+ check_include_file_concat("io.h"             HAVE_IO_H)
+ check_include_file_concat("krb.h"            HAVE_KRB_H)
+@@ -638,7 +638,6 @@ check_include_file_concat("stropts.h"        HAVE_STROPTS_H)
+ check_include_file_concat("termio.h"         HAVE_TERMIO_H)
+ check_include_file_concat("termios.h"        HAVE_TERMIOS_H)
+ check_include_file_concat("time.h"           HAVE_TIME_H)
+-check_include_file_concat("tld.h"            HAVE_TLD_H)
+ check_include_file_concat("unistd.h"         HAVE_UNISTD_H)
+ check_include_file_concat("utime.h"          HAVE_UTIME_H)
+ check_include_file_concat("x509.h"           HAVE_X509_H)
+@@ -652,9 +651,6 @@ check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
+ check_include_file_concat("stdint.h"        HAVE_STDINT_H)
+ check_include_file_concat("sockio.h"        HAVE_SOCKIO_H)
+ check_include_file_concat("sys/utsname.h"   HAVE_SYS_UTSNAME_H)
+-check_include_file_concat("idna.h"          HAVE_IDNA_H)
+-
+-
+ 
+ check_type_size(size_t  SIZEOF_SIZE_T)
+ check_type_size(ssize_t  SIZEOF_SSIZE_T)
+@@ -802,9 +798,6 @@ check_symbol_exists(pipe           "${CURL_INCLUDES}" HAVE_PIPE)
+ check_symbol_exists(ftruncate      "${CURL_INCLUDES}" HAVE_FTRUNCATE)
+ check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
+ check_symbol_exists(getrlimit      "${CURL_INCLUDES}" HAVE_GETRLIMIT)
+-check_symbol_exists(idn_free       "${CURL_INCLUDES}" HAVE_IDN_FREE)
+-check_symbol_exists(idna_strerror  "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
+-check_symbol_exists(tld_strerror   "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
+ check_symbol_exists(setlocale      "${CURL_INCLUDES}" HAVE_SETLOCALE)
+ check_symbol_exists(setrlimit      "${CURL_INCLUDES}" HAVE_SETRLIMIT)
+ check_symbol_exists(fcntl          "${CURL_INCLUDES}" HAVE_FCNTL)
+@@ -1067,7 +1060,7 @@ _add_if("IPv6"          ENABLE_IPV6)
+ _add_if("unix-sockets"  USE_UNIX_SOCKETS)
+ _add_if("libz"          HAVE_LIBZ)
+ _add_if("AsynchDNS"     USE_ARES OR USE_THREADS_POSIX)
+-_add_if("IDN"           HAVE_LIBIDN)
++_add_if("IDN"           HAVE_LIBIDN2)
+ # TODO SSP1 (WinSSL) check is missing
+ _add_if("SSPI"          USE_WINDOWS_SSPI)
+ _add_if("GSS-API"       HAVE_GSSAPI)
+diff --git a/configure.ac b/configure.ac
+index 4c9862f..c8e2721 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,7 +157,7 @@ curl_tls_srp_msg="no      (--enable-tls-srp)"
+     curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
+    curl_ipv6_msg="no      (--enable-ipv6)"
+ curl_unix_sockets_msg="no      (--enable-unix-sockets)"
+-    curl_idn_msg="no      (--with-{libidn,winidn})"
++    curl_idn_msg="no      (--with-{libidn2,winidn})"
+  curl_manual_msg="no      (--enable-manual)"
+ curl_libcurl_msg="enabled (--disable-libcurl-option)"
+ curl_verbose_msg="enabled (--disable-verbose)"
+@@ -2825,15 +2825,15 @@ dnl **********************************************************************
+ dnl Check for the presence of IDN libraries and headers
+ dnl **********************************************************************
+ 
+-AC_MSG_CHECKING([whether to build with libidn])
++AC_MSG_CHECKING([whether to build with libidn2])
+ OPT_IDN="default"
+ AC_ARG_WITH(libidn,
+-AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
+-AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
++AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
++AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
+   [OPT_IDN=$withval])
+ case "$OPT_IDN" in
+   no)
+-    dnl --without-libidn option used
++    dnl --without-libidn2 option used
+     want_idn="no"
+     AC_MSG_RESULT([no])
+     ;;
+@@ -2844,13 +2844,13 @@ case "$OPT_IDN" in
+     AC_MSG_RESULT([(assumed) yes])
+     ;;
+   yes)
+-    dnl --with-libidn option used without path
++    dnl --with-libidn2 option used without path
+     want_idn="yes"
+     want_idn_path="default"
+     AC_MSG_RESULT([yes])
+     ;;
+   *)
+-    dnl --with-libidn option used with path
++    dnl --with-libidn2 option used with path
+     want_idn="yes"
+     want_idn_path="$withval"
+     AC_MSG_RESULT([yes ($withval)])
+@@ -2867,33 +2867,33 @@ if test "$want_idn" = "yes"; then
+   if test "$want_idn_path" != "default"; then
+     dnl path has been specified
+     IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
+-    CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
++    CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
+     if test "$PKGCONFIG" != "no"; then
+       IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --libs-only-l libidn 2>/dev/null`
++        $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
+       IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --libs-only-L libidn 2>/dev/null`
++        $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
+       IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++        $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+     else
+       dnl pkg-config not available or provides no info
+-      IDN_LIBS="-lidn"
++      IDN_LIBS="-lidn2"
+       IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
+       IDN_CPPFLAGS="-I$want_idn_path/include"
+       IDN_DIR="$want_idn_path/lib$libsuff"
+     fi
+   else
+     dnl path not specified
+-    CURL_CHECK_PKGCONFIG(libidn)
++    CURL_CHECK_PKGCONFIG(libidn2)
+     if test "$PKGCONFIG" != "no"; then
+-      IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
+-      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
+-      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++      IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
++      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
++      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+     else
+       dnl pkg-config not available or provides no info
+-      IDN_LIBS="-lidn"
++      IDN_LIBS="-lidn2"
+     fi
+   fi
+   #
+@@ -2913,9 +2913,9 @@ if test "$want_idn" = "yes"; then
+   LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
+   LIBS="$IDN_LIBS $LIBS"
+   #
+-  AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
++  AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
+   AC_LINK_IFELSE([
+-    AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
++    AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
+   ],[
+     AC_MSG_RESULT([yes])
+     tst_links_libidn="yes"
+@@ -2923,37 +2923,19 @@ if test "$want_idn" = "yes"; then
+     AC_MSG_RESULT([no])
+     tst_links_libidn="no"
+   ])
+-  if test "$tst_links_libidn" = "no"; then
+-    AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
+-    AC_LINK_IFELSE([
+-      AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
+-    ],[
+-      AC_MSG_RESULT([yes])
+-      tst_links_libidn="yes"
+-    ],[
+-      AC_MSG_RESULT([no])
+-      tst_links_libidn="no"
+-    ])
+-  fi
+   #
++  AC_CHECK_HEADERS( idn2.h )
++
+   if test "$tst_links_libidn" = "yes"; then
+-    AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
++    AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
+     dnl different versions of libidn have different setups of these:
+-    AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
+-    AC_CHECK_HEADERS( idn-free.h tld.h )
+-    if test "x$ac_cv_header_tld_h" = "xyes"; then
+-      AC_SUBST([IDN_ENABLED], [1])
+-      curl_idn_msg="enabled"
+-      if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
+-        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
+-        export LD_LIBRARY_PATH
+-        AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+-      fi
+-    else
+-      AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
+-      CPPFLAGS="$clean_CPPFLAGS"
+-      LDFLAGS="$clean_LDFLAGS"
+-      LIBS="$clean_LIBS"
++
++    AC_SUBST([IDN_ENABLED], [1])
++    curl_idn_msg="enabled (libidn2)"
++    if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
++      LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
++      export LD_LIBRARY_PATH
++      AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+     fi
+   else
+     AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
+diff --git a/lib/curl_setup.h b/lib/curl_setup.h
+index 33ad129..5fb241b 100644
+--- a/lib/curl_setup.h
++++ b/lib/curl_setup.h
+@@ -590,10 +590,9 @@ int netware_init(void);
+ #endif
+ #endif
+ 
+-#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
+-/* The lib was present and the tld.h header (which is missing in libidn 0.3.X
+-   but we only work with libidn 0.4.1 or later) */
+-#define USE_LIBIDN
++#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H)
++/* The lib and header are present */
++#define USE_LIBIDN2
+ #endif
+ 
+ #ifndef SIZEOF_TIME_T
+diff --git a/lib/easy.c b/lib/easy.c
+index d529da8..51d57e3 100644
+--- a/lib/easy.c
++++ b/lib/easy.c
+@@ -144,28 +144,6 @@ static CURLcode win32_init(void)
+   return CURLE_OK;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Initialise use of IDNA library.
+- * It falls back to ASCII if $CHARSET isn't defined. This doesn't work for
+- * idna_to_ascii_lz().
+- */
+-static void idna_init (void)
+-{
+-#ifdef WIN32
+-  char buf[60];
+-  UINT cp = GetACP();
+-
+-  if(!getenv("CHARSET") && cp > 0) {
+-    snprintf(buf, sizeof(buf), "CHARSET=cp%u", cp);
+-    putenv(buf);
+-  }
+-#else
+-  /* to do? */
+-#endif
+-}
+-#endif  /* USE_LIBIDN */
+-
+ /* true globals -- for curl_global_init() and curl_global_cleanup() */
+ static unsigned int  initialized;
+ static long          init_flags;
+@@ -262,10 +240,6 @@ static CURLcode global_init(long flags, bool memoryfuncs)
+   }
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-  idna_init();
+-#endif
+-
+   if(Curl_resolver_global_init()) {
+     DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n"));
+     return CURLE_FAILED_INIT;
+diff --git a/lib/strerror.c b/lib/strerror.c
+index d222a1f..bf4faae 100644
+--- a/lib/strerror.c
++++ b/lib/strerror.c
+@@ -35,8 +35,8 @@
+ 
+ #include <curl/curl.h>
+ 
+-#ifdef USE_LIBIDN
+-#include <idna.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+ 
+ #ifdef USE_WINDOWS_SSPI
+@@ -723,83 +723,6 @@ const char *Curl_strerror(struct connectdata *conn, int err)
+   return buf;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Return error-string for libidn status as returned from idna_to_ascii_lz().
+- */
+-const char *Curl_idn_strerror (struct connectdata *conn, int err)
+-{
+-#ifdef HAVE_IDNA_STRERROR
+-  (void)conn;
+-  return idna_strerror((Idna_rc) err);
+-#else
+-  const char *str;
+-  char *buf;
+-  size_t max;
+-
+-  DEBUGASSERT(conn);
+-
+-  buf = conn->syserr_buf;
+-  max = sizeof(conn->syserr_buf)-1;
+-  *buf = '\0';
+-
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-  switch ((Idna_rc)err) {
+-    case IDNA_SUCCESS:
+-      str = "No error";
+-      break;
+-    case IDNA_STRINGPREP_ERROR:
+-      str = "Error in string preparation";
+-      break;
+-    case IDNA_PUNYCODE_ERROR:
+-      str = "Error in Punycode operation";
+-      break;
+-    case IDNA_CONTAINS_NON_LDH:
+-      str = "Illegal ASCII characters";
+-      break;
+-    case IDNA_CONTAINS_MINUS:
+-      str = "Contains minus";
+-      break;
+-    case IDNA_INVALID_LENGTH:
+-      str = "Invalid output length";
+-      break;
+-    case IDNA_NO_ACE_PREFIX:
+-      str = "No ACE prefix (\"xn--\")";
+-      break;
+-    case IDNA_ROUNDTRIP_VERIFY_ERROR:
+-      str = "Round trip verify error";
+-      break;
+-    case IDNA_CONTAINS_ACE_PREFIX:
+-      str = "Already have ACE prefix (\"xn--\")";
+-      break;
+-    case IDNA_ICONV_ERROR:
+-      str = "Locale conversion failed";
+-      break;
+-    case IDNA_MALLOC_ERROR:
+-      str = "Allocation failed";
+-      break;
+-    case IDNA_DLOPEN_ERROR:
+-      str = "dlopen() error";
+-      break;
+-    default:
+-      snprintf(buf, max, "error %d", err);
+-      str = NULL;
+-      break;
+-  }
+-#else
+-  if((Idna_rc)err == IDNA_SUCCESS)
+-    str = "No error";
+-  else
+-    str = "Error";
+-#endif
+-  if(str)
+-    strncpy(buf, str, max);
+-  buf[max] = '\0';
+-  return (buf);
+-#endif
+-}
+-#endif  /* USE_LIBIDN */
+-
+ #ifdef USE_WINDOWS_SSPI
+ const char *Curl_sspi_strerror (struct connectdata *conn, int err)
+ {
+diff --git a/lib/strerror.h b/lib/strerror.h
+index ae8c96b..627273e 100644
+--- a/lib/strerror.h
++++ b/lib/strerror.h
+@@ -7,7 +7,7 @@
+  *                            | (__| |_| |  _ <| |___
+  *                             \___|\___/|_| \_\_____|
+  *
+- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+  *
+  * This software is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution. The terms
+@@ -26,7 +26,7 @@
+ 
+ const char *Curl_strerror (struct connectdata *conn, int err);
+ 
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+ const char *Curl_idn_strerror (struct connectdata *conn, int err);
+ #endif
+ 
+diff --git a/lib/url.c b/lib/url.c
+index 8832989..8d52152 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -59,24 +59,15 @@
+ #include <limits.h>
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-#include <idna.h>
+-#include <tld.h>
+-#include <stringprep.h>
+-#ifdef HAVE_IDN_FREE_H
+-#include <idn-free.h>
+-#else
+-/* prototype from idn-free.h, not provided by libidn 0.4.5's make install! */
+-void idn_free (void *ptr);
+-#endif
+-#ifndef HAVE_IDN_FREE
+-/* if idn_free() was not found in this version of libidn use free() instead */
+-#define idn_free(x) (free)(x)
+-#endif
++#ifdef USE_LIBIDN2
++#include <idn2.h>
++
+ #elif defined(USE_WIN32_IDN)
+ /* prototype for curl_win32_idn_to_ascii() */
+ int curl_win32_idn_to_ascii(const char *in, char **out);
+-#endif  /* USE_LIBIDN */
++#endif  /* USE_LIBIDN2 */
++
++#include <idn2.h>
+ 
+ #include "urldata.h"
+ #include "netrc.h"
+@@ -3693,59 +3684,15 @@ static bool is_ASCII_name(const char *hostname)
+   return TRUE;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Check if characters in hostname is allowed in Top Level Domain.
+- */
+-static bool tld_check_name(struct SessionHandle *data,
+-                           const char *ace_hostname)
+-{
+-  size_t err_pos;
+-  char *uc_name = NULL;
+-  int rc;
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-  const char *tld_errmsg = "<no msg>";
+-#else
+-  (void)data;
+-#endif
+-
+-  /* Convert (and downcase) ACE-name back into locale's character set */
+-  rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0);
+-  if(rc != IDNA_SUCCESS)
+-    return FALSE;
+-
+-  rc = tld_check_lz(uc_name, &err_pos, NULL);
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-#ifdef HAVE_TLD_STRERROR
+-  if(rc != TLD_SUCCESS)
+-    tld_errmsg = tld_strerror((Tld_rc)rc);
+-#endif
+-  if(rc == TLD_INVALID)
+-    infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n",
+-          tld_errmsg, err_pos, uc_name[err_pos],
+-          uc_name[err_pos] & 255);
+-  else if(rc != TLD_SUCCESS)
+-    infof(data, "WARNING: TLD check for %s failed; %s\n",
+-          uc_name, tld_errmsg);
+-#endif /* CURL_DISABLE_VERBOSE_STRINGS */
+-  if(uc_name)
+-     idn_free(uc_name);
+-  if(rc != TLD_SUCCESS)
+-    return FALSE;
+-
+-  return TRUE;
+-}
+-#endif
+-
+ /*
+  * Perform any necessary IDN conversion of hostname
+  */
+-static void fix_hostname(struct SessionHandle *data,
+-                         struct connectdata *conn, struct hostname *host)
++static void fix_hostname(struct connectdata *conn, struct hostname *host)
+ {
+   size_t len;
++  struct Curl_easy *data = conn->data;
+ 
+-#ifndef USE_LIBIDN
++#ifndef USE_LIBIDN2
+   (void)data;
+   (void)conn;
+ #elif defined(CURL_DISABLE_VERBOSE_STRINGS)
+@@ -3762,26 +3709,18 @@ static void fix_hostname(struct SessionHandle *data,
+     host->name[len-1]=0;
+ 
+   if(!is_ASCII_name(host->name)) {
+-#ifdef USE_LIBIDN
+-  /*************************************************************
+-   * Check name for non-ASCII and convert hostname to ACE form.
+-   *************************************************************/
+-  if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+-    char *ace_hostname = NULL;
+-    int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0);
+-    infof (data, "Input domain encoded as `%s'\n",
+-           stringprep_locale_charset ());
+-    if(rc != IDNA_SUCCESS)
+-      infof(data, "Failed to convert %s to ACE; %s\n",
+-            host->name, Curl_idn_strerror(conn, rc));
+-    else {
+-      /* tld_check_name() displays a warning if the host name contains
+-         "illegal" characters for this TLD */
+-      (void)tld_check_name(data, ace_hostname);
+-
+-      host->encalloc = ace_hostname;
+-      /* change the name pointer to point to the encoded hostname */
+-      host->name = host->encalloc;
++#ifdef USE_LIBIDN2
++    if(idn2_check_version(IDN2_VERSION)) {
++      char *ace_hostname = NULL;
++      int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, 0);
++      if(rc == IDN2_OK) {
++        host->encalloc = (char *)ace_hostname;
++        /* change the name pointer to point to the encoded hostname */
++        host->name = host->encalloc;
++      }
++      else
++        infof(data, "Failed to convert %s to ACE; %s\n", host->name,
++              idn2_strerror(rc));
+     }
+   }
+ #elif defined(USE_WIN32_IDN)
+@@ -3809,9 +3748,9 @@ static void fix_hostname(struct SessionHandle *data,
+  */
+ static void free_fixed_hostname(struct hostname *host)
+ {
+-#if defined(USE_LIBIDN)
++#if defined(USE_LIBIDN2)
+   if(host->encalloc) {
+-    idn_free(host->encalloc); /* must be freed with idn_free() since this was
++    idn2_free(host->encalloc); /* must be freed with idn2_free() since this was
+                                  allocated by libidn */
+     host->encalloc = NULL;
+   }
+@@ -5707,9 +5646,9 @@ static CURLcode create_conn(struct SessionHandle *data,
+   /*************************************************************
+    * IDN-fix the hostnames
+    *************************************************************/
+-  fix_hostname(data, conn, &conn->host);
++  fix_hostname(conn, &conn->host);
+   if(conn->proxy.name && *conn->proxy.name)
+-    fix_hostname(data, conn, &conn->proxy);
++    fix_hostname(conn, &conn->proxy);
+ 
+   /*************************************************************
+    * Setup internals depending on protocol. Needs to be done after
+diff --git a/lib/version.c b/lib/version.c
+index 7f14fa5..a5c9811 100644
+--- a/lib/version.c
++++ b/lib/version.c
+@@ -36,8 +36,8 @@
+ #  include <ares.h>
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-#include <stringprep.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+ 
+ #ifdef USE_LIBPSL
+@@ -97,9 +97,9 @@ char *curl_version(void)
+   left -= len;
+   ptr += len;
+ #endif
+-#ifdef USE_LIBIDN
+-  if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+-    len = snprintf(ptr, left, " libidn/%s", stringprep_check_version(NULL));
++#ifdef USE_LIBIDN2
++  if(idn2_check_version(IDN2_VERSION)) {
++    len = snprintf(ptr, left, " libidn2/%s", idn2_check_version(NULL));
+     left -= len;
+     ptr += len;
+   }
+@@ -344,10 +344,10 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
+     version_info.ares_num = aresnum;
+   }
+ #endif
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+   /* This returns a version string if we use the given version or later,
+      otherwise it returns NULL */
+-  version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION);
++  version_info.libidn = idn2_check_version(IDN2_VERSION);
+   if(version_info.libidn)
+     version_info.features |= CURL_VERSION_IDN;
+ #elif defined(USE_WIN32_IDN)
diff --git a/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
new file mode 100644
index 0000000..3549101
--- /dev/null
+++ b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
@@ -0,0 +1,29 @@
+From c27013c05d99d92370b57e1a7af1b854eef4e7c1 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 31 Oct 2016 09:49:50 +0100
+Subject: [PATCH] url: remove unconditional idn2.h include
+
+Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]
+Upstream-Status: Backport
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/url.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index c90a1c5..b997f41 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -67,8 +67,6 @@
+ bool curl_win32_idn_to_ascii(const char *in, char **out);
+ #endif  /* USE_LIBIDN2 */
+ 
+-#include <idn2.h>
+-
+ #include "urldata.h"
+ #include "netrc.h"
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3c877e4..7fab7cf 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -25,6 +25,8 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8622.patch \
              file://CVE-2016-8623.patch \
              file://CVE-2016-8624.patch \
+             file://CVE-2016-8625.patch \
+             file://url-remove-unconditional-idn2.h-include.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* Re: [PATCH][krogoth 12/12] curl/url: remove unconditional idn2.h include
From: Burton, Ross @ 2016-11-11 11:07 UTC (permalink / raw)
  To: Sona Sarmadi; +Cc: sona, OE-core
In-Reply-To: <1478857754-61379-12-git-send-email-sona.sarmadi@enea.com>

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

On 11 November 2016 at 09:49, Sona Sarmadi <sona.sarmadi@enea.com> wrote:

> +From c27013c05d99d92370b57e1a7af1b854eef4e7c1 Mon Sep 17 00:00:00 2001
> +From: Daniel Stenberg <daniel@haxx.se>
> +Date: Mon, 31 Oct 2016 09:49:50 +0100
> +Subject: [PATCH] url: remove unconditional idn2.h include
> +
> +Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]
> +
> +Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
>

No Upstream-Status in this.  If it's part of the fix to the CVE, maybe it
should be applied in the same patch?

Ross

[-- Attachment #2: Type: text/html, Size: 1069 bytes --]

^ permalink raw reply

* Re: [PATCH][krogoth 12/12] curl/url: remove unconditional idn2.h include
From: Anders Darander @ 2016-11-11 10:53 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1478857754-61379-12-git-send-email-sona.sarmadi@enea.com>

* Sona Sarmadi <sona.sarmadi@enea.com> [161111 11:15]:

> Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]

Is that patch unnecessary for some branch that this is either
cherry-picked from, or cherry-picked to? Otherwise, squash this one with
11, there's no need to have a separate fix-up patch.

Cheers,
Anders
-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


^ permalink raw reply

* Re: [PATCH] python3: Build and package precompiled modules
From: Joshua Lock @ 2016-11-11 10:16 UTC (permalink / raw)
  To: Dominic Sacré, openembedded-core
In-Reply-To: <20161025172017.13039-1-dominic.sacre@gmx.de>

On Tue, 2016-10-25 at 19:20 +0200, Dominic Sacré wrote:
> Remove the patch that was applied in the python3 and python3-native
> recipes to skip compilation of python modules.
> 
> Modify generate-manifest-3.5.py to match '__pycache__' directories in
> FILES_*.
> This is necessary because Python3 puts .pyc files in '__pycache__'
> subdirectories one level below the corresponding .py files, whereas
> in
> Python2 they used to be right next to the sources.
> 
> This change significantly reduces the startup overhead of Python3
> scripts. For example, on a Cortex-A9, "python3 -c pass" took 0.40s
> before, and 0.19s after.
> 
> Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>

This looks good, thanks. I've had a similar change queued locally and
testing for [YOCTO #10315].

Acked-by: Joshua Lock <joshua.g.lock@intel.com>

> ---
>  .../python/python-3.5-manifest.inc                 | 130 ++++++++++-
> ----------
>  .../python/python3-native_3.5.2.bb                 |   1 -
>  .../python3/020-dont-compile-python-files.patch    |  48 --------
>  meta/recipes-devtools/python/python3_3.5.2.bb      |   1 -
>  scripts/contrib/python/generate-manifest-3.5.py    |  10 ++
>  5 files changed, 75 insertions(+), 115 deletions(-)
>  delete mode 100644 meta/recipes-devtools/python/python3/020-dont-
> compile-python-files.patch
> 
> diff --git a/meta/recipes-devtools/python/python-3.5-manifest.inc
> b/meta/recipes-devtools/python/python-3.5-manifest.inc
> index 3046114..851f12e 100644
> --- a/meta/recipes-devtools/python/python-3.5-manifest.inc
> +++ b/meta/recipes-devtools/python/python-3.5-manifest.inc
> @@ -11,59 +11,59 @@ PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse
> ${PN}-asyncio ${PN}-audio ${PN}-co
>  
>  SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
>  RDEPENDS_${PN}-2to3="${PN}-core"
> -FILES_${PN}-2to3="${libdir}/python3.5/lib2to3 "
> +FILES_${PN}-2to3="${libdir}/python3.5/lib2to3
> ${libdir}/python3.5/lib2to3/__pycache__ "
>  
>  SUMMARY_${PN}-argparse="Python command line argument parser"
>  RDEPENDS_${PN}-argparse="${PN}-core ${PN}-codecs ${PN}-textutils"
> -FILES_${PN}-argparse="${libdir}/python3.5/argparse.* "
> +FILES_${PN}-argparse="${libdir}/python3.5/argparse.*
> ${libdir}/python3.5/__pycache__/argparse.* "
>  
>  SUMMARY_${PN}-asyncio="Python Asynchronous I/O, event loop,
> coroutines and tasks"
>  RDEPENDS_${PN}-asyncio="${PN}-core"
> -FILES_${PN}-asyncio="${libdir}/python3.5/asyncio "
> +FILES_${PN}-asyncio="${libdir}/python3.5/asyncio
> ${libdir}/python3.5/asyncio/__pycache__ "
>  
>  SUMMARY_${PN}-audio="Python Audio Handling"
>  RDEPENDS_${PN}-audio="${PN}-core"
> -FILES_${PN}-audio="${libdir}/python3.5/wave.*
> ${libdir}/python3.5/chunk.* ${libdir}/python3.5/sndhdr.*
> ${libdir}/python3.5/lib-dynload/ossaudiodev.*.so
> ${libdir}/python3.5/lib-dynload/audioop.*.so
> ${libdir}/python3.5/audiodev.* ${libdir}/python3.5/sunaudio.*
> ${libdir}/python3.5/sunau.* ${libdir}/python3.5/toaiff.* "
> +FILES_${PN}-audio="${libdir}/python3.5/wave.*
> ${libdir}/python3.5/__pycache__/wave.* ${libdir}/python3.5/chunk.*
> ${libdir}/python3.5/__pycache__/chunk.* ${libdir}/python3.5/sndhdr.*
> ${libdir}/python3.5/__pycache__/sndhdr.* ${libdir}/python3.5/lib-
> dynload/ossaudiodev.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/ossaudiodev.*.so ${libdir}/python3.5/lib-
> dynload/audioop.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/audioop.*.so ${libdir}/python3.5/audiodev.*
> ${libdir}/python3.5/__pycache__/audiodev.*
> ${libdir}/python3.5/sunaudio.*
> ${libdir}/python3.5/__pycache__/sunaudio.*
> ${libdir}/python3.5/sunau.* ${libdir}/python3.5/__pycache__/sunau.*
> ${libdir}/python3.5/toaiff.* ${libdir}/python3.5/__pycache__/toaiff.*
> "
>  
>  SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
>  RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
> -FILES_${PN}-codecs="${libdir}/python3.5/codecs.*
> ${libdir}/python3.5/encodings ${libdir}/python3.5/gettext.*
> ${libdir}/python3.5/locale.* ${libdir}/python3.5/lib-
> dynload/_locale.*.so ${libdir}/python3.5/lib-dynload/_codecs*
> ${libdir}/python3.5/lib-dynload/_multibytecodec.*.so
> ${libdir}/python3.5/lib-dynload/unicodedata.*.so
> ${libdir}/python3.5/stringprep.* ${libdir}/python3.5/xdrlib.* "
> +FILES_${PN}-codecs="${libdir}/python3.5/codecs.*
> ${libdir}/python3.5/__pycache__/codecs.*
> ${libdir}/python3.5/encodings
> ${libdir}/python3.5/encodings/__pycache__
> ${libdir}/python3.5/gettext.*
> ${libdir}/python3.5/__pycache__/gettext.*
> ${libdir}/python3.5/locale.* ${libdir}/python3.5/__pycache__/locale.*
> ${libdir}/python3.5/lib-dynload/_locale.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_locale.*.so ${libdir}/python3.5/lib-
> dynload/_codecs* ${libdir}/python3.5/lib-dynload/_codecs*/__pycache__ 
> ${libdir}/python3.5/lib-dynload/_multibytecodec.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_multibytecodec.*.so
> ${libdir}/python3.5/lib-dynload/unicodedata.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/unicodedata.*.so
> ${libdir}/python3.5/stringprep.*
> ${libdir}/python3.5/__pycache__/stringprep.*
> ${libdir}/python3.5/xdrlib.* ${libdir}/python3.5/__pycache__/xdrlib.*
> "
>  
>  SUMMARY_${PN}-compile="Python bytecode compilation support"
>  RDEPENDS_${PN}-compile="${PN}-core"
> -FILES_${PN}-compile="${libdir}/python3.5/py_compile.*
> ${libdir}/python3.5/compileall.* "
> +FILES_${PN}-compile="${libdir}/python3.5/py_compile.*
> ${libdir}/python3.5/__pycache__/py_compile.*
> ${libdir}/python3.5/compileall.*
> ${libdir}/python3.5/__pycache__/compileall.* "
>  
>  SUMMARY_${PN}-compression="Python high-level compression support"
>  RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs ${PN}-importlib
> ${PN}-threading ${PN}-shell"
> -FILES_${PN}-compression="${libdir}/python3.5/gzip.*
> ${libdir}/python3.5/zipfile.* ${libdir}/python3.5/tarfile.*
> ${libdir}/python3.5/lib-dynload/bz2.*.so ${libdir}/python3.5/lib-
> dynload/zlib.*.so "
> +FILES_${PN}-compression="${libdir}/python3.5/gzip.*
> ${libdir}/python3.5/__pycache__/gzip.* ${libdir}/python3.5/zipfile.*
> ${libdir}/python3.5/__pycache__/zipfile.*
> ${libdir}/python3.5/tarfile.*
> ${libdir}/python3.5/__pycache__/tarfile.* ${libdir}/python3.5/lib-
> dynload/bz2.*.so ${libdir}/python3.5/lib-dynload/__pycache__/bz2.*.so 
> ${libdir}/python3.5/lib-dynload/zlib.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/zlib.*.so "
>  
>  SUMMARY_${PN}-core="Python interpreter and core modules"
>  RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs
> ${PN}-io ${PN}-math"
> -FILES_${PN}-core="${libdir}/python3.5/__future__.*
> ${libdir}/python3.5/_abcoll.* ${libdir}/python3.5/abc.*
> ${libdir}/python3.5/ast.* ${libdir}/python3.5/copy.*
> ${libdir}/python3.5/copyreg.* ${libdir}/python3.5/configparser.*
> ${libdir}/python3.5/genericpath.* ${libdir}/python3.5/getopt.*
> ${libdir}/python3.5/linecache.* ${libdir}/python3.5/new.*
> ${libdir}/python3.5/os.* ${libdir}/python3.5/posixpath.*
> ${libdir}/python3.5/struct.* ${libdir}/python3.5/warnings.*
> ${libdir}/python3.5/site.* ${libdir}/python3.5/stat.*
> ${libdir}/python3.5/UserDict.* ${libdir}/python3.5/UserList.*
> ${libdir}/python3.5/UserString.* ${libdir}/python3.5/lib-
> dynload/binascii.*.so ${libdir}/python3.5/lib-dynload/_struct.*.so
> ${libdir}/python3.5/lib-dynload/time.*.so ${libdir}/python3.5/lib-
> dynload/xreadlines.*.so ${libdir}/python3.5/types.*
> ${libdir}/python3.5/platform.* ${bindir}/python*
> ${libdir}/python3.5/_weakrefset.* ${libdir}/python3.5/sysconfig.*
> ${libdir}/python3.5/_sysconfigdata.*
> ${libdir}/python3.5/config/Makefile
> ${includedir}/python${PYTHON_BINABI}/pyconfig*.h
> ${libdir}/python${PYTHON_MAJMIN}/collections
> ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.*
> ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.*
> ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
> +FILES_${PN}-core="${libdir}/python3.5/__future__.*
> ${libdir}/python3.5/__pycache__/__future__.*
> ${libdir}/python3.5/_abcoll.*
> ${libdir}/python3.5/__pycache__/_abcoll.* ${libdir}/python3.5/abc.*
> ${libdir}/python3.5/__pycache__/abc.* ${libdir}/python3.5/ast.*
> ${libdir}/python3.5/__pycache__/ast.* ${libdir}/python3.5/copy.*
> ${libdir}/python3.5/__pycache__/copy.* ${libdir}/python3.5/copyreg.*
> ${libdir}/python3.5/__pycache__/copyreg.*
> ${libdir}/python3.5/configparser.*
> ${libdir}/python3.5/__pycache__/configparser.*
> ${libdir}/python3.5/genericpath.*
> ${libdir}/python3.5/__pycache__/genericpath.*
> ${libdir}/python3.5/getopt.* ${libdir}/python3.5/__pycache__/getopt.*
> ${libdir}/python3.5/linecache.*
> ${libdir}/python3.5/__pycache__/linecache.* ${libdir}/python3.5/new.*
> ${libdir}/python3.5/__pycache__/new.* ${libdir}/python3.5/os.*
> ${libdir}/python3.5/__pycache__/os.* ${libdir}/python3.5/posixpath.*
> ${libdir}/python3.5/__pycache__/posixpath.*
> ${libdir}/python3.5/struct.* ${libdir}/python3.5/__pycache__/struct.*
> ${libdir}/python3.5/warnings.*
> ${libdir}/python3.5/__pycache__/warnings.* ${libdir}/python3.5/site.*
> ${libdir}/python3.5/__pycache__/site.* ${libdir}/python3.5/stat.*
> ${libdir}/python3.5/__pycache__/stat.* ${libdir}/python3.5/UserDict.*
> ${libdir}/python3.5/__pycache__/UserDict.*
> ${libdir}/python3.5/UserList.*
> ${libdir}/python3.5/__pycache__/UserList.*
> ${libdir}/python3.5/UserString.*
> ${libdir}/python3.5/__pycache__/UserString.* ${libdir}/python3.5/lib-
> dynload/binascii.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/binascii.*.so ${libdir}/python3.5/lib-
> dynload/_struct.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_struct.*.so ${libdir}/python3.5/lib-
> dynload/time.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/time.*.so ${libdir}/python3.5/lib-
> dynload/xreadlines.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/xreadlines.*.so ${libdir}/python3.5/types.*
> ${libdir}/python3.5/__pycache__/types.*
> ${libdir}/python3.5/platform.*
> ${libdir}/python3.5/__pycache__/platform.* ${bindir}/python*
> ${libdir}/python3.5/_weakrefset.*
> ${libdir}/python3.5/__pycache__/_weakrefset.*
> ${libdir}/python3.5/sysconfig.*
> ${libdir}/python3.5/__pycache__/sysconfig.*
> ${libdir}/python3.5/_sysconfigdata.*
> ${libdir}/python3.5/__pycache__/_sysconfigdata.*
> ${libdir}/python3.5/config/Makefile
> ${libdir}/python3.5/config/Makefile/__pycache__
> ${includedir}/python${PYTHON_BINABI}/pyconfig*.h
> ${libdir}/python${PYTHON_MAJMIN}/collections
> ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.*
> ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.*
> ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
>  
>  SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
>  RDEPENDS_${PN}-crypt="${PN}-core"
> -FILES_${PN}-crypt="${libdir}/python3.5/hashlib.*
> ${libdir}/python3.5/md5.* ${libdir}/python3.5/sha.*
> ${libdir}/python3.5/lib-dynload/crypt.*.so ${libdir}/python3.5/lib-
> dynload/_hashlib.*.so ${libdir}/python3.5/lib-dynload/_sha256.*.so
> ${libdir}/python3.5/lib-dynload/_sha512.*.so "
> +FILES_${PN}-crypt="${libdir}/python3.5/hashlib.*
> ${libdir}/python3.5/__pycache__/hashlib.* ${libdir}/python3.5/md5.*
> ${libdir}/python3.5/__pycache__/md5.* ${libdir}/python3.5/sha.*
> ${libdir}/python3.5/__pycache__/sha.* ${libdir}/python3.5/lib-
> dynload/crypt.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/crypt.*.so ${libdir}/python3.5/lib-
> dynload/_hashlib.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_hashlib.*.so ${libdir}/python3.5/lib-
> dynload/_sha256.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_sha256.*.so ${libdir}/python3.5/lib-
> dynload/_sha512.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_sha512.*.so "
>  
>  SUMMARY_${PN}-ctypes="Python C types support"
>  RDEPENDS_${PN}-ctypes="${PN}-core ${PN}-subprocess"
> -FILES_${PN}-ctypes="${libdir}/python3.5/ctypes
> ${libdir}/python3.5/lib-dynload/_ctypes.*.so ${libdir}/python3.5/lib-
> dynload/_ctypes_test.*.so "
> +FILES_${PN}-ctypes="${libdir}/python3.5/ctypes
> ${libdir}/python3.5/ctypes/__pycache__ ${libdir}/python3.5/lib-
> dynload/_ctypes.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_ctypes.*.so ${libdir}/python3.5/lib-
> dynload/_ctypes_test.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_ctypes_test.*.so "
>  
>  SUMMARY_${PN}-curses="Python curses support"
>  RDEPENDS_${PN}-curses="${PN}-core"
> -FILES_${PN}-curses="${libdir}/python3.5/curses
> ${libdir}/python3.5/lib-dynload/_curses.*.so ${libdir}/python3.5/lib-
> dynload/_curses_panel.*.so "
> +FILES_${PN}-curses="${libdir}/python3.5/curses
> ${libdir}/python3.5/curses/__pycache__ ${libdir}/python3.5/lib-
> dynload/_curses.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_curses.*.so ${libdir}/python3.5/lib-
> dynload/_curses_panel.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_curses_panel.*.so "
>  
>  SUMMARY_${PN}-datetime="Python calendar and time support"
>  RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
> -FILES_${PN}-datetime="${libdir}/python3.5/_strptime.*
> ${libdir}/python3.5/calendar.* ${libdir}/python3.5/datetime.*
> ${libdir}/python3.5/lib-dynload/_datetime.*.so "
> +FILES_${PN}-datetime="${libdir}/python3.5/_strptime.*
> ${libdir}/python3.5/__pycache__/_strptime.*
> ${libdir}/python3.5/calendar.*
> ${libdir}/python3.5/__pycache__/calendar.*
> ${libdir}/python3.5/datetime.*
> ${libdir}/python3.5/__pycache__/datetime.* ${libdir}/python3.5/lib-
> dynload/_datetime.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_datetime.*.so "
>  
>  SUMMARY_${PN}-db="Python file-based database support"
>  RDEPENDS_${PN}-db="${PN}-core"
> -FILES_${PN}-db="${libdir}/python3.5/anydbm.*
> ${libdir}/python3.5/dumbdbm.* ${libdir}/python3.5/whichdb.*
> ${libdir}/python3.5/dbm ${libdir}/python3.5/lib-dynload/_dbm.*.so "
> +FILES_${PN}-db="${libdir}/python3.5/anydbm.*
> ${libdir}/python3.5/__pycache__/anydbm.*
> ${libdir}/python3.5/dumbdbm.*
> ${libdir}/python3.5/__pycache__/dumbdbm.*
> ${libdir}/python3.5/whichdb.*
> ${libdir}/python3.5/__pycache__/whichdb.* ${libdir}/python3.5/dbm
> ${libdir}/python3.5/dbm/__pycache__ ${libdir}/python3.5/lib-
> dynload/_dbm.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_dbm.*.so "
>  
>  SUMMARY_${PN}-debugger="Python debugger"
>  RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re
> ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-
> pkgutil"
> -FILES_${PN}-debugger="${libdir}/python3.5/bdb.*
> ${libdir}/python3.5/pdb.* "
> +FILES_${PN}-debugger="${libdir}/python3.5/bdb.*
> ${libdir}/python3.5/__pycache__/bdb.* ${libdir}/python3.5/pdb.*
> ${libdir}/python3.5/__pycache__/pdb.* "
>  
>  SUMMARY_${PN}-dev="Python development package"
>  RDEPENDS_${PN}-dev="${PN}-core"
> @@ -71,207 +71,207 @@ FILES_${PN}-dev="${includedir}
> ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdi
>  
>  SUMMARY_${PN}-difflib="Python helpers for computing deltas between
> objects"
>  RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
> -FILES_${PN}-difflib="${libdir}/python3.5/difflib.* "
> +FILES_${PN}-difflib="${libdir}/python3.5/difflib.*
> ${libdir}/python3.5/__pycache__/difflib.* "
>  
>  SUMMARY_${PN}-distutils="Python Distribution Utilities"
>  RDEPENDS_${PN}-distutils="${PN}-core ${PN}-email"
> -FILES_${PN}-distutils="${libdir}/python3.5/config
> ${libdir}/python3.5/distutils "
> +FILES_${PN}-distutils="${libdir}/python3.5/config
> ${libdir}/python3.5/config/__pycache__ ${libdir}/python3.5/distutils
> ${libdir}/python3.5/distutils/__pycache__ "
>  
>  SUMMARY_${PN}-distutils-staticdev="Python distribution utilities
> (static libraries)"
>  RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
> -FILES_${PN}-distutils-staticdev="${libdir}/python3.5/config/lib*.a "
> +FILES_${PN}-distutils-staticdev="${libdir}/python3.5/config/lib*.a
> ${libdir}/python3.5/config/__pycache__/lib*.a "
>  
>  SUMMARY_${PN}-doctest="Python framework for running examples in
> docstrings"
>  RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re
> ${PN}-unittest ${PN}-debugger ${PN}-difflib"
> -FILES_${PN}-doctest="${libdir}/python3.5/doctest.* "
> +FILES_${PN}-doctest="${libdir}/python3.5/doctest.*
> ${libdir}/python3.5/__pycache__/doctest.* "
>  
>  SUMMARY_${PN}-email="Python email support"
>  RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-
> audio ${PN}-image ${PN}-netclient"
> -FILES_${PN}-email="${libdir}/python3.5/imaplib.*
> ${libdir}/python3.5/email "
> +FILES_${PN}-email="${libdir}/python3.5/imaplib.*
> ${libdir}/python3.5/__pycache__/imaplib.* ${libdir}/python3.5/email
> ${libdir}/python3.5/email/__pycache__ "
>  
>  SUMMARY_${PN}-enum="Python support for enumerations"
>  RDEPENDS_${PN}-enum="${PN}-core"
> -FILES_${PN}-enum="${libdir}/python3.5/enum.* "
> +FILES_${PN}-enum="${libdir}/python3.5/enum.*
> ${libdir}/python3.5/__pycache__/enum.* "
>  
>  SUMMARY_${PN}-fcntl="Python's fcntl interface"
>  RDEPENDS_${PN}-fcntl="${PN}-core"
> -FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so "
> +FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/fcntl.*.so "
>  
>  SUMMARY_${PN}-gdbm="Python GNU database support"
>  RDEPENDS_${PN}-gdbm="${PN}-core"
> -FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_gdbm.*.so "
> +FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_gdbm.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_gdbm.*.so "
>  
>  SUMMARY_${PN}-html="Python HTML processing support"
>  RDEPENDS_${PN}-html="${PN}-core"
> -FILES_${PN}-html="${libdir}/python3.5/formatter.*
> ${libdir}/python3.5/htmlentitydefs.* ${libdir}/python3.5/htmllib.*
> ${libdir}/python3.5/markupbase.* ${libdir}/python3.5/sgmllib.*
> ${libdir}/python3.5/HTMLParser.* "
> +FILES_${PN}-html="${libdir}/python3.5/formatter.*
> ${libdir}/python3.5/__pycache__/formatter.*
> ${libdir}/python3.5/htmlentitydefs.*
> ${libdir}/python3.5/__pycache__/htmlentitydefs.*
> ${libdir}/python3.5/htmllib.*
> ${libdir}/python3.5/__pycache__/htmllib.*
> ${libdir}/python3.5/markupbase.*
> ${libdir}/python3.5/__pycache__/markupbase.*
> ${libdir}/python3.5/sgmllib.*
> ${libdir}/python3.5/__pycache__/sgmllib.*
> ${libdir}/python3.5/HTMLParser.*
> ${libdir}/python3.5/__pycache__/HTMLParser.* "
>  
>  SUMMARY_${PN}-idle="Python Integrated Development Environment"
>  RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
> -FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib "
> +FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib
> ${libdir}/python3.5/idlelib/__pycache__ "
>  
>  SUMMARY_${PN}-image="Python graphical image handling"
>  RDEPENDS_${PN}-image="${PN}-core"
> -FILES_${PN}-image="${libdir}/python3.5/colorsys.*
> ${libdir}/python3.5/imghdr.* ${libdir}/python3.5/lib-
> dynload/imageop.*.so ${libdir}/python3.5/lib-dynload/rgbimg.*.so "
> +FILES_${PN}-image="${libdir}/python3.5/colorsys.*
> ${libdir}/python3.5/__pycache__/colorsys.*
> ${libdir}/python3.5/imghdr.* ${libdir}/python3.5/__pycache__/imghdr.*
> ${libdir}/python3.5/lib-dynload/imageop.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/imageop.*.so ${libdir}/python3.5/lib-
> dynload/rgbimg.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/rgbimg.*.so "
>  
>  SUMMARY_${PN}-importlib="Python import implementation library"
>  RDEPENDS_${PN}-importlib="${PN}-core ${PN}-lang"
> -FILES_${PN}-importlib="${libdir}/python3.5/importlib "
> +FILES_${PN}-importlib="${libdir}/python3.5/importlib
> ${libdir}/python3.5/importlib/__pycache__ "
>  
>  SUMMARY_${PN}-io="Python low-level I/O"
>  RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
> -FILES_${PN}-io="${libdir}/python3.5/lib-dynload/_socket.*.so
> ${libdir}/python3.5/lib-dynload/_io.*.so ${libdir}/python3.5/lib-
> dynload/_ssl.*.so ${libdir}/python3.5/lib-dynload/select.*.so
> ${libdir}/python3.5/lib-dynload/termios.*.so ${libdir}/python3.5/lib-
> dynload/cStringIO.*.so ${libdir}/python3.5/pipes.*
> ${libdir}/python3.5/socket.* ${libdir}/python3.5/ssl.*
> ${libdir}/python3.5/tempfile.* ${libdir}/python3.5/StringIO.*
> ${libdir}/python3.5/io.* ${libdir}/python3.5/_pyio.* "
> +FILES_${PN}-io="${libdir}/python3.5/lib-dynload/_socket.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_socket.*.so
> ${libdir}/python3.5/lib-dynload/_io.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_io.*.so ${libdir}/python3.5/lib-
> dynload/_ssl.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_ssl.*.so ${libdir}/python3.5/lib-
> dynload/select.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/select.*.so ${libdir}/python3.5/lib-
> dynload/termios.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/termios.*.so ${libdir}/python3.5/lib-
> dynload/cStringIO.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/cStringIO.*.so ${libdir}/python3.5/pipes.*
> ${libdir}/python3.5/__pycache__/pipes.* ${libdir}/python3.5/socket.*
> ${libdir}/python3.5/__pycache__/socket.* ${libdir}/python3.5/ssl.*
> ${libdir}/python3.5/__pycache__/ssl.* ${libdir}/python3.5/tempfile.*
> ${libdir}/python3.5/__pycache__/tempfile.*
> ${libdir}/python3.5/StringIO.*
> ${libdir}/python3.5/__pycache__/StringIO.* ${libdir}/python3.5/io.*
> ${libdir}/python3.5/__pycache__/io.* ${libdir}/python3.5/_pyio.*
> ${libdir}/python3.5/__pycache__/_pyio.* "
>  
>  SUMMARY_${PN}-json="Python JSON support"
>  RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
> -FILES_${PN}-json="${libdir}/python3.5/json ${libdir}/python3.5/lib-
> dynload/_json.*.so "
> +FILES_${PN}-json="${libdir}/python3.5/json
> ${libdir}/python3.5/json/__pycache__ ${libdir}/python3.5/lib-
> dynload/_json.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_json.*.so "
>  
>  SUMMARY_${PN}-lang="Python low-level language support"
>  RDEPENDS_${PN}-lang="${PN}-core ${PN}-importlib"
> -FILES_${PN}-lang="${libdir}/python3.5/lib-dynload/_bisect.*.so
> ${libdir}/python3.5/lib-dynload/_collections.*.so
> ${libdir}/python3.5/lib-dynload/_heapq.*.so ${libdir}/python3.5/lib-
> dynload/_weakref.*.so ${libdir}/python3.5/lib-dynload/_functools.*.so 
> ${libdir}/python3.5/lib-dynload/array.*.so ${libdir}/python3.5/lib-
> dynload/itertools.*.so ${libdir}/python3.5/lib-dynload/operator.*.so
> ${libdir}/python3.5/lib-dynload/parser.*.so
> ${libdir}/python3.5/atexit.* ${libdir}/python3.5/bisect.*
> ${libdir}/python3.5/code.* ${libdir}/python3.5/codeop.*
> ${libdir}/python3.5/collections.*
> ${libdir}/python3.5/_collections_abc.*
> ${libdir}/python3.5/contextlib.* ${libdir}/python3.5/dis.*
> ${libdir}/python3.5/functools.* ${libdir}/python3.5/heapq.*
> ${libdir}/python3.5/inspect.* ${libdir}/python3.5/keyword.*
> ${libdir}/python3.5/opcode.* ${libdir}/python3.5/operator.*
> ${libdir}/python3.5/symbol.* ${libdir}/python3.5/repr.*
> ${libdir}/python3.5/token.* ${libdir}/python3.5/tokenize.*
> ${libdir}/python3.5/traceback.* ${libdir}/python3.5/weakref.* "
> +FILES_${PN}-lang="${libdir}/python3.5/lib-dynload/_bisect.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_bisect.*.so
> ${libdir}/python3.5/lib-dynload/_collections.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_collections.*.so
> ${libdir}/python3.5/lib-dynload/_heapq.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_heapq.*.so ${libdir}/python3.5/lib-
> dynload/_weakref.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_weakref.*.so ${libdir}/python3.5/lib-
> dynload/_functools.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_functools.*.so ${libdir}/python3.5/lib-
> dynload/array.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/array.*.so ${libdir}/python3.5/lib-
> dynload/itertools.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/itertools.*.so ${libdir}/python3.5/lib-
> dynload/operator.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/operator.*.so ${libdir}/python3.5/lib-
> dynload/parser.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/parser.*.so ${libdir}/python3.5/atexit.*
> ${libdir}/python3.5/__pycache__/atexit.* ${libdir}/python3.5/bisect.*
> ${libdir}/python3.5/__pycache__/bisect.* ${libdir}/python3.5/code.*
> ${libdir}/python3.5/__pycache__/code.* ${libdir}/python3.5/codeop.*
> ${libdir}/python3.5/__pycache__/codeop.*
> ${libdir}/python3.5/collections.*
> ${libdir}/python3.5/__pycache__/collections.*
> ${libdir}/python3.5/_collections_abc.*
> ${libdir}/python3.5/__pycache__/_collections_abc.*
> ${libdir}/python3.5/contextlib.*
> ${libdir}/python3.5/__pycache__/contextlib.*
> ${libdir}/python3.5/dis.* ${libdir}/python3.5/__pycache__/dis.*
> ${libdir}/python3.5/functools.*
> ${libdir}/python3.5/__pycache__/functools.*
> ${libdir}/python3.5/heapq.* ${libdir}/python3.5/__pycache__/heapq.*
> ${libdir}/python3.5/inspect.*
> ${libdir}/python3.5/__pycache__/inspect.*
> ${libdir}/python3.5/keyword.*
> ${libdir}/python3.5/__pycache__/keyword.*
> ${libdir}/python3.5/opcode.* ${libdir}/python3.5/__pycache__/opcode.*
> ${libdir}/python3.5/operator.*
> ${libdir}/python3.5/__pycache__/operator.*
> ${libdir}/python3.5/symbol.* ${libdir}/python3.5/__pycache__/symbol.*
> ${libdir}/python3.5/repr.* ${libdir}/python3.5/__pycache__/repr.*
> ${libdir}/python3.5/token.* ${libdir}/python3.5/__pycache__/token.*
> ${libdir}/python3.5/tokenize.*
> ${libdir}/python3.5/__pycache__/tokenize.*
> ${libdir}/python3.5/traceback.*
> ${libdir}/python3.5/__pycache__/traceback.*
> ${libdir}/python3.5/weakref.*
> ${libdir}/python3.5/__pycache__/weakref.* "
>  
>  SUMMARY_${PN}-logging="Python logging support"
>  RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle
> ${PN}-stringold"
> -FILES_${PN}-logging="${libdir}/python3.5/logging "
> +FILES_${PN}-logging="${libdir}/python3.5/logging
> ${libdir}/python3.5/logging/__pycache__ "
>  
>  SUMMARY_${PN}-mailbox="Python mailbox format support"
>  RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
> -FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.* "
> +FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.*
> ${libdir}/python3.5/__pycache__/mailbox.* "
>  
>  SUMMARY_${PN}-math="Python math support"
>  RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
> -FILES_${PN}-math="${libdir}/python3.5/lib-dynload/cmath.*.so
> ${libdir}/python3.5/lib-dynload/math.*.so ${libdir}/python3.5/lib-
> dynload/_random.*.so ${libdir}/python3.5/random.*
> ${libdir}/python3.5/sets.* "
> +FILES_${PN}-math="${libdir}/python3.5/lib-dynload/cmath.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/cmath.*.so
> ${libdir}/python3.5/lib-dynload/math.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/math.*.so ${libdir}/python3.5/lib-
> dynload/_random.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_random.*.so ${libdir}/python3.5/random.*
> ${libdir}/python3.5/__pycache__/random.* ${libdir}/python3.5/sets.*
> ${libdir}/python3.5/__pycache__/sets.* "
>  
>  SUMMARY_${PN}-mime="Python MIME handling APIs"
>  RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
> -FILES_${PN}-mime="${libdir}/python3.5/mimetools.*
> ${libdir}/python3.5/uu.* ${libdir}/python3.5/quopri.*
> ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/MimeWriter.* "
> +FILES_${PN}-mime="${libdir}/python3.5/mimetools.*
> ${libdir}/python3.5/__pycache__/mimetools.* ${libdir}/python3.5/uu.*
> ${libdir}/python3.5/__pycache__/uu.* ${libdir}/python3.5/quopri.*
> ${libdir}/python3.5/__pycache__/quopri.* ${libdir}/python3.5/rfc822.*
> ${libdir}/python3.5/__pycache__/rfc822.*
> ${libdir}/python3.5/MimeWriter.*
> ${libdir}/python3.5/__pycache__/MimeWriter.* "
>  
>  SUMMARY_${PN}-mmap="Python memory-mapped file support"
>  RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
> -FILES_${PN}-mmap="${libdir}/python3.5/lib-dynload/mmap.*.so "
> +FILES_${PN}-mmap="${libdir}/python3.5/lib-dynload/mmap.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/mmap.*.so "
>  
>  SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
>  RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang
> ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
> -FILES_${PN}-multiprocessing="${libdir}/python3.5/lib-
> dynload/_multiprocessing.*.so ${libdir}/python3.5/multiprocessing "
> +FILES_${PN}-multiprocessing="${libdir}/python3.5/lib-
> dynload/_multiprocessing.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_multiprocessing.*.so
> ${libdir}/python3.5/multiprocessing
> ${libdir}/python3.5/multiprocessing/__pycache__ "
>  
>  SUMMARY_${PN}-netclient="Python Internet Protocol clients"
>  RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime
> ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
> -FILES_${PN}-netclient="${libdir}/python3.5/*Cookie*.*
> ${libdir}/python3.5/base64.* ${libdir}/python3.5/cookielib.*
> ${libdir}/python3.5/ftplib.* ${libdir}/python3.5/gopherlib.*
> ${libdir}/python3.5/hmac.* ${libdir}/python3.5/httplib.*
> ${libdir}/python3.5/mimetypes.* ${libdir}/python3.5/nntplib.*
> ${libdir}/python3.5/poplib.* ${libdir}/python3.5/smtplib.*
> ${libdir}/python3.5/telnetlib.* ${libdir}/python3.5/urllib
> ${libdir}/python3.5/uuid.* ${libdir}/python3.5/rfc822.*
> ${libdir}/python3.5/mimetools.* "
> +FILES_${PN}-netclient="${libdir}/python3.5/*Cookie*.*
> ${libdir}/python3.5/__pycache__/*Cookie*.*
> ${libdir}/python3.5/base64.* ${libdir}/python3.5/__pycache__/base64.*
> ${libdir}/python3.5/cookielib.*
> ${libdir}/python3.5/__pycache__/cookielib.*
> ${libdir}/python3.5/ftplib.* ${libdir}/python3.5/__pycache__/ftplib.*
> ${libdir}/python3.5/gopherlib.*
> ${libdir}/python3.5/__pycache__/gopherlib.*
> ${libdir}/python3.5/hmac.* ${libdir}/python3.5/__pycache__/hmac.*
> ${libdir}/python3.5/httplib.*
> ${libdir}/python3.5/__pycache__/httplib.*
> ${libdir}/python3.5/mimetypes.*
> ${libdir}/python3.5/__pycache__/mimetypes.*
> ${libdir}/python3.5/nntplib.*
> ${libdir}/python3.5/__pycache__/nntplib.*
> ${libdir}/python3.5/poplib.* ${libdir}/python3.5/__pycache__/poplib.*
> ${libdir}/python3.5/smtplib.*
> ${libdir}/python3.5/__pycache__/smtplib.*
> ${libdir}/python3.5/telnetlib.*
> ${libdir}/python3.5/__pycache__/telnetlib.*
> ${libdir}/python3.5/urllib ${libdir}/python3.5/urllib/__pycache__
> ${libdir}/python3.5/uuid.* ${libdir}/python3.5/__pycache__/uuid.*
> ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/__pycache__/rfc822.*
> ${libdir}/python3.5/mimetools.*
> ${libdir}/python3.5/__pycache__/mimetools.* "
>  
>  SUMMARY_${PN}-netserver="Python Internet Protocol servers"
>  RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell
> ${PN}-threading"
> -FILES_${PN}-netserver="${libdir}/python3.5/cgi.*
> ${libdir}/python3.5/*HTTPServer.* ${libdir}/python3.5/SocketServer.*
> "
> +FILES_${PN}-netserver="${libdir}/python3.5/cgi.*
> ${libdir}/python3.5/__pycache__/cgi.*
> ${libdir}/python3.5/*HTTPServer.*
> ${libdir}/python3.5/__pycache__/*HTTPServer.*
> ${libdir}/python3.5/SocketServer.*
> ${libdir}/python3.5/__pycache__/SocketServer.* "
>  
>  SUMMARY_${PN}-numbers="Python number APIs"
>  RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
> -FILES_${PN}-numbers="${libdir}/python3.5/decimal.*
> ${libdir}/python3.5/fractions.* ${libdir}/python3.5/numbers.* "
> +FILES_${PN}-numbers="${libdir}/python3.5/decimal.*
> ${libdir}/python3.5/__pycache__/decimal.*
> ${libdir}/python3.5/fractions.*
> ${libdir}/python3.5/__pycache__/fractions.*
> ${libdir}/python3.5/numbers.*
> ${libdir}/python3.5/__pycache__/numbers.* "
>  
>  SUMMARY_${PN}-pickle="Python serialisation/persistence support"
>  RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
> -FILES_${PN}-pickle="${libdir}/python3.5/pickle.*
> ${libdir}/python3.5/shelve.* ${libdir}/python3.5/lib-
> dynload/cPickle.*.so ${libdir}/python3.5/pickletools.* "
> +FILES_${PN}-pickle="${libdir}/python3.5/pickle.*
> ${libdir}/python3.5/__pycache__/pickle.* ${libdir}/python3.5/shelve.*
> ${libdir}/python3.5/__pycache__/shelve.* ${libdir}/python3.5/lib-
> dynload/cPickle.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/cPickle.*.so ${libdir}/python3.5/pickletools.*
> ${libdir}/python3.5/__pycache__/pickletools.* "
>  
>  SUMMARY_${PN}-pkgutil="Python package extension utility support"
>  RDEPENDS_${PN}-pkgutil="${PN}-core"
> -FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.* "
> +FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.*
> ${libdir}/python3.5/__pycache__/pkgutil.* "
>  
>  SUMMARY_${PN}-pprint="Python pretty-print support"
>  RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
> -FILES_${PN}-pprint="${libdir}/python3.5/pprint.* "
> +FILES_${PN}-pprint="${libdir}/python3.5/pprint.*
> ${libdir}/python3.5/__pycache__/pprint.* "
>  
>  SUMMARY_${PN}-profile="Python basic performance profiling support"
>  RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
> -FILES_${PN}-profile="${libdir}/python3.5/profile.*
> ${libdir}/python3.5/pstats.* ${libdir}/python3.5/cProfile.*
> ${libdir}/python3.5/lib-dynload/_lsprof.*.so "
> +FILES_${PN}-profile="${libdir}/python3.5/profile.*
> ${libdir}/python3.5/__pycache__/profile.*
> ${libdir}/python3.5/pstats.* ${libdir}/python3.5/__pycache__/pstats.*
> ${libdir}/python3.5/cProfile.*
> ${libdir}/python3.5/__pycache__/cProfile.* ${libdir}/python3.5/lib-
> dynload/_lsprof.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_lsprof.*.so "
>  
>  SUMMARY_${PN}-pydoc="Python interactive help support"
>  RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-
> re"
> -FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.5/pydoc.*
> ${libdir}/python3.5/pydoc_data "
> +FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.5/pydoc.*
> ${libdir}/python3.5/__pycache__/pydoc.*
> ${libdir}/python3.5/pydoc_data
> ${libdir}/python3.5/pydoc_data/__pycache__ "
>  
>  SUMMARY_${PN}-re="Python Regular Expression APIs"
>  RDEPENDS_${PN}-re="${PN}-core"
> -FILES_${PN}-re="${libdir}/python3.5/re.* ${libdir}/python3.5/sre.*
> ${libdir}/python3.5/sre_compile.* ${libdir}/python3.5/sre_constants*
> ${libdir}/python3.5/sre_parse.* "
> +FILES_${PN}-re="${libdir}/python3.5/re.*
> ${libdir}/python3.5/__pycache__/re.* ${libdir}/python3.5/sre.*
> ${libdir}/python3.5/__pycache__/sre.*
> ${libdir}/python3.5/sre_compile.*
> ${libdir}/python3.5/__pycache__/sre_compile.*
> ${libdir}/python3.5/sre_constants*
> ${libdir}/python3.5/sre_constants*/__pycache__
> ${libdir}/python3.5/sre_parse.*
> ${libdir}/python3.5/__pycache__/sre_parse.* "
>  
>  SUMMARY_${PN}-readline="Python readline support"
>  RDEPENDS_${PN}-readline="${PN}-core"
> -FILES_${PN}-readline="${libdir}/python3.5/lib-dynload/readline.*.so
> ${libdir}/python3.5/rlcompleter.* "
> +FILES_${PN}-readline="${libdir}/python3.5/lib-dynload/readline.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/readline.*.so
> ${libdir}/python3.5/rlcompleter.*
> ${libdir}/python3.5/__pycache__/rlcompleter.* "
>  
>  SUMMARY_${PN}-reprlib="Python alternate repr() implementation"
>  RDEPENDS_${PN}-reprlib="${PN}-core"
> -FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py "
> +FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py
> ${libdir}/python3.5/__pycache__/reprlib.py "
>  
>  SUMMARY_${PN}-resource="Python resource control interface"
>  RDEPENDS_${PN}-resource="${PN}-core"
> -FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so
> "
> +FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/resource.*.so "
>  
>  SUMMARY_${PN}-selectors="Python High-level I/O multiplexing"
>  RDEPENDS_${PN}-selectors="${PN}-core"
> -FILES_${PN}-selectors="${libdir}/python3.5/selectors.* "
> +FILES_${PN}-selectors="${libdir}/python3.5/selectors.*
> ${libdir}/python3.5/__pycache__/selectors.* "
>  
>  SUMMARY_${PN}-shell="Python shell-like functionality"
>  RDEPENDS_${PN}-shell="${PN}-core ${PN}-re ${PN}-compression"
> -FILES_${PN}-shell="${libdir}/python3.5/cmd.*
> ${libdir}/python3.5/commands.* ${libdir}/python3.5/dircache.*
> ${libdir}/python3.5/fnmatch.* ${libdir}/python3.5/glob.*
> ${libdir}/python3.5/popen2.* ${libdir}/python3.5/shlex.*
> ${libdir}/python3.5/shutil.* "
> +FILES_${PN}-shell="${libdir}/python3.5/cmd.*
> ${libdir}/python3.5/__pycache__/cmd.* ${libdir}/python3.5/commands.*
> ${libdir}/python3.5/__pycache__/commands.*
> ${libdir}/python3.5/dircache.*
> ${libdir}/python3.5/__pycache__/dircache.*
> ${libdir}/python3.5/fnmatch.*
> ${libdir}/python3.5/__pycache__/fnmatch.* ${libdir}/python3.5/glob.*
> ${libdir}/python3.5/__pycache__/glob.* ${libdir}/python3.5/popen2.*
> ${libdir}/python3.5/__pycache__/popen2.* ${libdir}/python3.5/shlex.*
> ${libdir}/python3.5/__pycache__/shlex.* ${libdir}/python3.5/shutil.*
> ${libdir}/python3.5/__pycache__/shutil.* "
>  
>  SUMMARY_${PN}-signal="Python set handlers for asynchronous events
> support"
>  RDEPENDS_${PN}-signal="${PN}-core ${PN}-enum"
> -FILES_${PN}-signal="${libdir}/python3.5/signal.* "
> +FILES_${PN}-signal="${libdir}/python3.5/signal.*
> ${libdir}/python3.5/__pycache__/signal.* "
>  
>  SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
>  RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-
> mime"
> -FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.5/smtpd.* "
> +FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.5/smtpd.*
> ${libdir}/python3.5/__pycache__/smtpd.* "
>  
>  SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
>  RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-
> crypt ${PN}-io ${PN}-threading"
> -FILES_${PN}-sqlite3="${libdir}/python3.5/lib-dynload/_sqlite3.*.so
> ${libdir}/python3.5/sqlite3/dbapi2.*
> ${libdir}/python3.5/sqlite3/__init__.*
> ${libdir}/python3.5/sqlite3/dump.* "
> +FILES_${PN}-sqlite3="${libdir}/python3.5/lib-dynload/_sqlite3.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_sqlite3.*.so
> ${libdir}/python3.5/sqlite3/dbapi2.*
> ${libdir}/python3.5/sqlite3/__pycache__/dbapi2.*
> ${libdir}/python3.5/sqlite3/__init__.*
> ${libdir}/python3.5/sqlite3/__pycache__/__init__.*
> ${libdir}/python3.5/sqlite3/dump.*
> ${libdir}/python3.5/sqlite3/__pycache__/dump.* "
>  
>  SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
>  RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
> -FILES_${PN}-sqlite3-tests="${libdir}/python3.5/sqlite3/test "
> +FILES_${PN}-sqlite3-tests="${libdir}/python3.5/sqlite3/test
> ${libdir}/python3.5/sqlite3/test/__pycache__ "
>  
>  SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
>  RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
> -FILES_${PN}-stringold="${libdir}/python3.5/lib-dynload/strop.*.so
> ${libdir}/python3.5/string.* ${libdir}/python3.5/stringold.* "
> +FILES_${PN}-stringold="${libdir}/python3.5/lib-dynload/strop.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/strop.*.so
> ${libdir}/python3.5/string.* ${libdir}/python3.5/__pycache__/string.*
> ${libdir}/python3.5/stringold.*
> ${libdir}/python3.5/__pycache__/stringold.* "
>  
>  SUMMARY_${PN}-subprocess="Python subprocess support"
>  RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl
> ${PN}-pickle ${PN}-threading ${PN}-signal ${PN}-selectors"
> -FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.*
> ${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so "
> +FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.*
> ${libdir}/python3.5/__pycache__/subprocess.* ${libdir}/python3.5/lib-
> dynload/_posixsubprocess.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/_posixsubprocess.*.so "
>  
>  SUMMARY_${PN}-syslog="Python syslog interface"
>  RDEPENDS_${PN}-syslog="${PN}-core"
> -FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/syslog.*.so "
> +FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/syslog.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/syslog.*.so "
>  
>  SUMMARY_${PN}-terminal="Python terminal controlling support"
>  RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
> -FILES_${PN}-terminal="${libdir}/python3.5/pty.*
> ${libdir}/python3.5/tty.* "
> +FILES_${PN}-terminal="${libdir}/python3.5/pty.*
> ${libdir}/python3.5/__pycache__/pty.* ${libdir}/python3.5/tty.*
> ${libdir}/python3.5/__pycache__/tty.* "
>  
>  SUMMARY_${PN}-tests="Python tests"
>  RDEPENDS_${PN}-tests="${PN}-core"
> -FILES_${PN}-tests="${libdir}/python3.5/test "
> +FILES_${PN}-tests="${libdir}/python3.5/test
> ${libdir}/python3.5/test/__pycache__ "
>  
>  SUMMARY_${PN}-textutils="Python option parsing, text wrapping and
> CSV support"
>  RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-
> stringold"
> -FILES_${PN}-textutils="${libdir}/python3.5/lib-dynload/_csv.*.so
> ${libdir}/python3.5/csv.* ${libdir}/python3.5/optparse.*
> ${libdir}/python3.5/textwrap.* "
> +FILES_${PN}-textutils="${libdir}/python3.5/lib-dynload/_csv.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_csv.*.so
> ${libdir}/python3.5/csv.* ${libdir}/python3.5/__pycache__/csv.*
> ${libdir}/python3.5/optparse.*
> ${libdir}/python3.5/__pycache__/optparse.*
> ${libdir}/python3.5/textwrap.*
> ${libdir}/python3.5/__pycache__/textwrap.* "
>  
>  SUMMARY_${PN}-threading="Python threading & synchronization support"
>  RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
> -FILES_${PN}-threading="${libdir}/python3.5/_threading_local.*
> ${libdir}/python3.5/dummy_thread.*
> ${libdir}/python3.5/dummy_threading.* ${libdir}/python3.5/mutex.*
> ${libdir}/python3.5/threading.* ${libdir}/python3.5/queue.* "
> +FILES_${PN}-threading="${libdir}/python3.5/_threading_local.*
> ${libdir}/python3.5/__pycache__/_threading_local.*
> ${libdir}/python3.5/dummy_thread.*
> ${libdir}/python3.5/__pycache__/dummy_thread.*
> ${libdir}/python3.5/dummy_threading.*
> ${libdir}/python3.5/__pycache__/dummy_threading.*
> ${libdir}/python3.5/mutex.* ${libdir}/python3.5/__pycache__/mutex.*
> ${libdir}/python3.5/threading.*
> ${libdir}/python3.5/__pycache__/threading.*
> ${libdir}/python3.5/queue.* ${libdir}/python3.5/__pycache__/queue.* "
>  
>  SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
>  RDEPENDS_${PN}-tkinter="${PN}-core"
> -FILES_${PN}-tkinter="${libdir}/python3.5/lib-dynload/_tkinter.*.so
> ${libdir}/python3.5/lib-tk ${libdir}/python3.5/tkinter "
> +FILES_${PN}-tkinter="${libdir}/python3.5/lib-dynload/_tkinter.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_tkinter.*.so
> ${libdir}/python3.5/lib-tk ${libdir}/python3.5/lib-tk/__pycache__
> ${libdir}/python3.5/tkinter ${libdir}/python3.5/tkinter/__pycache__ "
>  
>  SUMMARY_${PN}-unittest="Python unit testing framework"
>  RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang
> ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
> -FILES_${PN}-unittest="${libdir}/python3.5/unittest/ "
> +FILES_${PN}-unittest="${libdir}/python3.5/unittest/
> ${libdir}/python3.5/unittest/__pycache__ "
>  
>  SUMMARY_${PN}-unixadmin="Python Unix administration support"
>  RDEPENDS_${PN}-unixadmin="${PN}-core"
> -FILES_${PN}-unixadmin="${libdir}/python3.5/lib-dynload/nis.*.so
> ${libdir}/python3.5/lib-dynload/grp.*.so ${libdir}/python3.5/lib-
> dynload/pwd.*.so ${libdir}/python3.5/getpass.* "
> +FILES_${PN}-unixadmin="${libdir}/python3.5/lib-dynload/nis.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/nis.*.so
> ${libdir}/python3.5/lib-dynload/grp.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/grp.*.so ${libdir}/python3.5/lib-dynload/pwd.*.so 
> ${libdir}/python3.5/lib-dynload/__pycache__/pwd.*.so
> ${libdir}/python3.5/getpass.*
> ${libdir}/python3.5/__pycache__/getpass.* "
>  
>  SUMMARY_${PN}-xml="Python basic XML support"
>  RDEPENDS_${PN}-xml="${PN}-core ${PN}-re"
> -FILES_${PN}-xml="${libdir}/python3.5/lib-dynload/_elementtree.*.so
> ${libdir}/python3.5/lib-dynload/pyexpat.*.so ${libdir}/python3.5/xml
> ${libdir}/python3.5/xmllib.* "
> +FILES_${PN}-xml="${libdir}/python3.5/lib-dynload/_elementtree.*.so
> ${libdir}/python3.5/lib-dynload/__pycache__/_elementtree.*.so
> ${libdir}/python3.5/lib-dynload/pyexpat.*.so ${libdir}/python3.5/lib-
> dynload/__pycache__/pyexpat.*.so ${libdir}/python3.5/xml
> ${libdir}/python3.5/xml/__pycache__ ${libdir}/python3.5/xmllib.*
> ${libdir}/python3.5/__pycache__/xmllib.* "
>  
>  SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
>  RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-
> lang"
> -FILES_${PN}-xmlrpc="${libdir}/python3.5/xmlrpclib.*
> ${libdir}/python3.5/SimpleXMLRPCServer.*
> ${libdir}/python3.5/DocXMLRPCServer.* ${libdir}/python3.5/xmlrpc "
> +FILES_${PN}-xmlrpc="${libdir}/python3.5/xmlrpclib.*
> ${libdir}/python3.5/__pycache__/xmlrpclib.*
> ${libdir}/python3.5/SimpleXMLRPCServer.*
> ${libdir}/python3.5/__pycache__/SimpleXMLRPCServer.*
> ${libdir}/python3.5/DocXMLRPCServer.*
> ${libdir}/python3.5/__pycache__/DocXMLRPCServer.*
> ${libdir}/python3.5/xmlrpc ${libdir}/python3.5/xmlrpc/__pycache__ "
>  
>  SUMMARY_${PN}-modules="All Python modules"
>  RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-asyncio
> ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core
> ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-
> debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email
> ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image
> ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-
> mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-
> netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil
> ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-
> reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal
> ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-
> subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils
> ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-
> xml ${PN}-xmlrpc  "
> diff --git a/meta/recipes-devtools/python/python3-native_3.5.2.bb
> b/meta/recipes-devtools/python/python3-native_3.5.2.bb
> index 594f15c..4498454 100644
> --- a/meta/recipes-devtools/python/python3-native_3.5.2.bb
> +++ b/meta/recipes-devtools/python/python3-native_3.5.2.bb
> @@ -8,7 +8,6 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Pyt
> hon-${PV}.tar.xz \
>  file://12-distutils-prefix-is-inside-staging-area.patch \
>  file://python-config.patch \
>  file://000-cross-compile.patch \
> -file://020-dont-compile-python-files.patch \
>  file://030-fixup-include-dirs.patch \
>  file://070-dont-clean-ipkg-install.patch \
>  file://080-distutils-dont_adjust_files.patch \
> diff --git a/meta/recipes-devtools/python/python3/020-dont-compile-
> python-files.patch b/meta/recipes-devtools/python/python3/020-dont-
> compile-python-files.patch
> deleted file mode 100644
> index 819ba69..0000000
> --- a/meta/recipes-devtools/python/python3/020-dont-compile-python-
> files.patch
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -Dont cross compile site packages
> -
> --Khem
> -
> -Upstream-Status: Inappropriate[Embedded-Specific]
> -
> ----
> - Makefile.pre.in |   16 ----------------
> - 1 file changed, 16 deletions(-)
> -
> -Index: Python-3.5.0/Makefile.pre.in
> -===================================================================
> ---- Python-3.5.0.orig/Makefile.pre.in
> -+++ Python-3.5.0/Makefile.pre.in
> -@@ -1262,33 +1262,6 @@ libinstall:	build_all
> $(srcdir)/Lib/$(PL
> - 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
> - 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
> - 	fi
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST) -f \
> --		-x 'bad_coding|badsyntax|site-
> packages|lib2to3/tests/data' \
> --		$(DESTDIR)$(LIBDEST)
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi -O
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST) -f \
> --		-x 'bad_coding|badsyntax|site-
> packages|lib2to3/tests/data' \
> --		$(DESTDIR)$(LIBDEST)
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi -OO
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST) -f \
> --		-x 'bad_coding|badsyntax|site-
> packages|lib2to3/tests/data' \
> --		$(DESTDIR)$(LIBDEST)
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST)/site-packages -f \
> --		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi -O
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST)/site-packages -f \
> --		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
> --	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> --		$(PYTHON_FOR_BUILD) -Wi -OO
> $(DESTDIR)$(LIBDEST)/compileall.py \
> --		-d $(LIBDEST)/site-packages -f \
> --		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
> - 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> - 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver
> $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
> - 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
> diff --git a/meta/recipes-devtools/python/python3_3.5.2.bb
> b/meta/recipes-devtools/python/python3_3.5.2.bb
> index e6cbb9c..bde9c95 100644
> --- a/meta/recipes-devtools/python/python3_3.5.2.bb
> +++ b/meta/recipes-devtools/python/python3_3.5.2.bb
> @@ -9,7 +9,6 @@ DISTRO_SRC_URI_linuxstdbase = ""
>  SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.x
> z \
>  file://python-config.patch \
>  file://000-cross-compile.patch \
> -file://020-dont-compile-python-files.patch \
>  file://030-fixup-include-dirs.patch \
>  file://070-dont-clean-ipkg-install.patch \
>  file://080-distutils-dont_adjust_files.patch \
> diff --git a/scripts/contrib/python/generate-manifest-3.5.py
> b/scripts/contrib/python/generate-manifest-3.5.py
> index 2906cc6..897768f 100755
> --- a/scripts/contrib/python/generate-manifest-3.5.py
> +++ b/scripts/contrib/python/generate-manifest-3.5.py
> @@ -59,10 +59,20 @@ class MakefileMaker:
>          for filename in filenames:
>              if filename[0] != "$":
>                  fullFilenames.append( "%s%s" % ( self.targetPrefix,
> filename ) )
> +                fullFilenames.append( "%s%s" % ( self.targetPrefix,
> +                                                 self.pycachePath(
> filename ) ) )
>              else:
>                  fullFilenames.append( filename )
>          self.packages[name] = description, dependencies,
> fullFilenames
>  
> +    def pycachePath( self, filename ):
> +        dirname = os.path.dirname( filename )
> +        basename = os.path.basename( filename )
> +        if '.' in basename:
> +            return os.path.join( dirname, '__pycache__', basename )
> +        else:
> +            return os.path.join( dirname, basename, '__pycache__' )
> +
>      def doBody( self ):
>          """generate body of Makefile"""
>  
> -- 
> 2.10.1
> 


^ permalink raw reply

* [PATCH][krogoth 11/12] curl: CVE-2016-8625
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

IDNA 2003 makes curl use wrong host

Affected versions: curl 7.12.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102K.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8625.patch | 615 +++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |   1 +
 2 files changed, 616 insertions(+)
 create mode 100755 meta/recipes-support/curl/curl/CVE-2016-8625.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8625.patch b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
new file mode 100755
index 0000000..b618277
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
@@ -0,0 +1,615 @@
+commit 914aae739463ec72340130ea9ad42e04b02a5338
+Author: Daniel Stenberg <daniel@haxx.se>
+Date:   Wed Oct 12 09:01:06 2016 +0200
+
+idn: switch to libidn2 use and IDNA2008 support
+
+CVE: CVE-2016-8625
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102K.html
+Reported-by: Christian Heimes
+
+Conflicts:
+	CMakeLists.txt
+	lib/url.c
+
+Signed-off-by: Martin Borg <martin.borg@enea.com>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 06f18cf..c3e5c7c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -440,7 +440,7 @@ if(NOT CURL_DISABLE_LDAPS)
+ endif()
+ 
+ # Check for idn
+-check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
++check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+ 
+ # Check for symbol dlopen (same as HAVE_LIBDL)
+ check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
+@@ -608,7 +608,7 @@ check_include_file_concat("des.h"            HAVE_DES_H)
+ check_include_file_concat("err.h"            HAVE_ERR_H)
+ check_include_file_concat("errno.h"          HAVE_ERRNO_H)
+ check_include_file_concat("fcntl.h"          HAVE_FCNTL_H)
+-check_include_file_concat("idn-free.h"       HAVE_IDN_FREE_H)
++check_include_file_concat("idn2.h"           HAVE_IDN2_H)
+ check_include_file_concat("ifaddrs.h"        HAVE_IFADDRS_H)
+ check_include_file_concat("io.h"             HAVE_IO_H)
+ check_include_file_concat("krb.h"            HAVE_KRB_H)
+@@ -638,7 +638,6 @@ check_include_file_concat("stropts.h"        HAVE_STROPTS_H)
+ check_include_file_concat("termio.h"         HAVE_TERMIO_H)
+ check_include_file_concat("termios.h"        HAVE_TERMIOS_H)
+ check_include_file_concat("time.h"           HAVE_TIME_H)
+-check_include_file_concat("tld.h"            HAVE_TLD_H)
+ check_include_file_concat("unistd.h"         HAVE_UNISTD_H)
+ check_include_file_concat("utime.h"          HAVE_UTIME_H)
+ check_include_file_concat("x509.h"           HAVE_X509_H)
+@@ -652,9 +651,6 @@ check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
+ check_include_file_concat("stdint.h"        HAVE_STDINT_H)
+ check_include_file_concat("sockio.h"        HAVE_SOCKIO_H)
+ check_include_file_concat("sys/utsname.h"   HAVE_SYS_UTSNAME_H)
+-check_include_file_concat("idna.h"          HAVE_IDNA_H)
+-
+-
+ 
+ check_type_size(size_t  SIZEOF_SIZE_T)
+ check_type_size(ssize_t  SIZEOF_SSIZE_T)
+@@ -802,9 +798,6 @@ check_symbol_exists(pipe           "${CURL_INCLUDES}" HAVE_PIPE)
+ check_symbol_exists(ftruncate      "${CURL_INCLUDES}" HAVE_FTRUNCATE)
+ check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
+ check_symbol_exists(getrlimit      "${CURL_INCLUDES}" HAVE_GETRLIMIT)
+-check_symbol_exists(idn_free       "${CURL_INCLUDES}" HAVE_IDN_FREE)
+-check_symbol_exists(idna_strerror  "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
+-check_symbol_exists(tld_strerror   "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
+ check_symbol_exists(setlocale      "${CURL_INCLUDES}" HAVE_SETLOCALE)
+ check_symbol_exists(setrlimit      "${CURL_INCLUDES}" HAVE_SETRLIMIT)
+ check_symbol_exists(fcntl          "${CURL_INCLUDES}" HAVE_FCNTL)
+@@ -1067,7 +1060,7 @@ _add_if("IPv6"          ENABLE_IPV6)
+ _add_if("unix-sockets"  USE_UNIX_SOCKETS)
+ _add_if("libz"          HAVE_LIBZ)
+ _add_if("AsynchDNS"     USE_ARES OR USE_THREADS_POSIX)
+-_add_if("IDN"           HAVE_LIBIDN)
++_add_if("IDN"           HAVE_LIBIDN2)
+ # TODO SSP1 (WinSSL) check is missing
+ _add_if("SSPI"          USE_WINDOWS_SSPI)
+ _add_if("GSS-API"       HAVE_GSSAPI)
+diff --git a/configure.ac b/configure.ac
+index 4c9862f..c8e2721 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,7 +157,7 @@ curl_tls_srp_msg="no      (--enable-tls-srp)"
+     curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
+    curl_ipv6_msg="no      (--enable-ipv6)"
+ curl_unix_sockets_msg="no      (--enable-unix-sockets)"
+-    curl_idn_msg="no      (--with-{libidn,winidn})"
++    curl_idn_msg="no      (--with-{libidn2,winidn})"
+  curl_manual_msg="no      (--enable-manual)"
+ curl_libcurl_msg="enabled (--disable-libcurl-option)"
+ curl_verbose_msg="enabled (--disable-verbose)"
+@@ -2825,15 +2825,15 @@ dnl **********************************************************************
+ dnl Check for the presence of IDN libraries and headers
+ dnl **********************************************************************
+ 
+-AC_MSG_CHECKING([whether to build with libidn])
++AC_MSG_CHECKING([whether to build with libidn2])
+ OPT_IDN="default"
+ AC_ARG_WITH(libidn,
+-AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
+-AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
++AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
++AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
+   [OPT_IDN=$withval])
+ case "$OPT_IDN" in
+   no)
+-    dnl --without-libidn option used
++    dnl --without-libidn2 option used
+     want_idn="no"
+     AC_MSG_RESULT([no])
+     ;;
+@@ -2844,13 +2844,13 @@ case "$OPT_IDN" in
+     AC_MSG_RESULT([(assumed) yes])
+     ;;
+   yes)
+-    dnl --with-libidn option used without path
++    dnl --with-libidn2 option used without path
+     want_idn="yes"
+     want_idn_path="default"
+     AC_MSG_RESULT([yes])
+     ;;
+   *)
+-    dnl --with-libidn option used with path
++    dnl --with-libidn2 option used with path
+     want_idn="yes"
+     want_idn_path="$withval"
+     AC_MSG_RESULT([yes ($withval)])
+@@ -2867,33 +2867,33 @@ if test "$want_idn" = "yes"; then
+   if test "$want_idn_path" != "default"; then
+     dnl path has been specified
+     IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
+-    CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
++    CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
+     if test "$PKGCONFIG" != "no"; then
+       IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --libs-only-l libidn 2>/dev/null`
++        $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
+       IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --libs-only-L libidn 2>/dev/null`
++        $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
+       IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+-        $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++        $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+     else
+       dnl pkg-config not available or provides no info
+-      IDN_LIBS="-lidn"
++      IDN_LIBS="-lidn2"
+       IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
+       IDN_CPPFLAGS="-I$want_idn_path/include"
+       IDN_DIR="$want_idn_path/lib$libsuff"
+     fi
+   else
+     dnl path not specified
+-    CURL_CHECK_PKGCONFIG(libidn)
++    CURL_CHECK_PKGCONFIG(libidn2)
+     if test "$PKGCONFIG" != "no"; then
+-      IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
+-      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
+-      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++      IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
++      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
++      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+     else
+       dnl pkg-config not available or provides no info
+-      IDN_LIBS="-lidn"
++      IDN_LIBS="-lidn2"
+     fi
+   fi
+   #
+@@ -2913,9 +2913,9 @@ if test "$want_idn" = "yes"; then
+   LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
+   LIBS="$IDN_LIBS $LIBS"
+   #
+-  AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
++  AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
+   AC_LINK_IFELSE([
+-    AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
++    AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
+   ],[
+     AC_MSG_RESULT([yes])
+     tst_links_libidn="yes"
+@@ -2923,37 +2923,19 @@ if test "$want_idn" = "yes"; then
+     AC_MSG_RESULT([no])
+     tst_links_libidn="no"
+   ])
+-  if test "$tst_links_libidn" = "no"; then
+-    AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
+-    AC_LINK_IFELSE([
+-      AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
+-    ],[
+-      AC_MSG_RESULT([yes])
+-      tst_links_libidn="yes"
+-    ],[
+-      AC_MSG_RESULT([no])
+-      tst_links_libidn="no"
+-    ])
+-  fi
+   #
++  AC_CHECK_HEADERS( idn2.h )
++
+   if test "$tst_links_libidn" = "yes"; then
+-    AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
++    AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
+     dnl different versions of libidn have different setups of these:
+-    AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
+-    AC_CHECK_HEADERS( idn-free.h tld.h )
+-    if test "x$ac_cv_header_tld_h" = "xyes"; then
+-      AC_SUBST([IDN_ENABLED], [1])
+-      curl_idn_msg="enabled"
+-      if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
+-        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
+-        export LD_LIBRARY_PATH
+-        AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+-      fi
+-    else
+-      AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
+-      CPPFLAGS="$clean_CPPFLAGS"
+-      LDFLAGS="$clean_LDFLAGS"
+-      LIBS="$clean_LIBS"
++
++    AC_SUBST([IDN_ENABLED], [1])
++    curl_idn_msg="enabled (libidn2)"
++    if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
++      LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
++      export LD_LIBRARY_PATH
++      AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+     fi
+   else
+     AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
+diff --git a/lib/curl_setup.h b/lib/curl_setup.h
+index 33ad129..5fb241b 100644
+--- a/lib/curl_setup.h
++++ b/lib/curl_setup.h
+@@ -590,10 +590,9 @@ int netware_init(void);
+ #endif
+ #endif
+ 
+-#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
+-/* The lib was present and the tld.h header (which is missing in libidn 0.3.X
+-   but we only work with libidn 0.4.1 or later) */
+-#define USE_LIBIDN
++#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H)
++/* The lib and header are present */
++#define USE_LIBIDN2
+ #endif
+ 
+ #ifndef SIZEOF_TIME_T
+diff --git a/lib/easy.c b/lib/easy.c
+index d529da8..51d57e3 100644
+--- a/lib/easy.c
++++ b/lib/easy.c
+@@ -144,28 +144,6 @@ static CURLcode win32_init(void)
+   return CURLE_OK;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Initialise use of IDNA library.
+- * It falls back to ASCII if $CHARSET isn't defined. This doesn't work for
+- * idna_to_ascii_lz().
+- */
+-static void idna_init (void)
+-{
+-#ifdef WIN32
+-  char buf[60];
+-  UINT cp = GetACP();
+-
+-  if(!getenv("CHARSET") && cp > 0) {
+-    snprintf(buf, sizeof(buf), "CHARSET=cp%u", cp);
+-    putenv(buf);
+-  }
+-#else
+-  /* to do? */
+-#endif
+-}
+-#endif  /* USE_LIBIDN */
+-
+ /* true globals -- for curl_global_init() and curl_global_cleanup() */
+ static unsigned int  initialized;
+ static long          init_flags;
+@@ -262,10 +240,6 @@ static CURLcode global_init(long flags, bool memoryfuncs)
+   }
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-  idna_init();
+-#endif
+-
+   if(Curl_resolver_global_init()) {
+     DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n"));
+     return CURLE_FAILED_INIT;
+diff --git a/lib/strerror.c b/lib/strerror.c
+index d222a1f..bf4faae 100644
+--- a/lib/strerror.c
++++ b/lib/strerror.c
+@@ -35,8 +35,8 @@
+ 
+ #include <curl/curl.h>
+ 
+-#ifdef USE_LIBIDN
+-#include <idna.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+ 
+ #ifdef USE_WINDOWS_SSPI
+@@ -723,83 +723,6 @@ const char *Curl_strerror(struct connectdata *conn, int err)
+   return buf;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Return error-string for libidn status as returned from idna_to_ascii_lz().
+- */
+-const char *Curl_idn_strerror (struct connectdata *conn, int err)
+-{
+-#ifdef HAVE_IDNA_STRERROR
+-  (void)conn;
+-  return idna_strerror((Idna_rc) err);
+-#else
+-  const char *str;
+-  char *buf;
+-  size_t max;
+-
+-  DEBUGASSERT(conn);
+-
+-  buf = conn->syserr_buf;
+-  max = sizeof(conn->syserr_buf)-1;
+-  *buf = '\0';
+-
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-  switch ((Idna_rc)err) {
+-    case IDNA_SUCCESS:
+-      str = "No error";
+-      break;
+-    case IDNA_STRINGPREP_ERROR:
+-      str = "Error in string preparation";
+-      break;
+-    case IDNA_PUNYCODE_ERROR:
+-      str = "Error in Punycode operation";
+-      break;
+-    case IDNA_CONTAINS_NON_LDH:
+-      str = "Illegal ASCII characters";
+-      break;
+-    case IDNA_CONTAINS_MINUS:
+-      str = "Contains minus";
+-      break;
+-    case IDNA_INVALID_LENGTH:
+-      str = "Invalid output length";
+-      break;
+-    case IDNA_NO_ACE_PREFIX:
+-      str = "No ACE prefix (\"xn--\")";
+-      break;
+-    case IDNA_ROUNDTRIP_VERIFY_ERROR:
+-      str = "Round trip verify error";
+-      break;
+-    case IDNA_CONTAINS_ACE_PREFIX:
+-      str = "Already have ACE prefix (\"xn--\")";
+-      break;
+-    case IDNA_ICONV_ERROR:
+-      str = "Locale conversion failed";
+-      break;
+-    case IDNA_MALLOC_ERROR:
+-      str = "Allocation failed";
+-      break;
+-    case IDNA_DLOPEN_ERROR:
+-      str = "dlopen() error";
+-      break;
+-    default:
+-      snprintf(buf, max, "error %d", err);
+-      str = NULL;
+-      break;
+-  }
+-#else
+-  if((Idna_rc)err == IDNA_SUCCESS)
+-    str = "No error";
+-  else
+-    str = "Error";
+-#endif
+-  if(str)
+-    strncpy(buf, str, max);
+-  buf[max] = '\0';
+-  return (buf);
+-#endif
+-}
+-#endif  /* USE_LIBIDN */
+-
+ #ifdef USE_WINDOWS_SSPI
+ const char *Curl_sspi_strerror (struct connectdata *conn, int err)
+ {
+diff --git a/lib/strerror.h b/lib/strerror.h
+index ae8c96b..627273e 100644
+--- a/lib/strerror.h
++++ b/lib/strerror.h
+@@ -7,7 +7,7 @@
+  *                            | (__| |_| |  _ <| |___
+  *                             \___|\___/|_| \_\_____|
+  *
+- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+  *
+  * This software is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution. The terms
+@@ -26,7 +26,7 @@
+ 
+ const char *Curl_strerror (struct connectdata *conn, int err);
+ 
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+ const char *Curl_idn_strerror (struct connectdata *conn, int err);
+ #endif
+ 
+diff --git a/lib/url.c b/lib/url.c
+index 8832989..8d52152 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -59,24 +59,15 @@
+ #include <limits.h>
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-#include <idna.h>
+-#include <tld.h>
+-#include <stringprep.h>
+-#ifdef HAVE_IDN_FREE_H
+-#include <idn-free.h>
+-#else
+-/* prototype from idn-free.h, not provided by libidn 0.4.5's make install! */
+-void idn_free (void *ptr);
+-#endif
+-#ifndef HAVE_IDN_FREE
+-/* if idn_free() was not found in this version of libidn use free() instead */
+-#define idn_free(x) (free)(x)
+-#endif
++#ifdef USE_LIBIDN2
++#include <idn2.h>
++
+ #elif defined(USE_WIN32_IDN)
+ /* prototype for curl_win32_idn_to_ascii() */
+ int curl_win32_idn_to_ascii(const char *in, char **out);
+-#endif  /* USE_LIBIDN */
++#endif  /* USE_LIBIDN2 */
++
++#include <idn2.h>
+ 
+ #include "urldata.h"
+ #include "netrc.h"
+@@ -3693,59 +3684,15 @@ static bool is_ASCII_name(const char *hostname)
+   return TRUE;
+ }
+ 
+-#ifdef USE_LIBIDN
+-/*
+- * Check if characters in hostname is allowed in Top Level Domain.
+- */
+-static bool tld_check_name(struct SessionHandle *data,
+-                           const char *ace_hostname)
+-{
+-  size_t err_pos;
+-  char *uc_name = NULL;
+-  int rc;
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-  const char *tld_errmsg = "<no msg>";
+-#else
+-  (void)data;
+-#endif
+-
+-  /* Convert (and downcase) ACE-name back into locale's character set */
+-  rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0);
+-  if(rc != IDNA_SUCCESS)
+-    return FALSE;
+-
+-  rc = tld_check_lz(uc_name, &err_pos, NULL);
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-#ifdef HAVE_TLD_STRERROR
+-  if(rc != TLD_SUCCESS)
+-    tld_errmsg = tld_strerror((Tld_rc)rc);
+-#endif
+-  if(rc == TLD_INVALID)
+-    infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n",
+-          tld_errmsg, err_pos, uc_name[err_pos],
+-          uc_name[err_pos] & 255);
+-  else if(rc != TLD_SUCCESS)
+-    infof(data, "WARNING: TLD check for %s failed; %s\n",
+-          uc_name, tld_errmsg);
+-#endif /* CURL_DISABLE_VERBOSE_STRINGS */
+-  if(uc_name)
+-     idn_free(uc_name);
+-  if(rc != TLD_SUCCESS)
+-    return FALSE;
+-
+-  return TRUE;
+-}
+-#endif
+-
+ /*
+  * Perform any necessary IDN conversion of hostname
+  */
+-static void fix_hostname(struct SessionHandle *data,
+-                         struct connectdata *conn, struct hostname *host)
++static void fix_hostname(struct connectdata *conn, struct hostname *host)
+ {
+   size_t len;
++  struct Curl_easy *data = conn->data;
+ 
+-#ifndef USE_LIBIDN
++#ifndef USE_LIBIDN2
+   (void)data;
+   (void)conn;
+ #elif defined(CURL_DISABLE_VERBOSE_STRINGS)
+@@ -3762,26 +3709,18 @@ static void fix_hostname(struct SessionHandle *data,
+     host->name[len-1]=0;
+ 
+   if(!is_ASCII_name(host->name)) {
+-#ifdef USE_LIBIDN
+-  /*************************************************************
+-   * Check name for non-ASCII and convert hostname to ACE form.
+-   *************************************************************/
+-  if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+-    char *ace_hostname = NULL;
+-    int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0);
+-    infof (data, "Input domain encoded as `%s'\n",
+-           stringprep_locale_charset ());
+-    if(rc != IDNA_SUCCESS)
+-      infof(data, "Failed to convert %s to ACE; %s\n",
+-            host->name, Curl_idn_strerror(conn, rc));
+-    else {
+-      /* tld_check_name() displays a warning if the host name contains
+-         "illegal" characters for this TLD */
+-      (void)tld_check_name(data, ace_hostname);
+-
+-      host->encalloc = ace_hostname;
+-      /* change the name pointer to point to the encoded hostname */
+-      host->name = host->encalloc;
++#ifdef USE_LIBIDN2
++    if(idn2_check_version(IDN2_VERSION)) {
++      char *ace_hostname = NULL;
++      int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, 0);
++      if(rc == IDN2_OK) {
++        host->encalloc = (char *)ace_hostname;
++        /* change the name pointer to point to the encoded hostname */
++        host->name = host->encalloc;
++      }
++      else
++        infof(data, "Failed to convert %s to ACE; %s\n", host->name,
++              idn2_strerror(rc));
+     }
+   }
+ #elif defined(USE_WIN32_IDN)
+@@ -3809,9 +3748,9 @@ static void fix_hostname(struct SessionHandle *data,
+  */
+ static void free_fixed_hostname(struct hostname *host)
+ {
+-#if defined(USE_LIBIDN)
++#if defined(USE_LIBIDN2)
+   if(host->encalloc) {
+-    idn_free(host->encalloc); /* must be freed with idn_free() since this was
++    idn2_free(host->encalloc); /* must be freed with idn2_free() since this was
+                                  allocated by libidn */
+     host->encalloc = NULL;
+   }
+@@ -5707,9 +5646,9 @@ static CURLcode create_conn(struct SessionHandle *data,
+   /*************************************************************
+    * IDN-fix the hostnames
+    *************************************************************/
+-  fix_hostname(data, conn, &conn->host);
++  fix_hostname(conn, &conn->host);
+   if(conn->proxy.name && *conn->proxy.name)
+-    fix_hostname(data, conn, &conn->proxy);
++    fix_hostname(conn, &conn->proxy);
+ 
+   /*************************************************************
+    * Setup internals depending on protocol. Needs to be done after
+diff --git a/lib/version.c b/lib/version.c
+index 7f14fa5..a5c9811 100644
+--- a/lib/version.c
++++ b/lib/version.c
+@@ -36,8 +36,8 @@
+ #  include <ares.h>
+ #endif
+ 
+-#ifdef USE_LIBIDN
+-#include <stringprep.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+ 
+ #ifdef USE_LIBPSL
+@@ -97,9 +97,9 @@ char *curl_version(void)
+   left -= len;
+   ptr += len;
+ #endif
+-#ifdef USE_LIBIDN
+-  if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+-    len = snprintf(ptr, left, " libidn/%s", stringprep_check_version(NULL));
++#ifdef USE_LIBIDN2
++  if(idn2_check_version(IDN2_VERSION)) {
++    len = snprintf(ptr, left, " libidn2/%s", idn2_check_version(NULL));
+     left -= len;
+     ptr += len;
+   }
+@@ -344,10 +344,10 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
+     version_info.ares_num = aresnum;
+   }
+ #endif
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+   /* This returns a version string if we use the given version or later,
+      otherwise it returns NULL */
+-  version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION);
++  version_info.libidn = idn2_check_version(IDN2_VERSION);
+   if(version_info.libidn)
+     version_info.features |= CURL_VERSION_IDN;
+ #elif defined(USE_WIN32_IDN)
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3c877e4..a7f6917 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -25,6 +25,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8622.patch \
              file://CVE-2016-8623.patch \
              file://CVE-2016-8624.patch \
+             file://CVE-2016-8625.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 10/12] curl: CVE-2016-8624
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

invalid URL parsing with '#'

Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102J.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8624.patch | 51 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 52 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8624.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8624.patch b/meta/recipes-support/curl/curl/CVE-2016-8624.patch
new file mode 100644
index 0000000..009f7d0
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8624.patch
@@ -0,0 +1,51 @@
+From 3bb273db7e40ebc284cff45f3ce3f0475c8339c2 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 11 Oct 2016 00:48:35 +0200
+Subject: [PATCH] urlparse: accept '#' as end of host name
+
+'http://example.com#@127.0.0.1/x.txt' equals a request to example.com
+for the '/' document with the rest of the URL being a fragment.
+
+CVE: CVE-2016-8624
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102J.html
+Reported-by: Fernando Muñoz
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/lib/url.c b/lib/url.c
+--- a/lib/url.c	2016-11-07 08:50:23.030126833 +0100
++++ b/lib/url.c	2016-11-07 10:16:13.562089428 +0100
+@@ -4086,7 +4086,7 @@
+     path[0]=0;
+ 
+     if(2 > sscanf(data->change.url,
+-                   "%15[^\n:]://%[^\n/?]%[^\n]",
++                   "%15[^\n:]://%[^\n/?#]%[^\n]",
+                    protobuf,
+                    conn->host.name, path)) {
+ 
+@@ -4094,7 +4094,7 @@
+        * The URL was badly formatted, let's try the browser-style _without_
+        * protocol specified like 'http://'.
+        */
+-      rc = sscanf(data->change.url, "%[^\n/?]%[^\n]", conn->host.name, path);
++      rc = sscanf(data->change.url, "%[^\n/?#]%[^\n]", conn->host.name, path);
+       if(1 > rc) {
+         /*
+          * We couldn't even get this format.
+@@ -4184,10 +4184,10 @@
+   }
+ 
+   /* If the URL is malformatted (missing a '/' after hostname before path) we
+-   * insert a slash here. The only letter except '/' we accept to start a path
+-   * is '?'.
++   * insert a slash here. The only letters except '/' that can start a path is
++   * '?' and '#' - as controlled by the two sscanf() patterns above.
+    */
+-  if(path[0] == '?') {
++  if(path[0] != '/') {
+     /* We need this function to deal with overlapping memory areas. We know
+        that the memory area 'path' points to is 'urllen' bytes big and that
+        is bigger than the path. Use +1 to move the zero byte too. */
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 0f8fa3a..3c877e4 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -24,6 +24,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8621.patch \
              file://CVE-2016-8622.patch \
              file://CVE-2016-8623.patch \
+             file://CVE-2016-8624.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 06/12] curl: CVE-2016-8620
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

glob parser write/read out of bounds

Affected versions: curl 7.34.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102F.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8620.patch | 44 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8620.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8620.patch b/meta/recipes-support/curl/curl/CVE-2016-8620.patch
new file mode 100644
index 0000000..613ace3
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8620.patch
@@ -0,0 +1,44 @@
+From fbb5f1aa0326d485d5a7ac643b48481897ca667f Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 3 Oct 2016 17:27:16 +0200
+Subject: [PATCH] range: prevent negative end number in a glob range
+
+CVE: CVE-2016-8620
+
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102F.html
+Reported-by: Luật Nguyễn
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ src/tool_urlglob.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
+index a357b8b..64c75ba 100644
+--- a/src/tool_urlglob.c
++++ b/src/tool_urlglob.c
+@@ -257,6 +257,12 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
+         endp = NULL;
+       else {
+         pattern = endp+1;
++        while(*pattern && ISBLANK(*pattern))
++          pattern++;
++        if(!ISDIGIT(*pattern)) {
++          endp = NULL;
++          goto fail;
++        }
+         errno = 0;
+         max_n = strtoul(pattern, &endp, 10);
+         if(errno || (*endp == ':')) {
+@@ -277,6 +283,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
+       }
+     }
+ 
++    fail:
+     *posp += (pattern - *patternp);
+ 
+     if(!endp || (min_n > max_n) || (step_n > (max_n - min_n)) || !step_n)
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 9ef5718..e6ad03f 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -20,6 +20,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8617.patch \
              file://CVE-2016-8618.patch \
              file://CVE-2016-8619.patch \
+             file://CVE-2016-8620.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 12/12] curl/url: remove unconditional idn2.h include
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 .../url-remove-unconditional-idn2.h-include.patch  | 28 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch

diff --git a/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
new file mode 100644
index 0000000..e2a88e4
--- /dev/null
+++ b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
@@ -0,0 +1,28 @@
+From c27013c05d99d92370b57e1a7af1b854eef4e7c1 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 31 Oct 2016 09:49:50 +0100
+Subject: [PATCH] url: remove unconditional idn2.h include
+
+Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/url.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index c90a1c5..b997f41 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -67,8 +67,6 @@
+ bool curl_win32_idn_to_ascii(const char *in, char **out);
+ #endif  /* USE_LIBIDN2 */
+ 
+-#include <idn2.h>
+-
+ #include "urldata.h"
+ #include "netrc.h"
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index a7f6917..7fab7cf 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -26,6 +26,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8623.patch \
              file://CVE-2016-8624.patch \
              file://CVE-2016-8625.patch \
+             file://url-remove-unconditional-idn2.h-include.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 09/12] curl: CVE-2016-8623
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

Use-after-free via shared cookies

Affected versions: curl 7.10.7 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102I.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8623.patch | 209 +++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |   1 +
 2 files changed, 210 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8623.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8623.patch b/meta/recipes-support/curl/curl/CVE-2016-8623.patch
new file mode 100644
index 0000000..d9ddef6
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8623.patch
@@ -0,0 +1,209 @@
+From d9d57fe0da6f25d05570fd583520ecd321ed9c3f Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 4 Oct 2016 23:26:13 +0200
+Subject: [PATCH] cookies: getlist() now holds deep copies of all cookies
+
+Previously it only held references to them, which was reckless as the
+thread lock was released so the cookies could get modified by other
+handles that share the same cookie jar over the share interface.
+
+CVE: CVE-2016-8623
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102I.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/cookie.c | 61 +++++++++++++++++++++++++++++++++++++++---------------------
+ lib/cookie.h |  4 ++--
+ lib/http.c   |  2 +-
+ 3 files changed, 43 insertions(+), 24 deletions(-)
+
+diff --git a/lib/cookie.c b/lib/cookie.c
+index 0f05da2..8607ce3 100644
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -1022,10 +1022,44 @@ static int cookie_sort(const void *p1, const void *p2)
+ 
+   /* sorry, can't be more deterministic */
+   return 0;
+ }
+ 
++#define CLONE(field)                     \
++  do {                                   \
++    if(src->field) {                     \
++      dup->field = strdup(src->field);   \
++      if(!dup->field)                    \
++        goto fail;                       \
++    }                                    \
++  } while(0)
++
++static struct Cookie *dup_cookie(struct Cookie *src)
++{
++  struct Cookie *dup = calloc(sizeof(struct Cookie), 1);
++  if(dup) {
++    CLONE(expirestr);
++    CLONE(domain);
++    CLONE(path);
++    CLONE(spath);
++    CLONE(name);
++    CLONE(value);
++    CLONE(maxage);
++    CLONE(version);
++    dup->expires = src->expires;
++    dup->tailmatch = src->tailmatch;
++    dup->secure = src->secure;
++    dup->livecookie = src->livecookie;
++    dup->httponly = src->httponly;
++  }
++  return dup;
++
++  fail:
++  freecookie(dup);
++  return NULL;
++}
++
+ /*****************************************************************************
+  *
+  * Curl_cookie_getlist()
+  *
+  * For a given host and path, return a linked list of cookies that the
+@@ -1077,15 +1111,12 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+         if(!co->spath || pathmatch(co->spath, path) ) {
+ 
+           /* and now, we know this is a match and we should create an
+              entry for the return-linked-list */
+ 
+-          newco = malloc(sizeof(struct Cookie));
++          newco = dup_cookie(co);
+           if(newco) {
+-            /* first, copy the whole source cookie: */
+-            memcpy(newco, co, sizeof(struct Cookie));
+-
+             /* then modify our next */
+             newco->next = mainco;
+ 
+             /* point the main to us */
+             mainco = newco;
+@@ -1093,16 +1124,11 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+             matches++;
+           }
+           else {
+             fail:
+             /* failure, clear up the allocated chain and return NULL */
+-            while(mainco) {
+-              co = mainco->next;
+-              free(mainco);
+-              mainco = co;
+-            }
+-
++            Curl_cookie_freelist(mainco);
+             return NULL;
+           }
+         }
+       }
+     }
+@@ -1150,11 +1176,11 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+  *
+  ****************************************************************************/
+ void Curl_cookie_clearall(struct CookieInfo *cookies)
+ {
+   if(cookies) {
+-    Curl_cookie_freelist(cookies->cookies, TRUE);
++    Curl_cookie_freelist(cookies->cookies);
+     cookies->cookies = NULL;
+     cookies->numcookies = 0;
+   }
+ }
+ 
+@@ -1162,25 +1188,18 @@ void Curl_cookie_clearall(struct CookieInfo *cookies)
+  *
+  * Curl_cookie_freelist()
+  *
+  * Free a list of cookies previously returned by Curl_cookie_getlist();
+  *
+- * The 'cookiestoo' argument tells this function whether to just free the
+- * list or actually also free all cookies within the list as well.
+- *
+  ****************************************************************************/
+ 
+-void Curl_cookie_freelist(struct Cookie *co, bool cookiestoo)
++void Curl_cookie_freelist(struct Cookie *co)
+ {
+   struct Cookie *next;
+   while(co) {
+     next = co->next;
+-    if(cookiestoo)
+-      freecookie(co);
+-    else
+-      free(co); /* we only free the struct since the "members" are all just
+-                   pointed out in the main cookie list! */
++    freecookie(co);
+     co = next;
+   }
+ }
+ 
+ 
+@@ -1231,11 +1250,11 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies)
+  ****************************************************************************/
+ void Curl_cookie_cleanup(struct CookieInfo *c)
+ {
+   if(c) {
+     free(c->filename);
+-    Curl_cookie_freelist(c->cookies, TRUE);
++    Curl_cookie_freelist(c->cookies);
+     free(c); /* free the base struct as well */
+   }
+ }
+ 
+ /* get_netscape_format()
+diff --git a/lib/cookie.h b/lib/cookie.h
+index cd7c54a..a9a4578 100644
+--- a/lib/cookie.h
++++ b/lib/cookie.h
+@@ -5,11 +5,11 @@
+  *  Project                     ___| | | |  _ \| |
+  *                             / __| | | | |_) | |
+  *                            | (__| |_| |  _ <| |___
+  *                             \___|\___/|_| \_\_____|
+  *
+- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+  *
+  * This software is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution. The terms
+  * are also available at https://curl.haxx.se/docs/copyright.html.
+  *
+@@ -80,11 +80,11 @@ struct Cookie *Curl_cookie_add(struct Curl_easy *data,
+                                struct CookieInfo *, bool header, char *lineptr,
+                                const char *domain, const char *path);
+ 
+ struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *,
+                                    const char *, bool);
+-void Curl_cookie_freelist(struct Cookie *cookies, bool cookiestoo);
++void Curl_cookie_freelist(struct Cookie *cookies);
+ void Curl_cookie_clearall(struct CookieInfo *cookies);
+ void Curl_cookie_clearsess(struct CookieInfo *cookies);
+ 
+ #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
+ #define Curl_cookie_list(x) NULL
+diff --git a/lib/http.c b/lib/http.c
+index 65c145a..e6e7d37 100644
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2382,11 +2382,11 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
+             break;
+           count++;
+         }
+         co = co->next; /* next cookie please */
+       }
+-      Curl_cookie_freelist(store, FALSE); /* free the cookie list */
++      Curl_cookie_freelist(store);
+     }
+     if(addcookies && !result) {
+       if(!count)
+         result = Curl_add_bufferf(req_buffer, "Cookie: ");
+       if(!result) {
+-- 
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 4bff34e..0f8fa3a 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -23,6 +23,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8620.patch \
              file://CVE-2016-8621.patch \
              file://CVE-2016-8622.patch \
+             file://CVE-2016-8623.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 08/12] curl: CVE-2016-8622
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

URL unescape heap overflow via integer truncation

Affected versions: curl 7.24.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102H.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8622.patch | 94 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 95 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8622.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8622.patch b/meta/recipes-support/curl/curl/CVE-2016-8622.patch
new file mode 100644
index 0000000..8edad01
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8622.patch
@@ -0,0 +1,94 @@
+From 53e71e47d6b81650d26ec33a58d0dca24c7ffb2c Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 4 Oct 2016 18:56:45 +0200
+Subject: [PATCH] unescape: avoid integer overflow
+
+CVE: CVE-2016-8622
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102H.html
+Reported-by: Cure53
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/docs/libcurl/curl_easy_unescape.3 b/docs/libcurl/curl_easy_unescape.3
+--- a/docs/libcurl/curl_easy_unescape.3	2016-02-03 00:08:02.000000000 +0100
++++ b/docs/libcurl/curl_easy_unescape.3	2016-11-07 09:25:45.999933275 +0100
+@@ -5,7 +5,7 @@
+ .\" *                            | (__| |_| |  _ <| |___
+ .\" *                             \___|\___/|_| \_\_____|
+ .\" *
+-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
++.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ .\" *
+ .\" * This software is licensed as described in the file COPYING, which
+ .\" * you should have received as part of this distribution. The terms
+@@ -40,7 +40,10 @@
+ 
+ If \fBoutlength\fP is non-NULL, the function will write the length of the
+ returned string in the integer it points to. This allows an escaped string
+-containing %00 to still get used properly after unescaping.
++containing %00 to still get used properly after unescaping. Since this is a
++pointer to an \fIint\fP type, it can only return a value up to INT_MAX so no
++longer string can be unescaped if the string length is returned in this
++parameter.
+ 
+ You must \fIcurl_free(3)\fP the returned string when you're done with it.
+ .SH AVAILABILITY
+diff -ruN a/lib/dict.c b/lib/dict.c
+--- a/lib/dict.c	2016-02-03 00:02:44.000000000 +0100
++++ b/lib/dict.c	2016-11-07 09:25:45.999933275 +0100
+@@ -5,7 +5,7 @@
+  *                            | (__| |_| |  _ <| |___
+  *                             \___|\___/|_| \_\_____|
+  *
+- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+  *
+  * This software is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution. The terms
+@@ -52,7 +52,7 @@
+ #include <curl/curl.h>
+ #include "transfer.h"
+ #include "sendf.h"
+-
++#include "escape.h"
+ #include "progress.h"
+ #include "strequal.h"
+ #include "dict.h"
+@@ -96,12 +96,12 @@
+   char *newp;
+   char *dictp;
+   char *ptr;
+-  int len;
++  size_t len;
+   char ch;
+   int olen=0;
+ 
+-  newp = curl_easy_unescape(data, inputbuff, 0, &len);
+-  if(!newp)
++  CURLcode result = Curl_urldecode(data, inputbuff, 0, &newp, &len, FALSE);
++  if(!newp || result)
+     return NULL;
+ 
+   dictp = malloc(((size_t)len)*2 + 1); /* add one for terminating zero */
+diff -ruN a/lib/escape.c b/lib/escape.c
+--- a/lib/escape.c	2016-02-05 10:02:03.000000000 +0100
++++ b/lib/escape.c	2016-11-07 09:29:43.073671606 +0100
+@@ -217,8 +217,14 @@
+                                 FALSE);
+   if(res)
+     return NULL;
+-  if(olen)
+-    *olen = curlx_uztosi(outputlen);
++
++    if(olen) {
++      if(outputlen <= (size_t) INT_MAX)
++        *olen = curlx_uztosi(outputlen);
++      else
++        /* too large to return in an int, fail! */
++        Curl_safefree(str);
++    }
+   return str;
+ }
+ 
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 67b07da..4bff34e 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -22,6 +22,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8619.patch \
              file://CVE-2016-8620.patch \
              file://CVE-2016-8621.patch \
+             file://CVE-2016-8622.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 02/12] curl: CVE-2016-8616
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

case insensitive password comparison

Affected versions: curl 7.7 to and including 7.50.3

Reference:
https://curl.haxx.se/docs/adv_20161102B.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8616.patch | 49 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8616.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8616.patch b/meta/recipes-support/curl/curl/CVE-2016-8616.patch
new file mode 100644
index 0000000..d5d78fc
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8616.patch
@@ -0,0 +1,49 @@
+From b3ee26c5df75d97f6895e6ec4538894ebaf76e48 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 27 Sep 2016 18:01:53 +0200
+Subject: [PATCH] connectionexists: use case sensitive user/password
+ comparisons
+
+CVE: CVE-2016-8616
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102B.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/lib/url.c b/lib/url.c
+--- a/lib/url.c	2016-11-07 08:50:23.030126833 +0100
++++ b/lib/url.c	2016-11-07 09:16:20.459836564 +0100
+@@ -3305,8 +3305,8 @@
+       if(!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) {
+         /* This protocol requires credentials per connection,
+            so verify that we're using the same name and password as well */
+-        if(!strequal(needle->user, check->user) ||
+-           !strequal(needle->passwd, check->passwd)) {
++        if(strcmp(needle->user, check->user) ||
++           strcmp(needle->passwd, check->passwd)) {
+           /* one of them was different */
+           continue;
+         }
+@@ -3369,8 +3369,8 @@
+            possible. (Especially we must not reuse the same connection if
+            partway through a handshake!) */
+         if(wantNTLMhttp) {
+-          if(!strequal(needle->user, check->user) ||
+-             !strequal(needle->passwd, check->passwd))
++          if(strcmp(needle->user, check->user) ||
++             strcmp(needle->passwd, check->passwd))
+             continue;
+         }
+         else if(check->ntlm.state != NTLMSTATE_NONE) {
+@@ -3380,8 +3380,8 @@
+ 
+         /* Same for Proxy NTLM authentication */
+         if(wantProxyNTLMhttp) {
+-          if(!strequal(needle->proxyuser, check->proxyuser) ||
+-             !strequal(needle->proxypasswd, check->proxypasswd))
++          if(strcmp(needle->proxyuser, check->proxyuser) ||
++             strcmp(needle->proxypasswd, check->proxypasswd))
+             continue;
+         }
+         else if(check->proxyntlm.state != NTLMSTATE_NONE) {
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 1f2758c..20c3721 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -16,6 +16,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-5421.patch \
              file://CVE-2016-7141.patch \
              file://CVE-2016-8615.patch \
+             file://CVE-2016-8616.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related

* [PATCH][krogoth 04/12] curl: CVE-2016-8618
From: Sona Sarmadi @ 2016-11-11  9:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: sona
In-Reply-To: <1478857754-61379-1-git-send-email-sona.sarmadi@enea.com>

double-free in curl_maprintf

Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102D.html

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
 meta/recipes-support/curl/curl/CVE-2016-8618.patch | 52 ++++++++++++++++++++++
 meta/recipes-support/curl/curl_7.47.1.bb           |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8618.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2016-8618.patch b/meta/recipes-support/curl/curl/CVE-2016-8618.patch
new file mode 100644
index 0000000..2fd4749
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8618.patch
@@ -0,0 +1,52 @@
+From 31106a073882656a2a5ab56c4ce2847e9a334c3c Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Wed, 28 Sep 2016 10:15:34 +0200
+Subject: [PATCH] aprintf: detect wrap-around when growing allocation
+
+On 32bit systems we could otherwise wrap around after 2GB and allocate 0
+bytes and crash.
+
+CVE: CVE-2016-8618
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102D.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/mprintf.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/mprintf.c b/lib/mprintf.c
+index dbedeaa..2c88aa8 100644
+--- a/lib/mprintf.c
++++ b/lib/mprintf.c
+@@ -1034,20 +1034,23 @@ static int alloc_addbyter(int output, FILE *data)
+     }
+     infop->alloc = 32;
+     infop->len =0;
+   }
+   else if(infop->len+1 >= infop->alloc) {
+-    char *newptr;
++    char *newptr = NULL;
++    size_t newsize = infop->alloc*2;
+ 
+-    newptr = realloc(infop->buffer, infop->alloc*2);
++    /* detect wrap-around or other overflow problems */
++    if(newsize > infop->alloc)
++      newptr = realloc(infop->buffer, newsize);
+ 
+     if(!newptr) {
+       infop->fail = 1;
+       return -1; /* fail */
+     }
+     infop->buffer = newptr;
+-    infop->alloc *= 2;
++    infop->alloc = newsize;
+   }
+ 
+   infop->buffer[ infop->len ] = outc;
+ 
+   infop->len++;
+-- 
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3724411..27a999e 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -18,6 +18,7 @@ SRC_URI += " file://configure_ac.patch \
              file://CVE-2016-8615.patch \
              file://CVE-2016-8616.patch \
              file://CVE-2016-8617.patch \
+             file://CVE-2016-8618.patch \
            "
 
 SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
-- 
1.9.1



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox