LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-06-2016, 09:05 AM   #1
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
Problem compiling zlib


I'm trying to compile zlib and get this error. I wonder both about why it says it doesn't have shared library support and that it can't find ld. And also about the security issue about vsnprintf().

Code:
Checking for x86_64-unknown-linux-gnu-gcc...
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.8 with x86_64-unknown-linux-gnu-gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... No.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... No.
  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.
Checking for return value of vsprintf()... Yes.
Checking for attribute(visibility) support... Yes.
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -I. -c -o example.o test/example.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o adler32.o adler32.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o crc32.o crc32.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o deflate.o deflate.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o infback.o infback.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o inffast.o inffast.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o inflate.o inflate.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o inftrees.o inftrees.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o trees.o trees.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o zutil.o zutil.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o compress.o compress.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o uncompr.o uncompr.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o gzclose.o gzclose.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o gzlib.o gzlib.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o gzread.o gzread.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN   -c -o gzwrite.o gzwrite.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o example64.o test/example.c
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o minigzip64.o test/minigzip.c
ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -o example example.o -L. libz.a
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -o example64 example64.o -L. libz.a
x86_64-unknown-linux-gnu-gcc -O2 -march=core2 -mtune=core-avx2  -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -o minigzip64 minigzip64.o -L. libz.a
collect2: fatal error: cannot find 'ld'
compilation terminated.
collect2: fatal error: cannot find 'ld'
compilation terminated.
collect2: fatal error: cannot find 'ld'
collect2: fatal error: cannot find 'ld'
compilation terminated.
compilation terminated.
Makefile:170: recipe for target 'example' failed
make: *** [example] Error 1
make: *** Waiting for unfinished jobs....
Makefile:173: recipe for target 'minigzip' failed
make: *** [minigzip] Error 1
Makefile:185: recipe for target 'minigzip64' failed
make: *** [minigzip64] Error 1
Makefile:182: recipe for target 'example64' failed
make: *** [example64] Error 1
 
Old 06-06-2016, 09:37 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
When it barfs, try running
Code:
which ld
It's not finding your linker, needed for every compile. If you're in chapter 5, it will be the ld from the base system. in ch 6, it should be in $LFS somewhere.
 
Old 06-06-2016, 11:40 AM   #3
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
There is no ld... Something must have gone wrong with binutils. I found in my log from adjusting the toolchain:
Code:
'/tools/bin/ld' -> '/tools/bin/ld-old'
mv: cannot stat '/tools/x86_64-unknown-linux-gnu/bin/ld': No such file or directory
I'll check my scripts and start over. Thank you for guiding me in the right direction.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling from a tarball errors with libz and zlib.h spaceycayce Debian 5 01-03-2013 09:54 PM
CMAKE Problem with ZLIB anon025 Programming 3 12-06-2010 12:01 AM
Zlib-1.2.3 Problem on Chapter 6.11 BrandonJ Linux From Scratch 1 04-06-2010 03:38 PM
no matching comp found: client zlib none, zlib@openssh.com lost connection jorge_ivan Linux - Networking 0 08-14-2006 07:09 PM
zlib.h problem jnusa Programming 4 01-14-2005 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration