在x86机器中的Solaris 10编译Apache 2.4.2(64位)的错误 [英] Compile Apache 2.4.2 in Solaris 10 in a x86 machine (64bits) errors
问题描述
我有一个硬盘一次在x86机器编译Apache 2.4.2 Solaris 10中(64位)
我安装了所有必需的程序没有问题,但与Apache配置(或做化妆),当它爆炸了。
我不知道问题出在ENV vairables。我不知道哪一个是失败的 - 如果是这种情况 -
下面是一个小型的脚本(使用运行它:源的脚本)来说明我在做什么(的通知我安装一切在 /选择使用的 preFIX 的标志):
#!/ bin / sh的#SET ENV变量
出口LDFLAGS =-L在/ usr / SFW / lib目录-R在/ usr / SFW / lib中-L的/ usr / X / lib目录-R在/ usr / X / lib目录-L在/ usr / X11 / lib目录-R在/ usr / X11 / lib目录-L在/ usr / CCS / lib目录-R在/ usr / CCS / lib目录
出口PATH =的/ usr / CCS /斌/ AMD64的/ usr / CCS /斌:/ usr / sbin目录:在/ usr / bin中:在/ usr / sfw / bin中:在/ usr / SFW / sbin目录
出口LD_LIBRARY_PATH = / usr / lib目录:在/ usr / SFW / lib目录
出口LD_LIBRARY_PATH_64 = / usr / lib目录/ 64:在/ usr / SFW / lib中/ 64出口CFLAGS = -m64 -O3
出口CPP_FLAGS = -m64 -O3
出口CC = CC#Install OPENSSL
CD /opt/build_src/source_apache_openssl/openssl-1.0.1c
./config中 - preFIX = /选择/的OpenSSL 1.0.1c线程共享solaris64-GCC -m32
GMAKE干净
使用gmake
使用gmake安装#Install ARP
CD /opt/build_src/source_apache_openssl/apr-1.4.6
的./configure - preFIX = /选择/ APR-1.4.6 --with-GNU-LD --enable-线程
GMAKE干净
使用gmake
使用gmake安装#Install ARP-UTIL
CD /opt/build_src/source_apache_openssl/apr-util-1.4.1
的./configure - preFIX = /选择/ APR-UTIL-1.4.1 --with-的OpenSSL = /选择/的OpenSSL 1.0.1c --with-APR = /选择/ APR-1.4.6 - 与-加密--enable-线程
GMAKE干净
使用gmake
使用gmake安装#Instalamos阿帕奇
CD /opt/build_src/source_apache_openssl/httpd-2.4.2 ----它失败!
请注意的ENV变量。 他们是OK ???
下面是我所得到的是一个错误,组态时( ./配置... )阿帕奇:
....
检查创建系统类型... I386-PC-solaris2.10
检查主机系统类型... I386-PC-solaris2.10
检查目标系统类型... I386-PC-solaris2.10
配置Apache便携式运行库...检查APR ...是的
CPP设置为gcc -E
加入-g来CFLAGS
加入-O2到CFLAGS
CPPFLAGS设置为-DSOLARIS2 = 10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - D_LARGEFILE64_SOURCE配置Apache便携式运行实用程序库...检查APR-util的......是的
加入-L /选择/的OpenSSL 1.0.1c / lib目录,以LDFLAGS
检查海合会... CC
检查C编译器是否工作......没有(!!!!!)
配置:错误:`/opt/build_src/source_apache_openssl/httpd-2.4.2':(!!!!!)
配置:错误:C编译器不能创建可执行文件(!!!!!)
详细信息请参见'的config.log
在的config.log 不说有关-at最后什么我 - ,它只是列出ENV变量设置好的-hundreds - !
不过,如果我做'了gmake与错误,我得到:
未定义第一次引用
在文件符号
BIO_set_callback ab.o
BIO_set_callback_arg ab.o
BIO_get_callback_arg ab.o
SSL_CTX_set_info_callback ab.o
LD:致命的:符号引用错误。无输出写入AB
collect2:劳工处返回1退出状态
使用gmake [2]:*** [AB]错误1
使用gmake [2]:离开目录`/opt/build_src/source_apache_openssl/httpd-2.4.2/support
使用gmake [1]:*** [所有递归]错误1
使用gmake [1]:离开目录`/opt/build_src/source_apache_openssl/httpd-2.4.2/support
使用gmake:*** [所有递归]错误1
修改:
以下的建议后的 twalberg 后,我与海湾合作委员会,而不是与CC编译它,但现在我得到这个错误做了gmake:
...
LD:致命的:文件ab.o:错误ELF类:ELFCLASS32
LD:致命的:文件处理错误。无输出写入AB-----其他时间我得到-----
LD:致命的:文件/opt/pcre-8.30/lib/libpcre.so:错误ELF类:ELFCLASS32
LD:致命的:文件处理错误。无输出写入的httpd
注:我安装prce用(无需)的路径PATH =的/ usr / SFW / lib中/ 64collect2:劳工处返回1退出状态
使用gmake [2]:*** [AB]错误1
使用gmake [2]:离开目录`/opt/build_src/source_apache_openssl/httpd-2.4.2/support
使用gmake [1]:*** [所有递归]错误1
使用gmake [1]:离开目录`/opt/build_src/source_apache_openssl/httpd-2.4.2/support
使用gmake:*** [所有递归]错误1
感谢您 twalberg ,你在这给了光。
我不得不编译与-m64标志的一切。
我会把小脚本我用。我希望,如果其他人有类似的问题,这可以帮助你:
#!/ bin / sh的##################### apacheInstaller ############################ ########
#由:卡尼岛
#pre-先决条件:
#你必须下载并按此顺序进行安装:
#
#PCRE-8.30(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre)
#的OpenSSL 1.0.1c(http://www.openssl.org)
#APR-1.4.6
#APR-UTIL-1.4.1
#的httpd-2.4.2(阿帕奇)
#
#我收集了所有文件:
#的/ opt / build_src / source_apache_openssl / DIRECTORIES
#
#注意:这在Solaris 10 X86-64位机做!
#
#HOW TO:执行脚本
#CHMODü+ X apacheInstaller.sh
#源./apacheInstaller.sh
#注:源用于ENV变量的出口!
################################################## ######################SET ENV变量
出口LDFLAGS =-L在/ usr / SFW / lib目录-R在/ usr / SFW / lib中-L的/ usr / X / lib目录-R在/ usr / X / lib目录-L在/ usr / X11 / lib目录-R在/ usr / X11 / lib目录-L在/ usr / CCS / lib目录-R在/ usr / CCS / lib目录
出口PATH =的/ usr / CCS /斌:/ usr / sbin目录:在/ usr / bin中:在/ usr / sfw / bin中:在/ usr / SFW / sbin目录:在/ usr / CCS /斌/ AMD64
出口LD_LIBRARY_PATH = / usr / lib目录:在/ usr / SFW / lib目录
出口LD_LIBRARY_PATH_64 = / usr / lib目录/ 64:在/ usr / SFW / lib中/ 64
#Dont使用CC,使用GCC!这个非常重要。它不会工作,否则!
出口CC = GCC
出口CFLAGS = -m64 -O3
出口CPP_FLAGS = -m64 -O3#also使用:
#export LD_LIBRARY_PATH = / usr / lib目录/ 64:在/ usr / SFW / lib中/ 64
#but不知道这是必要的。也许LD_LIBRARY_PATH_64够吗?#Install PCRE
#系统-m64标志是根本!不知道别人
CD /opt/build_src/source_apache_openssl/pcre-8.30
运行./configure --disable-CPP CFLAGS = - 摹-O3CC =gcc的-m64 - preFIX = /选择/ PCRE-8.30
GMAKE干净
使用gmake
使用gmake安装#Install OPENSSL
CD /opt/build_src/source_apache_openssl/openssl-1.0.1c
./config中 - preFIX = /选择/的OpenSSL 1.0.1c线程共享solaris64-GCC -m32
GMAKE干净
使用gmake
使用gmake安装#Install ARP
CD /opt/build_src/source_apache_openssl/apr-1.4.6
的./configure - preFIX = /选择/ APR-1.4.6 --with-GNU-LD --enable-线程
GMAKE干净
使用gmake
使用gmake安装#Install ARP-UTIL
CD /opt/build_src/source_apache_openssl/apr-util-1.4.1
的./configure - preFIX = /选择/ APR-UTIL-1.4.1 --with-的OpenSSL = /选择/的OpenSSL 1.0.1c --with-月= /选择/ APR-1.4.6 - 与-加密--enable-线程
GMAKE干净
使用gmake
使用gmake安装#Install的Apache。 THE HOT PART!
CD /opt/build_src/source_apache_openssl/httpd-2.4.2
的./configure - preFIX = /选择/的httpd-2.4.2 --enable-所以--enable-馅饼--enable-模块=所有--enable-MODS共享=所有--enable-代理 - -enable代理连接--enable-代理的ftp --enable-代理HTTP --enable-代理AJP --enable-代理平衡器--enable-ssl的--with-SSL = /选择/ openssl- 1.0.1c --enable-静态支持--enable-静态的htpasswd --enable-静态htdigest --enable-静态rotatelogs --enable-静态分析(logresolve)--enable-CGI --enable-虚拟主机 - 让 - 图像映射--with-MPM = prefork --with-PCRE = /选择/ PCRE-8.30 --with-APR = /选择/ APR-1.4.6 --with-APR-UTIL = /选择/ APR-UTIL-1.4.1
GMAKE干净
使用gmake
使用gmake安装
I'm having a hard time compiling Apache 2.4.2 in Solaris 10 in a x86 machine (64bits)
I installed all the required programs without problems, but when configuring (or doing make) with apache it explode.
I don't know if the problem is the env vairables. I don't know which one is failing -if this was the case-.
Here is a mini script (ran it with: source script) to illustrate what I'm doing (Notice that I install everything in /opt using the prefix flag):
#!/bin/sh
#Set ENV variables
export LDFLAGS=" -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/X/lib -R/usr/X/lib -L/usr/X11/lib -R/usr/X11/lib -L/usr/ccs/lib -R/usr/ccs/lib "
export PATH=/usr/ccs/bin/amd64/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/sfw/sbin
export LD_LIBRARY_PATH=/usr/lib:/usr/sfw/lib
export LD_LIBRARY_PATH_64=/usr/lib/64:/usr/sfw/lib/64
export CFLAGS=-m64 -O3
export CPP_FLAGS=-m64 -O3
export CC=cc
#Install OPENSSL
cd /opt/build_src/source_apache_openssl/openssl-1.0.1c
./config --prefix=/opt/openssl-1.0.1c thread shared solaris64-gcc -m32
gmake clean
gmake
gmake install
#Install ARP
cd /opt/build_src/source_apache_openssl/apr-1.4.6
./configure --prefix=/opt/apr-1.4.6 --with-gnu-ld --enable-threads
gmake clean
gmake
gmake install
#Install ARP-UTIL
cd /opt/build_src/source_apache_openssl/apr-util-1.4.1
./configure --prefix=/opt/apr-util-1.4.1 --with-openssl=/opt/openssl-1.0.1c --with-apr=/opt/apr-1.4.6 --with-crypto --enable-threads
gmake clean
gmake
gmake install
#Instalamos Apache
cd /opt/build_src/source_apache_openssl/httpd-2.4.2 ---- IT FAILS!!!
Please, note the env variables. are they OK???
Here is what I get as an error, when configuring (./configure ... ) Apache: .... checking build system type... i386-pc-solaris2.10 checking host system type... i386-pc-solaris2.10 checking target system type... i386-pc-solaris2.10
Configuring Apache Portable Runtime library ...
checking for APR... yes
setting CPP to "gcc -E"
adding "-g" to CFLAGS
adding "-O2" to CFLAGS
setting CPPFLAGS to " -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - D_LARGEFILE64_SOURCE"
Configuring Apache Portable Runtime Utility library...
checking for APR-util... yes
adding "-L/opt/openssl-1.0.1c/lib" to LDFLAGS
checking for gcc... cc
checking whether the C compiler works... no (!!!!!)
configure: error: in `/opt/build_src/source_apache_openssl/httpd-2.4.2': (!!!!!)
configure: error: C compiler cannot create executables (!!!!!)
See `config.log' for more details
The config.log doesn't say anything relevant -at last for me-, it just list the env variables setted -hundreds!-.
Nevertheless, if i do 'gmake' with that error I get:
Undefined first referenced
symbol in file
BIO_set_callback ab.o
BIO_set_callback_arg ab.o
BIO_get_callback_arg ab.o
SSL_CTX_set_info_callback ab.o
ld: fatal: symbol referencing errors. No output written to ab
collect2: ld returned 1 exit status
gmake[2]: *** [ab] Error 1
gmake[2]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake: *** [all-recursive] Error 1
EDIT: After following the suggestion of twalberg, I compiled it with GCC and NOT with cc, but now I'm getting this error doing the gmake:
...
ld: fatal: file ab.o: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to ab
-----other times I get-----
ld: fatal: file /opt/pcre-8.30/lib/libpcre.so: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to httpd
NOTE: I installed prce with (and without) the path to PATH=/usr/sfw/lib/64
collect2: ld returned 1 exit status
gmake[2]: *** [ab] Error 1
gmake[2]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake: *** [all-recursive] Error 1
Thank you twalberg, you gave light in this.
I had to compile everything with the -m64 flag.
I will put the mini-script I used. I hope that, if others have a similar problem, this could help you:
#!/bin/sh
#####################apacheInstaller####################################
# by: kani
# Pre-requisites:
# You must download and install in THIS ORDER:
#
# pcre-8.30 (ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre)
# openssl-1.0.1c (http://www.openssl.org)
# apr-1.4.6
# apr-util-1.4.1
# httpd-2.4.2 (apache)
#
# I gathered all the files in:
# /opt/build_src/source_apache_openssl/DIRECTORIES
#
# NOTE: this was done in a Solaris 10 x86-64 bit machine!
#
# HOW TO: execute the script
# chmod u+x apacheInstaller.sh
# source ./apacheInstaller.sh
# NOTE: source is used for the export of the ENV variables!
#######################################################################
#Set ENV variables
export LDFLAGS=" -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/X/lib -R/usr/X/lib -L/usr/X11/lib -R/usr/X11/lib -L/usr/ccs/lib -R/usr/ccs/lib "
export PATH=/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/sfw/sbin:/usr/ccs/bin/amd64
export LD_LIBRARY_PATH=/usr/lib:/usr/sfw/lib
export LD_LIBRARY_PATH_64=/usr/lib/64:/usr/sfw/lib/64
#Dont use CC, use GCC! This is VERY important. It wont work otherwise!!
export CC=gcc
export CFLAGS=-m64 -O3
export CPP_FLAGS=-m64 -O3
#also used:
#export LD_LIBRARY_PATH=/usr/lib/64:/usr/sfw/lib/64
#but not sure if this is needed. Maybe LD_LIBRARY_PATH_64 is enough?
#Install PCRE
#The -m64 flag is FUNDAMENTAL!!! Not sure about the others
cd /opt/build_src/source_apache_openssl/pcre-8.30
./configure --disable-cpp CFLAGS="-g -O3" CC="gcc -m64" --prefix=/opt/pcre-8.30
gmake clean
gmake
gmake install
#Install OPENSSL
cd /opt/build_src/source_apache_openssl/openssl-1.0.1c
./config --prefix=/opt/openssl-1.0.1c thread shared solaris64-gcc -m32
gmake clean
gmake
gmake install
#Install ARP
cd /opt/build_src/source_apache_openssl/apr-1.4.6
./configure --prefix=/opt/apr-1.4.6 --with-gnu-ld --enable-threads
gmake clean
gmake
gmake install
#Install ARP-UTIL
cd /opt/build_src/source_apache_openssl/apr-util-1.4.1
./configure --prefix=/opt/apr-util-1.4.1 --with-openssl=/opt/openssl-1.0.1c --with- apr=/opt/apr-1.4.6 --with-crypto --enable-threads
gmake clean
gmake
gmake install
#Install Apache. THE HOT PART!!
cd /opt/build_src/source_apache_openssl/httpd-2.4.2
./configure --prefix=/opt/httpd-2.4.2 --enable-so --enable-pie --enable-module=all --enable-mods-shared=all --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-ssl --with-ssl=/opt/openssl-1.0.1c --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-cgi --enable-vhost --enable-imagemap --with-mpm=prefork --with-pcre=/opt/pcre-8.30 --with-apr=/opt/apr-1.4.6 --with-apr-util=/opt/apr-util-1.4.1
gmake clean
gmake
gmake install
这篇关于在x86机器中的Solaris 10编译Apache 2.4.2(64位)的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!