2012-07-18 37 views
2

我有一個時間在x86機器編譯Apache 2.4.2 Solaris 10中(64位)編譯Apache 2.4.2中的Solaris 10的x86機器我安裝了所有的(64位)的錯誤

所需的程序沒有問題,但是當配置(或做)使用Apache時,它會爆炸。

我不知道問題是否是環境問題。我不知道哪一個失敗 - 如果是這樣的話 - 。

這裏是一個小腳本(與運行它:腳本)來說明我在做什麼(注意,我使用前綴標誌安裝所有/選擇):

#!/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!!! 

請注意環境變量。 他們行嗎?

下面是我得到的錯誤,配置(的./configure ...)的Apache時: .... 檢查創建系統類型......把i386-pc-solaris2.10 檢查主機系統類型...把i386-pc-solaris2.10 檢查目標系統類型...把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 

的config.log不說有關-at最後什麼對於我來說,它只是列出了設置爲-hundreds!的env變量。

不過,如果我做 '使用gmake' 與錯誤,我得到:

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 

編輯: 以下twalberg的建議後,我使用GCC編譯它,而不是使用cc,但現在我得到這個錯誤做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 
+0

問題是你使用的是Solaris。 – 2012-07-18 19:35:15

+0

應該可以在Solaris中進行編譯,而且我不是Solaris粉絲,但是我的工作環境僅限於Solaris:/ – Kani 2012-07-18 19:39:44

+1

您可能需要使用'gcc',但不要使用'cc' ... – twalberg 2012-07-18 19:42:31

回答

3

謝謝twalberg,你在這給了光。

我不得不用-m64標誌編譯所有東西。

我會把我用過的小腳本。我希望如果別人有類似的問題,這可以幫助你:

#!/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 
相關問題