From 7942013365878d29549be460c36290f4377403ed Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Thu, 3 May 2018 19:11:44 +0200 Subject: [PATCH 1/9] gcc: update to 8.1 --- packages/lang/gcc/package.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lang/gcc/package.mk b/packages/lang/gcc/package.mk index 221ec13f1d..fd052f604c 100644 --- a/packages/lang/gcc/package.mk +++ b/packages/lang/gcc/package.mk @@ -17,8 +17,8 @@ ################################################################################ PKG_NAME="gcc" -PKG_VERSION="7.3.0" -PKG_SHA256="832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c" +PKG_VERSION="8.1.0" +PKG_SHA256="1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://gcc.gnu.org/" @@ -27,7 +27,7 @@ PKG_DEPENDS_BOOTSTRAP="ccache:host autoconf:host binutils:host gmp:host mpfr:hos PKG_DEPENDS_TARGET="gcc:host" PKG_DEPENDS_HOST="ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host glibc" PKG_SECTION="lang" -PKG_SHORTDESC="gcc: The GNU Compiler Collection Version 4 (aka GNU C Compiler)" +PKG_SHORTDESC="gcc: The GNU Compiler Collection (aka GNU C Compiler)" PKG_LONGDESC="This package contains the GNU Compiler Collection. It includes compilers for the languages C, C++, Objective C, Fortran 95, Java and others ... This GCC contains the Stack-Smashing Protector Patch which can be enabled with the -fstack-protector command-line option. More information about it ca be found at http://www.research.ibm.com/trl/projects/security/ssp/." GCC_COMMON_CONFIGURE_OPTS="--target=$TARGET_NAME \ From 58d7972dadf6fa563ba730ec4b7b1b5bf66cd0c1 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Tue, 15 May 2018 00:41:08 +0200 Subject: [PATCH 2/9] buildsystem: add -mtune to CFLAGS, to be in sync with LDFLAGS. Else segfault is triggered in lto build --- config/arch.aarch64 | 2 +- config/arch.arm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/arch.aarch64 b/config/arch.aarch64 index bfe989633a..0d39f35a83 100644 --- a/config/arch.aarch64 +++ b/config/arch.aarch64 @@ -23,6 +23,6 @@ TARGET_KERNEL_ARCH=arm64 # setup ARCH specific *FLAGS - TARGET_CFLAGS="-march=${TARGET_VARIANT}${TARGET_CPU_FLAGS} -mabi=lp64 -Wno-psabi $TARGET_EXTRA_FLAGS" + TARGET_CFLAGS="-march=${TARGET_VARIANT}${TARGET_CPU_FLAGS} -mabi=lp64 -Wno-psabi -mtune=$TARGET_CPU $TARGET_EXTRA_FLAGS" TARGET_LDFLAGS="-march=${TARGET_VARIANT}${TARGET_CPU_FLAGS} -mtune=$TARGET_CPU" GCC_OPTS="--with-abi=lp64 --with-arch=$TARGET_VARIANT" diff --git a/config/arch.arm b/config/arch.arm index 8e22263553..e9147e4c07 100644 --- a/config/arch.arm +++ b/config/arch.arm @@ -58,7 +58,7 @@ TARGET_KERNEL_ARCH=${TARGET_KERNEL_ARCH:-arm} # setup ARCH specific *FLAGS - TARGET_CFLAGS="-march=$TARGET_VARIANT -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated $TARGET_EXTRA_FLAGS" + TARGET_CFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated $TARGET_EXTRA_FLAGS" [ -n "$TARGET_FPU" ] && TARGET_CFLAGS="$TARGET_CFLAGS $TARGET_FPU_FLAGS" TARGET_LDFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU" GCC_OPTS="--with-abi=aapcs-linux --with-arch=$TARGET_SUBARCH --with-float=$TARGET_FLOAT --with-fpu=$TARGET_FPU" From 0a4dd829a58933b1adb9dbd8d757eee9d2353655 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Thu, 3 May 2018 19:51:38 +0200 Subject: [PATCH 3/9] glibc: addition cflags for gcc8 --- packages/devel/glibc/package.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/devel/glibc/package.mk b/packages/devel/glibc/package.mk index 67b6c5bb5a..b984cdfb1a 100644 --- a/packages/devel/glibc/package.mk +++ b/packages/devel/glibc/package.mk @@ -89,6 +89,7 @@ pre_configure_target() { # set some CFLAGS we need export CFLAGS="$CFLAGS -g -fno-stack-protector" + export CFLAGS="$CFLAGS -Wno-error=stringop-truncation -Wno-error=overflow -Wno-error=format-overflow=" export BUILD_CC=$HOST_CC export OBJDUMP_FOR_HOST=objdump From 96868644d9e8ea979bdc21aadca0fbac96625926 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Thu, 3 May 2018 20:15:06 +0200 Subject: [PATCH 4/9] systemd: add cflags for build with gcc8 --- packages/sysutils/systemd/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index 1322f3f96d..3019c19edb 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -105,7 +105,7 @@ PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \ -Dumount-path=/usr/bin/umount" pre_configure_target() { - export CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2" + export CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2 -Wno-format-truncation" export LC_ALL=en_US.UTF-8 } From d8996d20faf0ca873544e5e1b5df5a9180c449ba Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Thu, 3 May 2018 21:46:33 +0200 Subject: [PATCH 5/9] nss: add cflags for build with gcc8 --- packages/security/nss/package.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/security/nss/package.mk b/packages/security/nss/package.mk index f8f7df98c4..73068b7758 100644 --- a/packages/security/nss/package.mk +++ b/packages/security/nss/package.mk @@ -80,7 +80,8 @@ make_target() { NSS_TESTS="dummy" \ NSINSTALL=$TOOLCHAIN/bin/nsinstall \ CPU_ARCH_TAG=$TARGET_ARCH \ - CC=$CC LDFLAGS="$LDFLAGS -L$SYSROOT_PREFIX/usr/lib" \ + CC=$CC XCFLAGS="-Wno-error=stringop-truncation -Wno-error=format-overflow" \ + LDFLAGS="$LDFLAGS -L$SYSROOT_PREFIX/usr/lib" \ V=1 } From 2c47bfbb0e307f3ddc00dfb1c56653eeb1403d56 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Tue, 15 May 2018 14:13:35 +0200 Subject: [PATCH 6/9] grub: fix build with gcc8 with upstream patch --- .../001-gcc8-fix-packed-not-aligned.patch | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 packages/tools/grub/patches/001-gcc8-fix-packed-not-aligned.patch diff --git a/packages/tools/grub/patches/001-gcc8-fix-packed-not-aligned.patch b/packages/tools/grub/patches/001-gcc8-fix-packed-not-aligned.patch new file mode 100644 index 0000000000..51ee7dc86c --- /dev/null +++ b/packages/tools/grub/patches/001-gcc8-fix-packed-not-aligned.patch @@ -0,0 +1,72 @@ +From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Mon, 26 Mar 2018 16:52:34 +0800 +Subject: Fix packed-not-aligned error on GCC 8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When building with GCC 8, there are several errors regarding packed-not-aligned. + +./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] + +This patch fixes the build error by cleaning up the ambiguity of placing +aligned structure in a packed one. In "struct grub_btrfs_time" and "struct +grub_gpt_part_type", the aligned attribute seems to be superfluous, and also +has to be packed, to ensure the structure is bit-to-bit mapped to the format +laid on disk. I think we could blame to copy and paste error here for the +mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as +the name suggests. :) + +Signed-off-by: Michael Chang +Tested-by: Michael Chang +Tested-by: Paul Menzel +Reviewed-by: Daniel Kiper +--- + grub-core/fs/btrfs.c | 2 +- + include/grub/efiemu/runtime.h | 2 +- + include/grub/gpt_partition.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 4849c1c..be19544 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -175,7 +175,7 @@ struct grub_btrfs_time + { + grub_int64_t sec; + grub_uint32_t nanosec; +-} __attribute__ ((aligned (4))); ++} GRUB_PACKED; + + struct grub_btrfs_inode + { +diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h +index 9b6b729..36d2ded 100644 +--- a/include/grub/efiemu/runtime.h ++++ b/include/grub/efiemu/runtime.h +@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel + + struct efi_variable + { +- grub_efi_guid_t guid; ++ grub_efi_packed_guid_t guid; + grub_uint32_t namelen; + grub_uint32_t size; + grub_efi_uint32_t attributes; +diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h +index 1b32f67..9668a68 100644 +--- a/include/grub/gpt_partition.h ++++ b/include/grub/gpt_partition.h +@@ -28,7 +28,7 @@ struct grub_gpt_part_type + grub_uint16_t data2; + grub_uint16_t data3; + grub_uint8_t data4[8]; +-} __attribute__ ((aligned(8))); ++} GRUB_PACKED; + typedef struct grub_gpt_part_type grub_gpt_part_type_t; + + #define GRUB_GPT_PARTITION_TYPE_EMPTY \ +-- +cgit v1.0-41-gc330 + From bce7fc9535782c0361512bc3b32970c609c563d6 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Fri, 18 May 2018 20:31:51 +0200 Subject: [PATCH 7/9] tinc/lzo: add pic to build with gcc8 --- packages/addons/service/tinc/package.mk | 1 + packages/compress/lzo/package.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/addons/service/tinc/package.mk b/packages/addons/service/tinc/package.mk index 0ba931ee5a..539fba41a2 100644 --- a/packages/addons/service/tinc/package.mk +++ b/packages/addons/service/tinc/package.mk @@ -30,6 +30,7 @@ PKG_SECTION="service/system" PKG_SHORTDESC="tinc: a Virtual Private Network daemon" PKG_LONGDESC="tinc ($PKG_VERSION) is a Virtual Private Network (VPN) daemon that uses tunnelling and encryption to create a secure private network between hosts on the Internet. Because the VPN appears to the IP level network code as a normal network device, there is no need to adapt any existing software. This allows VPN sites to share information with each other over the Internet without exposing any information to others." PKG_TOOLCHAIN="autotools" +PKG_BUILD_FLAGS="+pic" PKG_IS_ADDON="yes" PKG_ADDON_NAME="tinc" diff --git a/packages/compress/lzo/package.mk b/packages/compress/lzo/package.mk index 8525ef475c..14553ab560 100644 --- a/packages/compress/lzo/package.mk +++ b/packages/compress/lzo/package.mk @@ -28,6 +28,7 @@ PKG_DEPENDS_TARGET="toolchain" PKG_SECTION="compress" PKG_SHORTDESC="LZO data compressor" PKG_LONGDESC="LZO is a data compression library which is suitable for data de-/compression in real-time. This means it favours speed over compression ratio." +PKG_BUILD_FLAGS="+pic" PKG_CMAKE_OPTS_HOST="-DENABLE_SHARED=OFF -DENABLE_STATIC=ON" PKG_CMAKE_OPTS_TARGET="-DENABLE_SHARED=OFF -DENABLE_STATIC=ON" From ca54a7f1a99e5e5173260f7b4370dc0dd7a3f4b2 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Sun, 3 Jun 2018 17:56:08 +0200 Subject: [PATCH 8/9] WC/WP: use older linaro compiler for WeTek_Core/Play - linux-3.10 are not able to build with gcc-8.1 --- config/path | 10 ++-- .../gcc-linaro-arm-linux-gnuebihf/package.mk | 54 +++++++++++++++++++ packages/linux/package.mk | 5 ++ projects/WeTek_Core/options | 3 ++ projects/WeTek_Play/options | 3 ++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk diff --git a/config/path b/config/path index d53ee100ef..71dfdb78e5 100644 --- a/config/path +++ b/config/path @@ -38,10 +38,14 @@ LIB_PREFIX=$SYSROOT_PREFIX/usr TARGET_PREFIX=$TOOLCHAIN/bin/$TARGET_NAME- # use linaro toolchain on 64/32 split builds -if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then - TARGET_KERNEL_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-linux-gnu/bin/aarch64-linux-gnu- +if [ -z "$TARGET_KERNEL_RELATIVE_PREFIX" ]; then + if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then + TARGET_KERNEL_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-linux-gnu/bin/aarch64-linux-gnu- + else + TARGET_KERNEL_PREFIX=$TARGET_PREFIX + fi else - TARGET_KERNEL_PREFIX=$TARGET_PREFIX + TARGET_KERNEL_PREFIX="$TOOLCHAIN/$TARGET_KERNEL_RELATIVE_PREFIX" fi FAKEROOT_SCRIPT=$BUILD/.fakeroot diff --git a/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk b/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk new file mode 100644 index 0000000000..4e33676424 --- /dev/null +++ b/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk @@ -0,0 +1,54 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2017-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="gcc-linaro-arm-linux-gnuebihf" +PKG_VERSION="7.2.1-2017.11" +PKG_SHA256="72919a3a99d4e28309bc8b0e615f44c65824ef012de50db3ffe9a34776e6f510" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="" +PKG_URL="https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-i686_arm-linux-gnueabihf.tar.xz" +PKG_SOURCE_DIR="gcc-linaro-$PKG_VERSION-i686_arm-linux-gnueabihf" +PKG_DEPENDS_HOST="ccache:host" +PKG_SECTION="lang" +PKG_SHORTDESC="Linaro Aarch64 GNU Linux Binary Toolchain" +PKG_TOOLCHAIN="manual" + +makeinstall_host() { + mkdir -p $TOOLCHAIN/lib/gcc-linaro-arm-linux-gnuebihf/ + cp -a * $TOOLCHAIN/lib/gcc-linaro-arm-linux-gnuebihf + + # wrap gcc and g++ with ccache like in gcc package.mk + PKG_GCC_PREFIX="$TOOLCHAIN/lib/gcc-linaro-arm-linux-gnuebihf/bin/arm-linux-gnueabihf-" + + cp "${PKG_GCC_PREFIX}gcc" "${PKG_GCC_PREFIX}gcc.real" +cat > "${PKG_GCC_PREFIX}gcc" << EOF +#!/bin/sh +$TOOLCHAIN/bin/ccache ${PKG_GCC_PREFIX}gcc.real "\$@" +EOF + + chmod +x "${PKG_GCC_PREFIX}gcc" + + cp "${PKG_GCC_PREFIX}g++" "${PKG_GCC_PREFIX}g++.real" +cat > "${PKG_GCC_PREFIX}g++" << EOF +#!/bin/sh +$TOOLCHAIN/bin/ccache ${PKG_GCC_PREFIX}g++.real "\$@" +EOF + + chmod +x "${PKG_GCC_PREFIX}g++" +} diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 96507364d9..130c916665 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -76,6 +76,11 @@ if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then HEADERS_ARCH=$TARGET_ARCH fi +if [ "$LINUX" = "amlogic-3.10" -a "$TARGET_KERNEL_ARCH" = "arm" -a "$TARGET_ARCH" = "arm" ]; then + PKG_DEPENDS_HOST="$PKG_DEPENDS_HOST gcc-linaro-arm-linux-gnuebihf:host" + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gcc-linaro-arm-linux-gnuebihf:host" +fi + if [ "$PKG_BUILD_PERF" != "no" ] && grep -q ^CONFIG_PERF_EVENTS= $PKG_KERNEL_CFG_FILE ; then PKG_BUILD_PERF="yes" PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET binutils elfutils libunwind zlib openssl" diff --git a/projects/WeTek_Core/options b/projects/WeTek_Core/options index 829bf2ddc4..f6dd1dd20d 100644 --- a/projects/WeTek_Core/options +++ b/projects/WeTek_Core/options @@ -33,6 +33,9 @@ # neon-vfpv4. TARGET_FPU="neon-fp16" TARGET_FEATURES="32bit" + + # TARGET_KERNEL_PREFIX + TARGET_KERNEL_RELATIVE_PREFIX="lib/gcc-linaro-arm-linux-gnuebihf/bin/arm-linux-gnueabihf-" ;; esac diff --git a/projects/WeTek_Play/options b/projects/WeTek_Play/options index 6434f24cbe..b61ac08897 100644 --- a/projects/WeTek_Play/options +++ b/projects/WeTek_Play/options @@ -33,6 +33,9 @@ # neon-vfpv4. TARGET_FPU="neon-fp16" TARGET_FEATURES="32bit" + + # TARGET_KERNEL_PREFIX + TARGET_KERNEL_RELATIVE_PREFIX="lib/gcc-linaro-arm-linux-gnuebihf/bin/arm-linux-gnueabihf-" ;; esac From d9258f6c1bdc015ad15640678e0da46ca2da3135 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Mon, 4 Jun 2018 21:04:26 +0200 Subject: [PATCH 9/9] gcc: fix describtion --- packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk b/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk index 4e33676424..0844b7e6b7 100644 --- a/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk +++ b/packages/lang/gcc-linaro-arm-linux-gnuebihf/package.mk @@ -26,7 +26,7 @@ PKG_URL="https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/a PKG_SOURCE_DIR="gcc-linaro-$PKG_VERSION-i686_arm-linux-gnueabihf" PKG_DEPENDS_HOST="ccache:host" PKG_SECTION="lang" -PKG_SHORTDESC="Linaro Aarch64 GNU Linux Binary Toolchain" +PKG_LONGDESC="Linaro ARMv8 GNU Linux Binary Toolchain" PKG_TOOLCHAIN="manual" makeinstall_host() {