Modify

Opened 2 years ago

Last modified 14 months ago

#20519 new defect

make-ext4fs build error

Reported by: d.buffa@… Owned by: developers
Priority: high Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc:

Description

Compiling BCM53XX ARM

make[3]: Entering directory `/home/daniele/dev/openwrt/openwrt/tools/make-ext4fs'
make -C /home/daniele/dev/openwrt/openwrt/build_dir/host/make-ext4fs-2015-09-14 make_ext4fs STATIC=1
make[4]: Entering directory `/home/daniele/dev/openwrt/openwrt/build_dir/host/make-ext4fs-2015-09-14'
cc -o make_ext4fs allocate.o canned_fs_config.o contents.o crc16.o ext4fixup.o ext4_sb.o ext4_utils.o extent.o indirect.o make_ext4fs_main.o make_ext4fs.o sha1.o uuid.o wipe.o libsparse/libsparse.a -Wl,-Bstatic -lz -Wl,-Bdynamic
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[4]: *** [make_ext4fs] Error 1

Attachments (0)

Change History (13)

comment:1 Changed 2 years ago by olewales

Same here. Lantiq, latest trunk (46942)

make[4]: Entering directory '/home/builder/openwrt-trunk-WD8970/build_dir/host/make-ext4fs-2015-09-14'
cc -o make_ext4fs allocate.o canned_fs_config.o contents.o crc16.o ext4fixup.o ext4_sb.o ext4_utils.o extent.o indirect.o make_ext4fs_main.o make_ext4fs.o sha1.o uuid.o wipe.o libsparse/libsparse.a -Wl,-Bstatic -lz -Wl,-Bdynamic
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:30: recipe for target 'make_ext4fs' failed
make[4]: *** [make_ext4fs] Error 1
make[4]: Leaving directory '/home/builder/openwrt-trunk-WD8970/build_dir/host/make-ext4fs-2015-09-14'
Makefile:40: recipe for target '/home/builder/openwrt-trunk-WD8970/build_dir/host/make-ext4fs-2015-09-14/.built' failed
make[3]: *** [/home/builder/openwrt-trunk-WD8970/build_dir/host/make-ext4fs-2015-09-14/.built] Error 2
make[3]: Leaving directory '/home/builder/openwrt-trunk-WD8970/tools/make-ext4fs'
tools/Makefile:125: recipe for target 'tools/make-ext4fs/compile' failed
make[2]: *** [tools/make-ext4fs/compile] Error 2
make[2]: Leaving directory '/home/builder/openwrt-trunk-WD8970'
tools/Makefile:124: recipe for target '/home/builder/openwrt-trunk-WD8970/staging_dir/target-mips_34kc+dsp_musl-1.1.11/stamp/.tools_install_yynyynynynyyyyyyyyyynyyyyyyyyynyyyyynnyyynnyyynnnyy' failed
make[1]: *** [/home/builder/openwrt-trunk-WD8970/staging_dir/target-mips_34kc+dsp_musl-1.1.11/stamp/.tools_install_yynyynynynyyyyyyyyyynyyyyyyyyynyyyyynnyyynnyyynnnyy] Error 2
make[1]: Leaving directory '/home/builder/openwrt-trunk-WD8970'
/home/builder/openwrt-trunk-WD8970/include/toplevel.mk:179: recipe for target 'world' failed
make: *** [world] Error 2

comment:2 Changed 2 years ago by olewales

Solved compilation issue on gentoo by reemerging zlib with "static-libs" USE flag.
But still: presence of zlib is not properly checked by buildroot.

comment:3 Changed 2 years ago by anonymous

same error with ar71xx

comment:4 Changed 2 years ago by leonardogyn

on r46980 not even the initial 'make menuconfig' is working:

Checking 'python'... ok.
Checking 'svn'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.

Build dependency: Please install a static zlib. (Missing libz.a or zlib.h)

Prerequisite check failed. Use FORCE=1 to override.
make: *** [staging_dir/host/.prereq-build] Error 1
[solutti@cobaia trunk]$

[solutti@cobaia trunk]$ cat /etc/redhat-release
CentOS release 6.6 (Final)
[solutti@cobaia trunk]$ rpm -qa | grep "^zlib"
zlib-1.2.3-29.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64
[solutti@cobaia trunk]$

Last edited 2 years ago by leonardogyn (previous) (diff)

comment:5 follow-up: Changed 2 years ago by jow

Install the zlib-static RPM on CentOS.

Last edited 2 years ago by jow (previous) (diff)

comment:6 in reply to: ↑ 5 Changed 2 years ago by anonymous

Replying to jow:

Install the zlib-static RPM on CentOS.

installing the package named zlib-static solved the compilation problem on the CentOS 6. Thanks for the tip jow!

comment:7 Changed 23 months ago by zoobab@…

I do have a similar problem under Sabayon/Gentoo (Sabayon Linux 15.09 amd64 MATE), the "make prereq" fails to find libz.a or zlib.h, while locate finds them

`
Checking 'ldconfig-stub'... ok.

Build dependency: Please install a static zlib. (Missing libz.a or zlib.h)

/home/zoobab/soft/openwrt/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
`

Locate finds them:

`
zoobab@sabayonx86-64 /home/zoobab/soft/openwrt [54]$ locate libz.a
/usr/lib32/libz.a
/usr/lib64/libz.a
zoobab@sabayonx86-64 /home/zoobab/soft/openwrt [56]$ locate zlib.h
/usr/include/zlib.h
`

comment:8 Changed 22 months ago by anonymous

I can confirm the same behaviour as zoobab described on my gentoo system. On the same system I can compile the latest version of CC. But with the latest trunk I got the error with the missing zlib.h.

comment:9 Changed 20 months ago by hojuruku

I am running a sabayon/gentoo system and I can confirm something is up here too. Here's something a little more detailed than @anonymous and @zoobab

make[5]: Leaving directory '/usr/src/openwrt/build_dir/host/make-ext4fs-2016-05-05/libsparse'
cc -o make_ext4fs allocate.o canned_fs_config.o contents.o crc16.o ext4fixup.o ext4_sb.o ext4_utils.o extent.o indirect.o make_ext4fs_main.o make_ext4fs.o sha1.o uuid.o wipe.o libsparse/libsparse.a -Wl,-Bstatic -lz -Wl,-Bdynamic
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libz.a(gzlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libz.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:30: recipe for target 'make_ext4fs' failed

comment:10 Changed 20 months ago by hojuruku

Overriding the pre-req tests by modifying https://dev.openwrt.org/browser/trunk/include/prereq-build.mk to link with -lz -fPIC didn't work either.

It appears to be a gentoo gcc 4.9 issue. I used gcc-config to select GCC 4.8 without the hardened patchset and ran again and I'm off and running.
So it's either the hardened patch-set used with Gentoo's GCC by default in sabayon linux or GCC 4.9 breaks it.

It's funny that since openwrt builds a cross-compiler with gcc 5.0 in trunk nowadays.

comment:11 follow-up: Changed 20 months ago by hojuruku

From #gentoo-hardened
<Zorry> hojuruku: linking static libs that not build with pic don't work well when building PIE

I suggest this ticket be closed as an INVALID

when bootstrapping openwrt there is no harm in using vanilla gcc not gentoo hardened gcc
gcc-config -l ; gcc-config <number of vanilla gcc profile> ; source /etc/profile

will get the users complaining here back on their feet.

comment:12 Changed 16 months ago by ckujau

FWIW, I ran into the same issue with the latest Git checkout:

$ make menuconfig
[...]
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.

Build dependency: Please install a static zlib. (Missing libz.a or zlib.h)

../openwrt-git/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
../openwrt-git/include/toplevel.mk:151: recipe for target 'staging_dir/host/.prereq-build' failed
make: *** [staging_dir/host/.prereq-build] Error 1

After disabling the Debian Hardening wrapper, the error went away:

$ cat /etc/hardening-wrapper.conf 
DEB_BUILD_HARDENING=0

comment:13 in reply to: ↑ 11 Changed 14 months ago by mystica555

Replying to hojuruku:

when bootstrapping openwrt there is no harm in using vanilla gcc not gentoo hardened gcc

Can you offer definitive proof that there is no harm?

I'd personally want to build -everything- that is "trusted" such as a firewall and router, with PIE/PIC code.

I'm pretty sure this is a build issue that should be fixed _in another way_ than simply "use the vanilla compiler" as I believe this will *(help?) introduce holes for malicious code.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.