linux下安装subversion报错:/usr/local/zlib//lib/libz.a(compress.o): relocation R_X86_64_32 against `.rodat

在使用一下命令安装的时候

./configure --prefix=/usr/local/subversion --with-apr=/usr/local/APR/ --with-apr-util=/usr/local/apr-util/ --with-zlib=/usr/local/zlib/
make
make install

报错:

/usr/local/zlib//lib/libz.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be 
这个错误是64位系统才会出现的,出现这个错误是需要重新安装zlib

在安装过程中需要使用以下命令来修改zlib的./configure文件

./configure --prefix=/usr/local/zlib
vi Makefile
执行完以上命令后会出现文件的配置信息,如下:
# Makefile for zlib
# Copyright (C) 1995-2005 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h

# To compile and test, type:
#    ./configure; make test
# The call of configure is optional if you don't have special requirements
# If you wish to build zlib as a shared library, use: ./configure -s

# To use the asm code, type:
#    cp contrib/asm?86/match.S ./match.S
#    make LOC=-DASMV OBJA=match.o

# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
#    make install
# To install in $HOME instead of /usr/local, use:
#    make install prefix=$HOME

CC=gcc

CFLAGS=-O3 -DUSE_MMAP
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
找到:CFLAGS=-O3 -DUSE_MMAP

修改为:CFLAGS=-O3 -DUSE_MMAP -fPIC

# Makefile for zlib
# Copyright (C) 1995-2005 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h

# To compile and test, type:
#    ./configure; make test
# The call of configure is optional if you don't have special requirements
# If you wish to build zlib as a shared library, use: ./configure -s

# To use the asm code, type:
#    cp contrib/asm?86/match.S ./match.S
#    make LOC=-DASMV OBJA=match.o

# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
#    make install
# To install in $HOME instead of /usr/local, use:
#    make install prefix=$HOME

CC=gcc

CFLAGS=-O3 -DUSE_MMAP -fPIC
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
然后继续执行make和make install安装zlib

-------------------------------------------------------------------------------------------------------------------------------------------------------

在用以上方法重新安装zlib之后再次使用一下命令安装subversion的时候即可成功

./configure --prefix=/usr/local/subversion --with-apr=/usr/local/APR/ --with-apr-util=/usr/local/apr-util/ --with-zlib=/usr/local/zlib/
make
make install

上一篇:Photoshop为偏暗的人物照片精细磨皮及美白


下一篇:centos linux系统下搭建git服务器