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/wolfssl build fail on ipq807x #11866

Closed
ptpt52 opened this issue Jan 24, 2023 · 13 comments
Closed

package/libs/wolfssl build fail on ipq807x #11866

ptpt52 opened this issue Jan 24, 2023 · 13 comments
Labels
bug issue report with a confirmed bug

Comments

@ptpt52
Copy link
Contributor

ptpt52 commented Jan 24, 2023

Describe the bug

build on ubuntu 18.04

ERROR: package/libs/wolfssl failed to build (build variant: cpu-crypto).

make V=s -j1 package/libs/wolfssl/compile

make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[1]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt'
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/toolchain'
echo "libc" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "librt" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.13#0.08#0.20
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/libtool'
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/libtool'
time: package/libs/libtool/compile#0.11#0.09#0.19
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
time: package/libs/wolfssl/regular/compile#0.21#0.11#0.30
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
Makefile:205: *** Invalid file operation: <preinst.arm-ce.  Stop.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
time: package/libs/wolfssl/cpu-crypto/compile#0.19#0.09#0.26
    ERROR: package/libs/wolfssl failed to build (build variant: cpu-crypto).
package/Makefile:114: recipe for target 'package/libs/wolfssl/compile' failed
make[1]: *** [package/libs/wolfssl/compile] Error 1
make[1]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt'
/mnt/Data/Sources/openwrt/x-wrt/include/toplevel.mk:229: recipe for target 'package/libs/wolfssl/compile' failed
make: *** [package/libs/wolfssl/compile] Error 2

Also build failed on ubuntu 22.04:

Configuring libnfnetlink0.
Configuring iperf3.
Configuring wireless-tools.
Configuring urngd.
Configuring iftop.
Configuring luci-i18n-firewall-zh-cn.
Configuring 6to4.
Configuring ppp-mod-pppoe.
Collected errors:
 * check_data_file_clashes: Package libwolfsslcpu-crypto5.5.4.15181848 wants to install file /data/x-wrt/build_dir/target-aarch64_cortex-a53_musl/root-ipq807x/usr/lib/libwolfssl.so.5.5.4.15181848
        But that file is already provided by package  * libwolfssl5.5.4.15181848
 * opkg_install_cmd: Cannot install package libwolfsslcpu-crypto5.5.4.15181848.
make[2]: *** [package/Makefile:70: package/install] Error 255
make[2]: Leaving directory '/data/x-wrt'
make[1]: *** [package/Makefile:111: /data/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/data/x-wrt'
make: *** [/data/x-wrt/include/toplevel.mk:231: world] Error 2
@ptpt52 ptpt52 added the bug issue report with a confirmed bug label Jan 24, 2023
@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

ping @cotequeiroz

@xabolcs
Copy link
Contributor

xabolcs commented Jan 24, 2023

Duplicate of #11839

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

Duplicate of #11839

@xabolcs hi,
here I report 2 issue.

  1. build failed on ubuntu 18.04, this looks like something wrong related to Makefile.
  2. build on ubuntu 22.04 and this duplicate of Conflicts between libraries libwolfsslcpu-crypto and libwolfssl with imagebuilder #11839

@robimarko
Copy link
Contributor

Please post the log with make -j1 V=s, I find it personally weird as I was building in CI on 22.04 for months and the CPU variant of wolfssl always built fine

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

@robimarko it build fine on ubuntu 22.04, the pkg check_data_file_clashes could be ignored. cause by:

CONFIG_PACKAGE_libwolfsslcpu-crypto=y
CONFIG_PACKAGE_libwolfssl=m

the build fail issue on ubuntu 18.04 is really the problem.
make -j1 V=s log:

make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[1]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt'
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/toolchain'
echo "libc" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "librt" >> /mnt/Data/Sources/openwrt/x-wrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.13#0.08#0.20
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/libtool'
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/libtool'
time: package/libs/libtool/compile#0.11#0.09#0.19
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
time: package/libs/wolfssl/regular/compile#0.21#0.11#0.30
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
Makefile:205: *** Invalid file operation: <preinst.arm-ce.  Stop.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
time: package/libs/wolfssl/cpu-crypto/compile#0.19#0.09#0.26
    ERROR: package/libs/wolfssl failed to build (build variant: cpu-crypto).
package/Makefile:114: recipe for target 'package/libs/wolfssl/compile' failed
make[1]: *** [package/libs/wolfssl/compile] Error 1
make[1]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt'
/mnt/Data/Sources/openwrt/x-wrt/include/toplevel.mk:229: recipe for target 'package/libs/wolfssl/compile' failed
make: *** [package/libs/wolfssl/compile] Error 2

@robimarko
Copy link
Contributor

That is not from running with V=s for sure

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

@robimarko
I try make V=s package/libs/wolfssl/clean
it also fail

make V=s package/libs/wolfssl/clean
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/scripts/config'
make[1]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt'
make[2]: Entering directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
rm -rf /mnt/Data/Sources/openwrt/x-wrt/build_dir/target-aarch64_cortex-a53_musl/wolfssl-cpu-crypto/wolfssl-5.5.4-stable
Makefile:205: *** Invalid file operation: <preinst.arm-ce.  Stop.
make[2]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt/package/libs/wolfssl'
time: package/libs/wolfssl/cpu-crypto/clean#0.17#0.09#0.25
    ERROR: package/libs/wolfssl failed to build (build variant: cpu-crypto).
package/Makefile:114: recipe for target 'package/libs/wolfssl/clean' failed
make[1]: *** [package/libs/wolfssl/clean] Error 1
make[1]: Leaving directory '/mnt/Data/Sources/openwrt/x-wrt'
/mnt/Data/Sources/openwrt/x-wrt/include/toplevel.mk:229: recipe for target 'package/libs/wolfssl/clean' failed
make: *** [package/libs/wolfssl/clean] Error 2

@robimarko
Copy link
Contributor

robimarko commented Jan 24, 2023

You were right, and I figured out the issue.
The issue is that make only got the ability to read from files with $(file <) in v4.2 but 18.04 ships make v4.1.
Confirmed by manually compiling v4.2 on 18.04 and using it, that works just fine.

No clue what is the pre 4.2 alternative

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

@robimarko

would this work? use cat

diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 1500a2cda79..a870a8a5dcd 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -162,7 +162,7 @@ else ifdef CONFIG_aarch64
     TARGET_CFLAGS:=$(TARGET_CFLAGS:-mcpu%=-mcpu%+crypto)
     WOLFSSL_NOASM_REGEX:=^bcm27xx/.*
     Package/libwolfsslcpu-crypto/preinst=\
-       $(subst @@WOLFSSL_NOASM_REGEX@@,$(WOLFSSL_NOASM_REGEX),$(file <preinst.arm-ce))
+       $(subst @@WOLFSSL_NOASM_REGEX@@,$(WOLFSSL_NOASM_REGEX),$(shell cat preinst.arm-ce))
 else ifdef CONFIG_TARGET_x86_64
        CONFIGURE_ARGS += --enable-intelasm
 endif

@robimarko
Copy link
Contributor

That will get it compiling, but I am not sure if the desired behaviour will be the same

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

ping @nbd168

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 24, 2023

ping @jow-

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jan 25, 2023

x-wrt@c636901

I am trying to rewrite the Makefile to achieve the same goal

ptpt52 added a commit to x-wrt/x-wrt that referenced this issue Jan 26, 2023
Fixes: openwrt#11866

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this issue Feb 5, 2023
Inline the preinst.arm-ce script. Support for including was added in
make 4.2 and is not working with older make versions.

Fixes: openwrt#11866
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Arie pushed a commit to Arie/openwrt-rb5009 that referenced this issue Feb 8, 2023
Inline the preinst.arm-ce script. Support for including was added in
make 4.2 and is not working with older make versions.

Fixes: openwrt/openwrt#11866
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
1715173329 pushed a commit to immortalwrt/immortalwrt that referenced this issue Aug 12, 2023
Inline the preinst.arm-ce script. Support for including was added in
make 4.2 and is not working with older make versions.

Fixes: openwrt/openwrt#11866
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(cherry picked from commit fcde517)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue report with a confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants