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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值