Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile issue LibreELEC x86_64 —> aarch64 #910

Closed
heitbaum opened this issue Mar 23, 2021 · 4 comments
Closed

Cross compile issue LibreELEC x86_64 —> aarch64 #910

heitbaum opened this issue Mar 23, 2021 · 4 comments

Comments

@heitbaum
Copy link

heitbaum commented Mar 23, 2021

Thought to give zlib-ng a try.

compiling using:

  • PROJECT=Generic ARCH=x86_64 TARGET_CPU=tigerlake IMAGE_SUFFIX=tigerlake s/build zlib worked, I will try a full build next.
  • PROJECT=Amlogic ARCH=aarch64 DEVICE=AMLG12 UBOOT_SYSTEM=odroid-n2 s/build zlib Failed

Logs

Pkg file below

more packages/compress/zlib/package.mk 
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)

PKG_NAME="zlib"
#PKG_VERSION="1.2.11"
#PKG_SHA256="4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
PKG_VERSION="2.0.1"
PKG_SHA256="8599893f9b78bf979c1a1d6549b730367c9186560c6879590354998cc55428cf"
PKG_LICENSE="OSS"
#PKG_SITE="http://www.zlib.net"
#PKG_URL="http://zlib.net/${PKG_NAME}-${PKG_VERSION}.tar.xz"
PKG_SITE="https://github.com/zlib-ng/zlib-ng"
PKG_URL="https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_HOST="cmake:host"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="A general purpose (ZIP) data compression library."
PKG_TOOLCHAIN="cmake-make"

PKG_CMAKE_OPTS_HOST="-DZLIB_COMPAT=ON"

PKG_CMAKE_OPTS_TARGET="-DZLIB_COMPAT=ON"

Error on aarch64

BUILD      zlib (target)
    TOOLCHAIN      cmake (auto-detect)
Executing (target): cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=/storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/toolchain/etc/cmake-aarch64-libreelec-linux-gnueabi.conf -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=MinSizeRel -DZLIB_COMPAT=ON /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.1
-- Using CMake version 3.19.7
-- ZLIB_HEADER_VERSION: 1.2.11
-- ZLIBNG_HEADER_VERSION: 2.0.1
-- Arch not recognized, falling back to cmake arch: 'aarch64'
-- Basearch of 'aarch64' has been detected as: 'arm'
-- Using CMake toolchain: /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/toolchain/etc/cmake-aarch64-libreelec-linux-gnueabi.conf
-- ARM floating point arch: -mfloat-abi=softfp
-- Architecture supports unaligned reads
-- Architecture supports unaligned reads of > 4 bytes
-- sizeof(void *) is  bytes
CMake Error at CMakeLists.txt:453 (message):
  sizeof(void *) is neither 32 nor 64 bit


-- Configuring incomplete, errors occurred!
See also "/storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.1/.aarch64-libreelec-linux-gnueabi/CMakeFiles/CMakeOutput.log".
See also "/storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.1/.aarch64-libreelec-linux-gnueabi/CMakeFiles/CMakeError.log".
FAILURE: s/build zlib during configure_target (default)
@heitbaum
Copy link
Author

heitbaum commented Mar 23, 2021

A full x86_x64 (not cross compiled) is working

A quick run test is ok. Will need to do some full testing, but as a start 👍no performance testing yet.

PROJECT=Generic ARCH=x86_64 TARGET_CPU=tigerlake IMAGE_SUFFIX=tigerlake make image

nuc11:~ # ls -la /usr/lib/libz.so.1.2.11.zlib-ng
-rw-r--r--    1 root     root         92696 Mar 23 22:37 /usr/lib/libz.so.1.2.11.zlib-ng
nuc11:~ # curl -V
curl 7.75.0 (x86_64-libreelec-linux-gnu) libcurl/7.75.0 OpenSSL/1.1.1j zlib/1.2.11.zlib-ng libidn2/2.3.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2021-02-03
Protocols: file ftp ftps http https rtmp rtsp 
Features: alt-svc AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets

this compares with zlib:
-rw-r--r-- 1 root root 76264 Mar 22 22:57 /usr/lib/libz.so.1.2.11

@nmoinvaz
Copy link
Member

I believe your aarch64 issue is fixed by #898. Have you tested against latest develop?

@Dead2
Copy link
Member

Dead2 commented Mar 23, 2021

This should work in 2.0.2, please reopen if it does not.

@Dead2 Dead2 closed this as completed Mar 23, 2021
@heitbaum
Copy link
Author

@nmoinvaz @Dead2 - great turn around time 👍

Build tested for aarch64 AMLG12, will need to do a run test. But will leave it in my dev tree now and put it through it’s paces.

PROJECT=Amlogic ARCH=aarch64 DEVICE=AMLG12 UBOOT_SYSTEM=odroid-n2 s/build zlib
CLEAN      zlib
    *      Removing /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.2 ...
    *      Removing /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/install_pkg/zlib-2.0.2 ...
UNPACK      zlib
BUILD      zlib (target)
    TOOLCHAIN      cmake-make
Executing (target): cmake -DCMAKE_TOOLCHAIN_FILE=/storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/toolchain/etc/cmake-aarch64-libreelec-linux-gnueabi.conf -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=MinSizeRel -DZLIB_COMPAT=ON /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.2
-- Using CMake version 3.19.7
-- ZLIB_HEADER_VERSION: 1.2.11
-- ZLIBNG_HEADER_VERSION: 2.0.2
-- The C compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/toolchain/bin/aarch64-libreelec-linux-gnueabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Arch not recognized, falling back to cmake arch: 'aarch64'
-- Basearch of 'aarch64' has been detected as: 'arm'
-- Using CMake toolchain: /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/toolchain/etc/cmake-aarch64-libreelec-linux-gnueabi.conf
-- Architecture supports unaligned reads
-- Architecture supports unaligned reads of > 4 bytes
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for sys/sdt.h
-- Looking for sys/sdt.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for strerror
-- Looking for strerror - found
-- Performing Test HAVE_NO_INTERPOSITION
-- Performing Test HAVE_NO_INTERPOSITION - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL - Success
-- Performing Test HAVE_BUILTIN_CTZ
-- Performing Test HAVE_BUILTIN_CTZ - Success
-- Performing Test HAVE_BUILTIN_CTZLL
-- Performing Test HAVE_BUILTIN_CTZLL - Success
-- Performing Test HAVE_PTRDIFF_T
-- Performing Test HAVE_PTRDIFF_T - Success
-- Architecture-specific source files: arch/arm/armfeature.c;arch/arm/crc32_acle.c;arch/arm/insert_string_acle.c;arch/arm/adler32_neon.c;arch/arm/chunkset_neon.c;arch/arm/slide_neon.c
-- The following features have been enabled:

 * CMAKE_BUILD_TYPE, Build type: MinSizeRel (selected)
 * WITH_GZFILEOP, Compile with support for gzFile related functions
 * ZLIB_COMPAT, Compile with zlib compatible API
 * ZLIB_ENABLE_TESTS, Build test binaries
 * WITH_OPTIM, Build with optimisation
 * WITH_NEW_STRATEGIES, Use new strategies
 * WITH_UNALIGNED, Support unaligned reads on platforms that support it
 * WITH_ACLE, Build with ACLE
 * WITH_NEON, Build with NEON intrinsics
 * ACLE_CRC, Support ACLE optimized CRC hash generation, using "-march=armv8-a+crc"
 * NEON_ADLER32, Support NEON instructions in adler32, using "-march=armv8-a+simd"
 * NEON_SLIDEHASH, Support NEON instructions in slide_hash, using "-march=armv8-a+simd"

-- The following features have been disabled:

 * ZLIB_DUAL_LINK, Dual link tests against system zlib
 * WITH_SANITIZER, Build with sanitizer (Memory, Address, Undefined)
 * WITH_FUZZERS, Build test/fuzz
 * WITH_NATIVE_INSTRUCTIONS, Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)
 * WITH_MAINTAINER_WARNINGS, Build with project maintainer warnings
 * WITH_CODE_COVERAGE, Enable code coverage reporting
 * WITH_INFLATE_STRICT, Build with strict inflate distance checking
 * WITH_INFLATE_ALLOW_INVALID_DIST, Build with zero fill for inflate invalid distances
 * INSTALL_UTILS, Copy minigzip and minideflate during install

-- Configuring done
-- Generating done
-- Build files have been written to: /storage/home-rudi/LibreELEC.tv/build.LibreELEC-AMLG12.aarch64-10.0-devel/build/zlib-2.0.2/.aarch64-libreelec-linux-gnueabi
Executing (target): make 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants