/usr/local/lib/libz.a:could not read Symbols:bad value (64-bit Linux)

Source: Internet
Author: User
Tags crc32

/usr/local/lib/libz.a:could not read Symbols:bad value (64-bit Linux)

/USR/BIN/LD:/usr/local/lib/libz.a (CRC32.O): Relocation r_x86_64_32 against ' a local symbol ' can not is used when making a Shared object; Recompile with-fpic

/usr/local/lib/libz.a:could not read Symbols:bad value

Typically 64-bit computers will appear.

Here's how to fix it:

CD zlib-1.2.3//Enter the Zlib directory

Cflags= "-o3-fpic"./configure//compile with 64-bit method

Make

Make install

Make clean

The above operation demonstrates the following results:

[Email protected] zlib-1.2.3]# cflags= "-o3-fpic"./configure--prefix=/usr/local/zlib/
Checking for GCC ...
Building Static Library libz.a version 1.2.3 with GCC.
Checking for Unistd.h ... Yes.
Checking whether to use vs[n]printf () or s[n]printf () ... using vs[n]printf ()
Checking for vsnprintf () in stdio.h ... Yes.
Checking for return value of vsnprintf () ... Yes.
Checking for errno.h ... Yes.
Checking for mmap support ... Yes.
[[email protected] zlib-1.2.3]# make
Gcc-o3-fpic-duse_mmap-c-O example.o example.c
Gcc-o3-fpic-duse_mmap-c-O adler32.o adler32.c
Gcc-o3-fpic-duse_mmap-c-O compress.o compress.c
Gcc-o3-fpic-duse_mmap-c-O crc32.o crc32.c
Gcc-o3-fpic-duse_mmap-c-O gzio.o gzio.c
Gcc-o3-fpic-duse_mmap-c-O uncompr.o uncompr.c
Gcc-o3-fpic-duse_mmap-c-O deflate.o deflate.c
Gcc-o3-fpic-duse_mmap-c-O trees.o trees.c
Gcc-o3-fpic-duse_mmap-c-O ZUTIL.O zutil.c
Gcc-o3-fpic-duse_mmap-c-O inflate.o inflate.c
Gcc-o3-fpic-duse_mmap-c-O infback.o infback.c
Gcc-o3-fpic-duse_mmap-c-O inftrees.o inftrees.c
Gcc-o3-fpic-duse_mmap-c-O inffast.o inffast.c
AR rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o Inffas T.o
Gcc-o3-fpic-duse_mmap-o example Example.o-l. libz.a
Gcc-o3-fpic-duse_mmap-c-O minigzip.o minigzip.c
Gcc-o3-fpic-duse_mmap-o minigzip minigzip.o-l. libz.a
[[email protected] zlib-1.2.3]# make install
CP Zlib.h Zconf.h/usr/local/zlib//include
chmod 644/usr/local/zlib//include/zlib.h/usr/local/zlib//include/zconf.h
CP Libz.a/usr/local/zlib//lib
Cd/usr/local/zlib//lib; chmod 755 LIBZ.A
Cd/usr/local/zlib//lib; If Test-f libz.so.1.2.3; Then \
Rm-f libz.so libz.so.1; \
Ln-s libz.so.1.2.3 libz.so; \
Ln-s libz.so.1.2.3 libz.so.1; \
(Ldconfig | | true) >/dev/null 2>&1; \
Fi
CP ZLIB.3/USR/LOCAL/ZLIB//SHARE/MAN/MAN3
chmod 644/usr/local/zlib//share/man/man3/zlib.3
[[email protected] zlib-1.2.3]# make clean
Rm-f *.o *~ example minigzip \
libz.* foo.gz so_locations \
_MATCH.S Maketree CONTRIB/INFBACK9/*.O
[Email protected] zlib-1.2.3]#

/usr/local/lib/libz.a:could not read Symbols:bad value (64-bit Linux)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.