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

package/libs/zlib: Tidy up and add optimization #1329

Closed
wants to merge 4 commits into from
Closed

package/libs/zlib: Tidy up and add optimization #1329

wants to merge 4 commits into from

Conversation

diizzyy
Copy link
Contributor

@diizzyy diizzyy commented Sep 5, 2017

Use build logic provided by toolchain instead of doing it manually and add some optimization.

Signed-off-by: Daniel Engberg daniel.engberg.lists@pyret.net

@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 5, 2017

Compile/Runtime tested: mvebu, Linksys WRT3200ACM, LEDE trunk
Compile/Runtime tested: ar71xx, TP-Link TL-WDR3600, LEDE trunk
Additionally compile tested: ipq806x by pkgadd

@diizzyy diizzyy changed the title libs/zlib: Use toolchain build logic libs/zlib: Tidy up and optimize for ARM Sep 5, 2017
@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 5, 2017

I've only enabled this for NEON (32-bit) capable platforms as it's the only platforms I can test it on.

@pkgadd
Copy link
Contributor

pkgadd commented Sep 15, 2017

I've given this a short build- and runtime test on:

  • ipq8065/ ZyXEL nbg6817 (arm_cortex-a15_neon-vfpv4)
  • ar71xx/ TP-Link TL-WDR4300 (mips_24kc)
  • ar71xx/ TP-Link TL-WDR3600 (mips_24kc)
  • ar71xx/ TP-Link TL-WR1043ND v1 (mips_24kc)
  • ar71xx/ TP-Link TL-WR941ND v2.6 (mips_24kc)

No issues found (NEON actually gets enabled in the arm_cortex-a15_neon-vfpv4 binaries, it's mostly a no-op for mips, of course), the systems boot and work as expected; I haven't done any performance tests though.

@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 16, 2017

@Noltari @lperkov @blogic @kaloz
Can you please have a look at this?

Copy link
Member

@hauke hauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know if these improvements for ARM CPUs are worth the patches, I know that they improve the speed by 3 to 10 times in some use cases.

+ state->havedict = 1;
+ Tracev((stderr, "inflate: dictionary set\n"));
+ return Z_OK;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you put this in separate patches please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want me to create an additional patch?
This is in the original pull request by Simon Hoise but if you want me to split it sure.

@@ -0,0 +1,100 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e75f66..24d7329 100644
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add the source of this patch as a comment please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no upstream source, I created it myself.

@@ -48,6 +48,11 @@ endef

TARGET_CFLAGS += $(FPIC)

ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
CMAKE_OPTIONS += \
-DARMv8=ON
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neon is also supported for ARMv7 CPUs.
Is it ok to activate the ARMv8 option on ARMv7 CPUs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's safe.
madler/zlib#251 (comment)

@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 19, 2017

@hauke
Anything I need to change?

@diizzyy
Copy link
Contributor Author

diizzyy commented Oct 15, 2017

Doing some quick benchmarks shows that compression level 9 gets about 10% faster, level 3 performs the same and so does deflate using minigzip64 (included as a test/sample app in zlib source code).

@diizzyy
Copy link
Contributor Author

diizzyy commented Oct 31, 2017

@yousong
Something you can have a look at?

@thess
Copy link
Member

thess commented Oct 31, 2017

@diizzyy - Could you break this up into 2 separate PRs. I see good value with the Makefile build cleanup. I don't have a strong preference on the minor ARM performance tweaks.

@@ -74,7 +56,7 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
$(1)/usr/lib/
mkdir -p $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
$(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this change? pkgconfig files are normally put in /usr/lib/pkgconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake defaults to share instead of lib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It's written in the CMakeLists.txt file. Thanks

@yousong
Copy link
Contributor

yousong commented Nov 1, 2017

Looks like chromium has already merged the optimisation in their local copy of zlib, so ACK for both patches from me. Thanks for the efforts.

@diizzyy
Copy link
Contributor Author

diizzyy commented Nov 6, 2017

@hauke @yousong
So we can push this or what's the current status?

@diizzyy
Copy link
Contributor Author

diizzyy commented Nov 18, 2017

Ping

@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 4, 2017

Ping again

@dougmoscrop
Copy link

dougmoscrop commented Dec 8, 2017

Would using https://github.com/Dead2/zlib-ng.git as an alternative to patching in the fixes be possible? I just compiled with it and it seemed to work. It includes not only the optimizations from this PR, but apparently others.

@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 8, 2017

Unfortunately it doesn't support all platforms LEDE supports such as mips.

@dougmoscrop
Copy link

Oh I see. Does LEDE build system have the ability to specify a different package to satisfy a dependency like zlib but only for certain architecture? Sorry I am very new to this.

@diizzyy diizzyy changed the title libs/zlib: Tidy up and optimize for ARM libs/zlib: Tidy up and add optimization Dec 10, 2017
Use build logic provided by toolchain instead of doing it manually.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
This adds two optimizations for ARM:
NEON optimized Adler(-)32 checksum algorithm (ARMv7 and newer NEON CPUs)
ARM(v7+) specific optimization for inflate
I've also connected inflate optimization to the build using the following
source as template.
mirror/chromium@0397489#diff-a62ad2db6c83dbc205d34bb9a8884f16

Additional info:
https://codereview.chromium.org/2676493007/
https://codereview.chromium.org/2722063002/

Sources:
madler/zlib#251 (only the first commit)
madler/zlib#256

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy diizzyy changed the title libs/zlib: Tidy up and add optimization package/libs/zlib: Tidy up and add optimization Dec 10, 2017
@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 11, 2017

@pprindeville
Can you please have a look?

endef

TARGET_CFLAGS += $(FPIC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It originates from https://github.com/lede-project/source/blob/master/package/libs/zlib/Makefile#L52
Turning to Google for guidance I found several occurrences about this:
https://bugzilla.redhat.com/show_bug.cgi?id=832545

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that other package Makefile's have it... so it's nothing out of the ordinary.

Was just wondering if it was related or a target-of-opportunity while you were cleaning things up.

@@ -46,27 +49,21 @@ define Package/zlib-dev/description
This package includes the development support files.
endef

CONFIGURE_VARS := \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we don't need CONFIGURE_VARS or CONFIGURE_ARGS either?

Copy link
Contributor Author

@diizzyy diizzyy Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All needed information is provided by the toolchain or at least neither myself or pkgadd has managed to trigger something that fails.


config ZLIB_OPTIMIZE_SPEED
bool "Optimize for speed"
default n
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n is already default no need to specify this.

@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 11, 2017

@hauke
Fixed, thanks for the review!

Add option to use O3 optimization as not all devices have
space constraints. This option is default using GCC in upstream
but isn't in the CMake makefile for some reason.

Source: https://github.com/madler/zlib/blob/master/configure#L170

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 12, 2017

Updated so it strips any set -O* flag

@commodo
Copy link
Contributor

commodo commented Dec 12, 2017

@diizzyy
since you're doing this, would it be too much trouble to also add this patch https://github.com/commodo/lede/commit/bac4e9dda20a44e6ed5d435a7ce2ff7e8e6c9f51 ?
[edit]
you don't need to add me as the author if this patch, if pushing it with this PR :)
[/edit]
if doing the cmake version, you can drop this part

+HOST_CONFIGURE_ARGS := \
+	--prefix=$(STAGING_DIR_HOSTPKG)
+

i've validated cmake works without it ; that seems to be needed only for the old ./configure script that's in zlib

i need the zlib/host for Python/Python3 ; because, it seems the host pip/pip3 needs this to work ;
i suspect in older versions this worked, because some of the host's build env would be used in the build, and then the zlib-dev from the host distro would be used ;
now, the host-build does not seem to have any -I/usr/include stuff, which is good

and it also seems that Python/Python3 does not like it if the zlib-dev package is too old, so using this zlib/host would be good for this as well

@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 12, 2017

@commodo
Sure, so I just need to add L24 and L92?

@commodo
Copy link
Contributor

commodo commented Dec 12, 2017

yep ; just those 2 lines are needed for host-build + cmake to work ;

thanks :)

Some packages such as Python/Python3 (host pip/pip3) needs this
to compile.

More detailed explanation provided by Alexandru:

"i need the zlib/host for Python/Python3 ; because, it seems the
host pip/pip3 needs this to work ; i suspect in older versions
this worked, because some of the host's build env would be used
in the build, and then the zlib-dev from the host distro would
be used ; now, the host-build does not seem to have any
-I/usr/include stuff, which is good

and it also seems that Python/Python3 does not like it if the
zlib-dev package is too old, so using this zlib/host would be
good for this as well"

Source:
#1329 (comment)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy
Copy link
Contributor Author

diizzyy commented Dec 12, 2017

@commodo
Can you have a look to make sure I did what you asked me to do? :-)

@@ -96,5 +97,6 @@ define Package/zlib-dev/install
$(1)/usr/lib/pkgconfig/
endef

$(eval $(call HostBuild))
Copy link
Contributor

@commodo commodo Dec 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
LGTM

thanks :)

commodo added a commit to commodo/packages that referenced this pull request Dec 13, 2017
This should fix the zlibmodule build on the host side.

Usually, if zlib is not found, Python/Python3 builds fine
without it, but there are some cases where the Python/Python3
interpreter on the host-side requires zlib to run.

At the moment, zlib does not have a host-build.
This should be available when this PR gets merged:
lede-project/source#1329
[ or a similar one that contains host-build support for zlib ].

In the meantime, this change can go into Python/Python3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
@commodo
Copy link
Contributor

commodo commented Dec 31, 2017

ping;
there seems to be some hesitance here ;

is this ready to be merged as is ? or would it be easier to split up this PR into 2 parts [1 for the Makefile changes & 1 for the optimization patches] ?

i'm interested in the HostBuild changes to be able to fix this, the Python/Python3 host-builds:
http://downloads.lede-project.org/snapshots/faillogs/mips_24kc/packages/python3/host-compile.txt
http://downloads.lede-project.org/snapshots/faillogs/mips_24kc/packages/python/host-compile.txt

@commodo
Copy link
Contributor

commodo commented Dec 31, 2017

oh... those links just vanished / are being regenerated....
hmm ; will post output when they become available

@hauke
Copy link
Member

hauke commented Dec 31, 2017

This does not compile for me on a cortex a15:

hauke@hauke-desktop:~/openwrt/lede$ make package/zlib/compile V=99
make[2]: Entering directory '/home/hauke/openwrt/lede/scripts/config'
make[2]: Leaving directory '/home/hauke/openwrt/lede/scripts/config'
make[1]: Entering directory '/home/hauke/openwrt/lede'
make[2]: Entering directory '/home/hauke/openwrt/lede/package/libs/toolchain'
echo "libc" >> /home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
echo "libgcc" >> /home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
echo "libpthread" >> /home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
make[2]: Leaving directory '/home/hauke/openwrt/lede/package/libs/toolchain'
make[2]: Entering directory '/home/hauke/openwrt/lede/package/libs/zlib'
touch /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.prepared_6686a4316f9479949bd299a085b74f61_6664517399ebbbc92a37c5bb081b5c53_check
. /home/hauke/openwrt/lede/include/shell.sh; xzcat /home/hauke/openwrt/lede/dl/zlib-1.2.11.tar.xz | tar -C /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.. -xf - 
[ ! -d ./src/ ] || cp -fpR ./src/* /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11

Applying ./patches/001-neon-implementation-of-adler32.patch using plaintext: 
patching file CMakeLists.txt
patching file adler32.c
patching file contrib/README.contrib
patching file contrib/arm/neon_adler32.c

Applying ./patches/002-arm-specific-optimisations-for-inflate.patch using plaintext: 
patching file contrib/arm/inffast.c
patching file contrib/arm/inflate.c
patching file contrib/arm/chunkcopy.h
patching file contrib/arm/inffast.c
patching file contrib/arm/inflate.c

Applying ./patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch using plaintext: 
patching file CMakeLists.txt
touch /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.prepared_6686a4316f9479949bd299a085b74f61_6664517399ebbbc92a37c5bb081b5c53
rm -f /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.configured_*
rm -f /home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.zlib_installed
mkdir -p /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11
(cd /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11; CFLAGS="-Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11:zlib-1.2.11 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic " CXXFLAGS="-Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11:zlib-1.2.11 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic " LDFLAGS="-L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib -znow -zrelro " cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_C_COMPILER="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc" -DCMAKE_C_COMPILER_ARG1="" -DCMAKE_CXX_COMPILER="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-g++" -DCMAKE_CXX_COMPILER_ARG1="" -DCMAKE_ASM_COMPILER="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc" -DCMAKE_ASM_COMPILER_ARG1="" -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib -znow -zrelro" -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib -znow -zrelro -Wl,-Bsymbolic-functions" -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib -znow -zrelro -Wl,-Bsymbolic-functions" -DCMAKE_AR="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc-ar" -DCMAKE_NM="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc-nm" -DCMAKE_RANLIB="/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc-ranlib" -DCMAKE_FIND_ROOT_PATH="/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr;/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/usr -DDL_LIBRARY=/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi -DCMAKE_PREFIX_PATH=/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi -DCMAKE_SKIP_RPATH=TRUE -DARMv8=ON /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11 )
-- The C compiler identification is GNU 5.5.0
-- Check for working C compiler: /home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc
-- Check for working C compiler: /home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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 unistd.h
-- Looking for unistd.h - found
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_ASM_COMPILER
    CMAKE_ASM_COMPILER_ARG1
    CMAKE_CXX_COMPILER
    CMAKE_CXX_COMPILER_ARG1
    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
    CMAKE_MODULE_LINKER_FLAGS
    DL_LIBRARY


-- Build files have been written to: /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11
touch /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.configured_926a5914ffa0453d7114454b483067d2
rm -f /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.built
touch /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.built_check
CFLAGS="-Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11:zlib-1.2.11 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic  -I/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/include -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/include -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/include/fortify -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/include " CXXFLAGS="-Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11:zlib-1.2.11 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic  -I/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/include -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/include -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/include/fortify -I/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/include " LDFLAGS="-L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/usr/lib -L/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib -znow -zrelro " make -j1 -C /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -iremap/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11:zlib-1.2.11 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" CMAKE_COMMAND='/home/hauke/openwrt/lede/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 ;
make[3]: Entering directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
make[4]: Entering directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
make[5]: Entering directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
Scanning dependencies of target zlib
make[5]: Leaving directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
make[5]: Entering directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
[  2%] Building C object CMakeFiles/zlib.dir/adler32.o
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/adler32.c: In function 'adler32':
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/adler32.c:140:11: note: #pragma message: Using NEON-ized Adler32.
 #  pragma message("Using NEON-ized Adler32.")
           ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/adler32.c:141:12: warning: implicit declaration of function 'NEON_adler32' [-Wimplicit-function-declaration]
     return NEON_adler32(adler, buf, len);
            ^
[  4%] Building C object CMakeFiles/zlib.dir/compress.o
[  7%] Building C object CMakeFiles/zlib.dir/crc32.o
[  9%] Building C object CMakeFiles/zlib.dir/deflate.o
[ 11%] Building C object CMakeFiles/zlib.dir/gzclose.o
[ 14%] Building C object CMakeFiles/zlib.dir/gzlib.o
[ 16%] Building C object CMakeFiles/zlib.dir/gzread.o
[ 19%] Building C object CMakeFiles/zlib.dir/gzwrite.o
[ 21%] Building C object CMakeFiles/zlib.dir/infback.o
[ 23%] Building C object CMakeFiles/zlib.dir/inftrees.o
[ 26%] Building C object CMakeFiles/zlib.dir/contrib/arm/inflate.o
In file included from /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:10:0,
                 from /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/inflate.c:87:
/home/hauke/openwrt/lede/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-5.5.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/5.5.0/include/arm_neon.h:31:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
 #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
  ^
In file included from /home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/inflate.c:87:0:
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:18:9: error: unknown type name 'uint8x16_t'
 typedef uint8x16_t chunkcopy_chunk_t;
         ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:117:15: error: unknown type name 'uint8x16_t'
 static inline uint8x16_t chunkset_vld1q_dup_u8x8(const unsigned char FAR * Z_RESTRICT from) {
               ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h: In function 'chunkset_vld1q_dup_u8x8':
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:124:5: error: unknown type name 'uint8x8_t'
     uint8x8_t h = vld1_u8(from);
     ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:124:19: warning: implicit declaration of function 'vld1_u8' [-Wimplicit-function-declaration]
     uint8x8_t h = vld1_u8(from);
                   ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:125:12: warning: implicit declaration of function 'vcombine_u8' [-Wimplicit-function-declaration]
     return vcombine_u8(h, h);
            ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h: In function 'chunkset_core':
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:138:5: error: unknown type name 'uint8x16_t'
     uint8x16_t f;
     ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:143:13: warning: implicit declaration of function 'vld1q_dup_u8' [-Wimplicit-function-declaration]
         f = vld1q_dup_u8(out - 1);
             ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:144:9: warning: implicit declaration of function 'vst1q_u8' [-Wimplicit-function-declaration]
         vst1q_u8(out, f);
         ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:154:13: warning: implicit declaration of function 'vreinterpretq_u8_u16' [-Wimplicit-function-declaration]
         f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2)));
             ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:154:34: warning: implicit declaration of function 'vld1q_dup_u16' [-Wimplicit-function-declaration]
         f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2)));
                                  ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:168:13: warning: implicit declaration of function 'vreinterpretq_u8_u32' [-Wimplicit-function-declaration]
         f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4)));
             ^
/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/contrib/arm/chunkcopy.h:168:34: warning: implicit declaration of function 'vld1q_dup_u32' [-Wimplicit-function-declaration]
         f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4)));
                                  ^
CMakeFiles/zlib.dir/build.make:302: recipe for target 'CMakeFiles/zlib.dir/contrib/arm/inflate.o' failed
make[5]: *** [CMakeFiles/zlib.dir/contrib/arm/inflate.o] Error 1
make[5]: Leaving directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/zlib.dir/all' failed
make[4]: *** [CMakeFiles/zlib.dir/all] Error 2
make[4]: Leaving directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
Makefile:140: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11'
Makefile:101: recipe for target '/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.built' failed
make[2]: *** [/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/zlib-1.2.11/.built] Error 2
make[2]: Leaving directory '/home/hauke/openwrt/lede/package/libs/zlib'
package/Makefile:109: recipe for target 'package/libs/zlib/compile' failed
make[1]: *** [package/libs/zlib/compile] Error 2
make[1]: Leaving directory '/home/hauke/openwrt/lede'
/home/hauke/openwrt/lede/include/toplevel.mk:216: recipe for target 'package/zlib/compile' failed
make: *** [package/zlib/compile] Error 2

This is my config:

hauke@hauke-desktop:~/openwrt/lede$ ./scripts/diffconfig.sh 
CONFIG_TARGET_layerscape=y
CONFIG_TARGET_layerscape_armv8_32b=y
CONFIG_TARGET_layerscape_armv8_32b_DEVICE_ls1043ardb=y

@hauke
Copy link
Member

hauke commented Dec 31, 2017

The fpu feature is not set for this target, but it has a fpu, I am just compiling this toolchain again to see if this was the problem.

jow- pushed a commit that referenced this pull request Jan 2, 2018
Some packages such as Python/Python3 (host pip/pip3) needs this
to compile.

More detailed explanation provided by Alexandru:

"i need the zlib/host for Python/Python3 ; because, it seems the
host pip/pip3 needs this to work ; i suspect in older versions
this worked, because some of the host's build env would be used
in the build, and then the zlib-dev from the host distro would
be used ; now, the host-build does not seem to have any
-I/usr/include stuff, which is good

and it also seems that Python/Python3 does not like it if the
zlib-dev package is too old, so using this zlib/host would be
good for this as well"

Source:
#1329 (comment)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@hauke
Copy link
Member

hauke commented Jan 2, 2018

Thank you for the patch it was applied to master.

@hauke hauke closed this Jan 2, 2018
SpiralP pushed a commit to SpiralP/lede-source that referenced this pull request Jan 2, 2018
Some packages such as Python/Python3 (host pip/pip3) needs this
to compile.

More detailed explanation provided by Alexandru:

"i need the zlib/host for Python/Python3 ; because, it seems the
host pip/pip3 needs this to work ; i suspect in older versions
this worked, because some of the host's build env would be used
in the build, and then the zlib-dev from the host distro would
be used ; now, the host-build does not seem to have any
-I/usr/include stuff, which is good

and it also seems that Python/Python3 does not like it if the
zlib-dev package is too old, so using this zlib/host would be
good for this as well"

Source:
lede-project#1329 (comment)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
salzmdan pushed a commit to salzmdan/packages that referenced this pull request Jan 8, 2018
This should fix the zlibmodule build on the host side.

Usually, if zlib is not found, Python/Python3 builds fine
without it, but there are some cases where the Python/Python3
interpreter on the host-side requires zlib to run.

At the moment, zlib does not have a host-build.
This should be available when this PR gets merged:
lede-project/source#1329
[ or a similar one that contains host-build support for zlib ].

In the meantime, this change can go into Python/Python3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
jollaman999 pushed a commit to jollaman999/openwrt that referenced this pull request Jan 13, 2018
Some packages such as Python/Python3 (host pip/pip3) needs this
to compile.

More detailed explanation provided by Alexandru:

"i need the zlib/host for Python/Python3 ; because, it seems the
host pip/pip3 needs this to work ; i suspect in older versions
this worked, because some of the host's build env would be used
in the build, and then the zlib-dev from the host distro would
be used ; now, the host-build does not seem to have any
-I/usr/include stuff, which is good

and it also seems that Python/Python3 does not like it if the
zlib-dev package is too old, so using this zlib/host would be
good for this as well"

Source:
lede-project/source#1329 (comment)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
jow- pushed a commit to jow-/packages that referenced this pull request Jan 15, 2018
This should fix the zlibmodule build on the host side.

Usually, if zlib is not found, Python/Python3 builds fine
without it, but there are some cases where the Python/Python3
interpreter on the host-side requires zlib to run.

At the moment, zlib does not have a host-build.
This should be available when this PR gets merged:
lede-project/source#1329
[ or a similar one that contains host-build support for zlib ].

In the meantime, this change can go into Python/Python3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lynxis pushed a commit to lynxis/packages that referenced this pull request Jan 3, 2019
This should fix the zlibmodule build on the host side.

Usually, if zlib is not found, Python/Python3 builds fine
without it, but there are some cases where the Python/Python3
interpreter on the host-side requires zlib to run.

At the moment, zlib does not have a host-build.
This should be available when this PR gets merged:
lede-project/source#1329
[ or a similar one that contains host-build support for zlib ].

In the meantime, this change can go into Python/Python3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants