OpenSSL 1.0.1g erros ao tentar compilar o Apache 2.4.16 a partir do código-fonte no SUSE Linux Enterprise Server 11 (x86_64)

0

Informação do servidor:

# cat /etc/*-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 0
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"

Primeiro instalei o OpenSSL 1.0.1g:

# tar -zxf openssl-1.0.1g.tar.gz
# cd /usr/src/openssl-1.0.1g
# make clean
# ./config --prefix=/usr --openssldir=/usr/local/openssl enable-tlsext no-shared no-zlib -fPIC no-gost
# make depend
# make
# make test
# make install
# mv /usr/bin/openssl /root/
# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
# openssl version
  OpenSSL 1.0.1g 7 Apr 2014

Então eu instalei APR e APR-UTIL

# cd /usr/src

# tar -zxf apr-1.5.2.tar.gz
# cd /usr/src/apr-1.5.2
# ./configure
# make
# make test
# make install

# tar -zxf apr-util-1.5.4.tar.gz
# cd /usr/src/apr-util-1.5.4/
# ./configure --with-apr=/usr/local/apr --with-ldap=ldap  --with-crypto 
# make
# make test
# make install

# cp /usr/local/apr/bin/* /usr/bin

Então eu instalo o Apache 2.4.16:

# tar -zxf httpd-2.4.16.tar.gz
# cd /usr/src/httpd-2.4.16/

# make clean

# env LDFLAGS=-ldl
# export LIBS=-ldl

# CFLAGS="-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables  -g -fPIC -Wall -fno-strict-aliasing -DLDAP_DEPRECATED"; export CFLAGS

# CPPFLAGS="-DSSL_EXPERIMENTAL_ENGINE -DMAX_SERVER_LIMIT=200000 -DLDAP_DEPRECATED -DMAXLINE=4096"; export CPPFLAGS

# ./configure  --prefix=/usr/sbin/httpd \
--enable-shared \
--enable-layout=SuSE \
--with-apr=/usr/bin/apr-1-config \
--with-apr-util=/usr/bin/apu-1-config \
--enable-exception-hook \
--with-pcre \
--enable-pie \
--enable-ssl \
--with-ssl=/usr/local/ssl \
--enable-ssl-staticlib-deps \
--enable-mods-static=ssl \
--enable-mod_php5 \
--enable-mod_fcgid \
--enable-mod_perl \
--enable-mod_session_crypto \
--disable-isapi \
--enable-deflate \
--enable-echo \
--enable-filter \
--enable-ext-filter \
--enable-charset-lite \
--enable-file-cache \
--enable-logio \
--enable-dumpio \
--enable-bucketeer \
--enable-case_filter \
--enable-case_filter_in \
--with-ldap \
--enable-ldap \
--enable-authnz_ldap \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-ftp \
--enable-proxy-http \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-VERSION \
--enable-dav-lock \
--enable-authn-alias \
--enable-optional-hook-export \
--enable-optional-hook-import \
--enable-optional-fn-import \
--enable-optional-fn-export \
--enable-suexec \
--with-suexec-bin=/usr/sbin/suexec2 \
--with-suexec-caller=wwwrun \
--with-suexec-docroot=/srv/www \
--with-suexec-logfile=/var/log/apache2/suexec.log \
--with-suexec-userdir=public_html \
--with-suexec-uidmin=96 \
--with-suexec-gidmin=96 \
--with-suexec-safepath=/usr/local/bin:/usr/bin:/bin 

Configure parece funcionar sem erros

Então eu emito:

# make

Eu recebo esses erros:

/usr/local/apr/build-1/libtool --silent --mode=link gcc -std=gnu99  -pthread  -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -g -fPIC -Wall -fno-strict-aliasing -DLDAP_DEPRECATED -L/usr/local/ssl/lib -lssl -lcrypto -ldl -luuid -lrt -lcrypt -lpthread -pie \
                 -o ab  ab.lo        /usr/local/apr/lib/libaprutil-1.la -lexpat /usr/local/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -lm
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [ab] Error 1
make[2]: Leaving directory '/usr/src/httpd-2.4.16/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/usr/src/httpd-2.4.16/support'
make: *** [all-recursive] Error 1

Eu recebo os seguintes erros no config.log

133  conftest.c:9:28: error: ac_nonexistent.h: No such file or directory

147  conftest.c:59: error: expected ';', ',' or ')' before 'text'

148-157
conftest.c: In function 'main':
conftest.c:111: warning: implicit declaration of function 'test_restrict'
conftest.c:113: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'newvar'
conftest.c:113: error: 'newvar' undeclared (first use in this function)
conftest.c:113: error: (Each undeclared identifier is reported only once
conftest.c:113: error: for each function it appears in.)
conftest.c:123: error: 'for' loop initial declaration used outside C99 mode
configure:6017: $? = 1
configure: failed program was:
| /* confdefs.h */


380/438  conftest.c:52:26: error: minix/config.h: No such file or directory

535/607  conftest.c:66:27: error: sys/processor.h: No such file or directory

658/731  conftest.c:67:21: error: sys/sdt.h: No such file or directory

773/846  conftest.c:67:25: error: sys/loadavg.h: No such file or directory

1490/1588  conftest.c:92:21: error: bstring.h: No such file or directory
    
por AllisonC 30.09.2015 / 16:58

1 resposta

0

Bem, parabéns para você em fazer uma compilação personalizada! Me lembra dos bons e velhos tempos!

Dito isto, este parece ser o principal erro:

/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value

Na minha experiência que vem de quando uma biblioteca estática é de 32 bits versus os requisitos da marca que seria de 64 bits. E como é um item SSL, parece que tudo vem do próprio OpenSSL 1.0.1g.

Olhando para as instruções de compilação no site oficial do OpenSSL mostram que existem várias configurações para diferentes sistemas e podem ser visualizado executando este comando ./configure a partir do código fonte; baixado aqui :

./configure LIST

A saída que recebo é:

BC-32
BS2000-OSD
BSD-generic32
BSD-generic64
BSD-ia64
BSD-sparc64
BSD-sparcv8
BSD-x86
BSD-x86-elf
BSD-x86_64
Cygwin
Cygwin-pre1.3
DJGPP
MPE/iX-gcc
OS2-EMX
OS390-Unix
QNX6
QNX6-i386
ReliantUNIX
SINIX
SINIX-N
UWIN
VC-CE
VC-WIN32
VC-WIN64A
VC-WIN64I
aix-cc
aix-gcc
aix3-cc
aix64-cc
aix64-gcc
android
android-armv7
android-x86
aux3-gcc
beos-x86-bone
beos-x86-r5
bsdi-elf-gcc
cc
cray-j90
cray-t3e
darwin-i386-cc
darwin-ppc-cc
darwin64-ppc-cc
darwin64-x86_64-cc
debug
debug-BSD-x86-elf
debug-Cygwin
debug-VC-WIN32
debug-VC-WIN64A
debug-VC-WIN64I
debug-ben
debug-ben-darwin64
debug-ben-debug
debug-ben-debug-64
debug-ben-macos
debug-ben-macos-gcc46
debug-ben-no-opt
debug-ben-openbsd
debug-ben-openbsd-debug
debug-ben-strict
debug-bodo
debug-darwin-i386-cc
debug-darwin-ppc-cc
debug-geoff32
debug-geoff64
debug-levitte-linux-elf
debug-levitte-linux-elf-extreme
debug-levitte-linux-noasm
debug-levitte-linux-noasm-extreme
debug-linux-elf
debug-linux-elf-noefence
debug-linux-generic32
debug-linux-generic64
debug-linux-ia32-aes
debug-linux-pentium
debug-linux-ppro
debug-linux-x86_64
debug-rse
debug-solaris-sparcv8-cc
debug-solaris-sparcv8-gcc
debug-solaris-sparcv9-cc
debug-solaris-sparcv9-gcc
debug-steve-opt
debug-steve32
debug-steve64
debug-ulf
debug-vos-gcc
dgux-R3-gcc
dgux-R4-gcc
dgux-R4-x86-gcc
dist
gcc
hpux-cc
hpux-gcc
hpux-ia64-cc
hpux-ia64-gcc
hpux-parisc-cc
hpux-parisc-cc-o4
hpux-parisc-gcc
hpux-parisc1_1-cc
hpux-parisc1_1-gcc
hpux-parisc2-cc
hpux-parisc2-gcc
hpux64-ia64-cc
hpux64-ia64-gcc
hpux64-parisc2-cc
hpux64-parisc2-gcc
hurd-x86
iphoneos-cross
irix-cc
irix-gcc
irix-mips3-cc
irix-mips3-gcc
irix64-mips4-cc
irix64-mips4-gcc
linux-alpha+bwx-ccc
linux-alpha+bwx-gcc
linux-alpha-ccc
linux-alpha-gcc
linux-aout
linux-armv4
linux-elf
linux-generic32
linux-generic64
linux-ia32-icc
linux-ia64
linux-ia64-ecc
linux-ia64-icc
linux-ppc
linux-ppc64
linux-sparcv8
linux-sparcv9
linux-x86_64
linux32-s390x
linux64-s390x
linux64-sparcv9
mingw
mingw64
ncr-scde
netware-clib
netware-clib-bsdsock
netware-clib-bsdsock-gcc
netware-clib-gcc
netware-libc
netware-libc-bsdsock
netware-libc-bsdsock-gcc
netware-libc-gcc
newsos4-gcc
nextstep
nextstep3.3
osf1-alpha-cc
osf1-alpha-gcc
purify
qnx4
rhapsody-ppc-cc
sco5-cc
sco5-gcc
solaris-sparcv7-cc
solaris-sparcv7-gcc
solaris-sparcv8-cc
solaris-sparcv8-gcc
solaris-sparcv9-cc
solaris-sparcv9-gcc
solaris-x86-cc
solaris-x86-gcc
solaris64-sparcv9-cc
solaris64-sparcv9-gcc
solaris64-x86_64-cc
solaris64-x86_64-gcc
sunos-gcc
tandem-c89
tru64-alpha-cc
uClinux-dist
uClinux-dist64
ultrix-cc
ultrix-gcc
unixware-2.0
unixware-2.1
unixware-7
unixware-7-gcc
vos-gcc
vxworks-mips
vxworks-ppc405
vxworks-ppc60x
vxworks-ppc750
vxworks-ppc750-debug
vxworks-ppc860
vxworks-ppcgen
vxworks-simlinux

Não vejo nada que se pareça explicitamente com o SUSE Linux Enterprise Server 11, mas assumirei que talvez o processo ./configure tenha compilado uma versão de 32 bits? Meu palpite é que talvez o seu comando ./configure para o OpenSSL deveria declarar explicitamente para qual arquitetura você deseja compilar?

Como um comando como:

./configure linux-generic64

E até mesmo adicionando suas opções usadas anteriormente assim:

./configure linux-generic64 --prefix=/usr --openssldir=/usr/local/openssl enable-tlsext no-shared no-zlib -fPIC no-gost

E, em seguida, percorra todo o processo make e make install novamente.

Mas meu instinto me diz que tudo isso depende de algo de 32 bits que compila a compilação em um sistema de 64 bits.

    
por 02.10.2015 / 08:38