Solaris 9 / modssl-2.8.22-1.3.33 problems

Solaris 9 / modssl-2.8.22-1.3.33 problems

am 17.12.2004 01:59:42 von Steve Parker

Hi modssl-users,

I'm having trouble building mod-ssl with Apache on Solaris 9, and have
run out of ideas.
I've been building Apache/mod-ssl happily for the past few years
(although I claim no expertise in the matter), most recently having
built this exact software combination on Solaris 7, which is running
quite happily.
However, we feel the need to upgrade from the aging Solaris 7, but the
build is not working.

Versions of things:
OpenSSL 0.9.7e
Mod-SSL 2.8.22-1.3.33
Apache 1.3.33
Solaris 9 SPARC (64-bit)
gcc 3.4.2 (from www.sunfreeware.com)
GNU ld 2.11.2 (again, from www.sunfreeware.com)
flex 2.5.31

Summary:
It seems from http://forum.sun.com/thread.jspa?threadID=18986&tstart=15
that this was a problem with 2.8.17, fixed in 2.8.18 with a sed command
on line 244 of apache-1.3.33/src/modules/ssl/Makefile:

242: ssl_expr_scan.c: ssl_expr_scan.l ssl_expr_parse.h
243: flex -Pssl_expr_yy -s -B ssl_expr_scan.l
244: sed -e '/$$Header:/d' ssl_expr_scan.c
&& rm -f lex.ssl_expr_yy.c

This fix isn't working for me; the generated ssl_expr_scan.c errs at
line 1900:
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_expr_scan.c && mv ssl_expr_scan.o ssl_expr_scan.lo
lex.ssl_expr_yy.c:1900: error: parse error before numeric constant

Line 1900 of ssl_expr_scan.c is:
YY_BUFFER_STATE ssl_expr_yy_scan_string (yyconst char * str )


Actions taken:
# cd openssl-0.9.7e
# ./Configure solaris64-sparcv9-gcc -fPIC
# make && make install
# cd ../mod-ssl-2.8.22-1.3.33
# ./configure --with-apache=../apache_1.3.33/ \
--with-ssl=../openssl-0.9.7e/ \
--enable-module=ssl --prefix=/usr/local/apache \
--enable-shared=ssl --enable-suexec \
--suexec-docroot=/usr/local/apache/htdocs \
--suexec-logfile=/usr/local/apache/logs/suexec_log \
--suexec-caller=apache --suexec-uidmin=1000 \
--suexec-gidmin=1000 --suexec-safepath="/bin:/usr/bin" \
--enable-module=most --enable-shared=max \
--enable-module=proxy --enable-shared=proxy
# cd ../apache-1.3.33
# make

Results:
[....]
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_scache_dbm.c && mv ssl_scache_dbm.o ssl_scache_dbm.lo
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_scache_shmht.c && mv ssl_scache_shmht.o ssl_scache_shmht.lo
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_scache_shmcb.c && mv ssl_scache_shmcb.o ssl_scache_shmcb.lo
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\" ssl_expr.c
&& mv ssl_expr.o ssl_expr.lo
flex -Pssl_expr_yy -s -B ssl_expr_scan.l
sed -e '/$Header:/d' ssl_expr_scan.c && rm -f
lex.ssl_expr_yy.c
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_expr_scan.c && mv ssl_expr_scan.o ssl_expr_scan.lo
lex.ssl_expr_yy.c:1900: error: parse error before numeric constant
lex.ssl_expr_yy.c: In function `ssl_expr_yy_scan_string':
lex.ssl_expr_yy.c:1901: error: number of arguments doesn't match prototype
lex.ssl_expr_yy.c:293: error: prototype declaration
lex.ssl_expr_yy.c:1903: warning: passing arg 1 of `strlen' makes pointer
from integer without a cast
lex.ssl_expr_yy.c:1903: warning: passing arg 1 of
`ssl_expr_yy_scan_bytes' makes pointer from integer without a cast
make[4]: *** [ssl_expr_scan.lo] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/apache/apache_1.3.33/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/apache/apache_1.3.33'
make: *** [build] Error 2

Workaround tried:
ssl_expr_scan.c:
-YY_BUFFER_STATE ssl_expr_yy_scan_string (yyconst char * str )
+YY_BUFFER_STATE ssl_expr_yy_scan_string (yyconst char * str_state )

Makefile:
ssl_expr_scan.c: ssl_expr_scan.l ssl_expr_parse.h
#flex -Pssl_expr_yy -s -B ssl_expr_scan.l
#sed -e '/$$Header:/d' ssl_expr_scan.c && rm
-f lex.ssl_expr_yy.c
echo SKIPPING FLEX STUFF

This results in:
# make clean
# make
[...]
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_util_sdbm.c && mv ssl_util_sdbm.o ssl_util_sdbm.lo
gcc -c -I../../os/unix -I../../include -DSOLARIS2=290
-DMOD_SSL=208122 -DEAPI -DUSE_EXPAT -I../../lib/expat-lite `../../apaci`
-fPIC -DSHARED_MODULE -DSSL_COMPAT -DSSL_ENGINE
-I/apache/openssl-0.9.7e/include -DMOD_SSL_VERSION=\"2.8.22\"
ssl_util_table.c && mv ssl_util_table.o ssl_util_table.lo
rm -f libssl.so
ld -L/apache/openssl-0.9.7e -G -o libssl.so mod_ssl.lo
ssl_engine_config.lo ssl_engine_compat.lo ssl_engine_ds.lo
ssl_engine_dh.lo ssl_engine_init.lo ssl_engine_kernel.lo
ssl_engine_rand.lo ssl_engine_io.lo ssl_engine_log.lo
ssl_engine_mutex.lo ssl_engine_pphrase.lo ssl_engine_vars.lo
ssl_engine_ext.lo ssl_scache.lo ssl_scache_dbm.lo ssl_scache_shmht.lo
ssl_scache_shmcb.lo ssl_expr.lo ssl_expr_scan.lo ssl_expr_parse.lo
ssl_expr_eval.lo ssl_util.lo ssl_util_ssl.lo ssl_util_sdbm.lo
ssl_util_table.lo -lssl -lcrypto
-L/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2 -lgcc
ld: skipping incompatible /apache/openssl-0.9.7e/libssl.a when searching
for -lssl
ld: cannot find -lssl
make[4]: *** [libssl.so] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/apache/apache_1.3.33/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/apache/apache_1.3.33'
make: *** [build] Error 2

Any ideas gratefully received; I'm beginning to doubt my sanity :-)

Steve

--
Steve Parker
steve@steve-parker.org
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org

Re: Solaris 9 / modssl-2.8.22-1.3.33 problems

am 17.12.2004 08:40:09 von Mads Toftum

On Fri, Dec 17, 2004 at 12:59:42AM +0000, Steve Parker wrote:
> Summary:
> It seems from http://forum.sun.com/thread.jspa?threadID=18986&tstart=15
> that this was a problem with 2.8.17, fixed in 2.8.18 with a sed command
> on line 244 of apache-1.3.33/src/modules/ssl/Makefile:
>
> 242: ssl_expr_scan.c: ssl_expr_scan.l ssl_expr_parse.h
> 243: flex -Pssl_expr_yy -s -B ssl_expr_scan.l
> 244: sed -e '/$$Header:/d' ssl_expr_scan.c
> && rm -f lex.ssl_expr_yy.c
>
You shouldn't need to regenerate these files - most likely a timestamp
problem that results in make thinking that the lex/yacc files has been
updated later than the output .c and .h - simply touch the output files
to make sure they have a newer timestamp, then make won't try to
regenerate.

vh

Mads Toftum
--
`Darn it, who spiked my coffee with water?!' - lwall

____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org

Re: Solaris 9 / modssl-2.8.22-1.3.33 problems

am 17.12.2004 17:08:42 von Steve Parker

I see from http://marc.theaimsgroup.com/?l=apache-modssl&m=110326922031 002&w=2 that Mads Toftum wrote:

> You shouldn't need to regenerate these files - most likely a timestamp
> problem that results in make thinking that the lex/yacc files has been
> updated later than the output .c and .h - simply touch the output files
> to make sure they have a newer timestamp, then make won't try to
> regenerate.

I re-extracted the tarballs from scratch, rinse, repeat.
Used touch to ensure that timestamp on ssl_expr_scan.l was 15:18 today, timestamps on *.c, *.h were 15:19 today.
Same problem.

Clean up, configure again.
mod-ssl$> ./configure --with-apache=../apache-1.3.33 etc...
mod-ssl$> cd ../apache-1.3.33
apache-1.3.33$> vi src/modules/ssl/Makefile
... edit to read:
ssl_expr_scan.c: ssl_expr_scan.l ssl_expr_parse.h
echo SKIPPING SSL_EXPR_SCAN.C
# flex -Pssl_expr_yy -s -B ssl_expr_scan.l
# sed -e '/$$Header:/d' ssl_expr_scan.c && rm -f lex.ssl_expr_yy.c
apache-1.3.33$> make

This is progress - the build succeeds (hurrah!). It's hammers for walnuts, but if it works, that's enough for me for now.
When it gets to the linking stage, it complains that libssl is "incompatible"

rm -f libssl.so
ld -L/apache/openssl-0.9.7e -G -o libssl.so mod_ssl.lo ssl_engine_config.lo ssl_engine_compat.lo ssl_engine_ds.lo ssl_engine_dh.lo ssl_engine_init.lo ssl_engine_kernel.lo ssl_engine_rand.lo ssl_engine_io.lo ssl_engine_log.lo ssl_engine_mutex.lo ssl_engine_pphrase.lo ssl_engine_vars.lo ssl_engine_ext.lo ssl_scache.lo ssl_scache_dbm.lo ssl_scache_shmht.lo ssl_scache_shmcb.lo ssl_expr.lo ssl_expr_scan.lo ssl_expr_parse.lo ssl_expr_eval.lo ssl_util.lo ssl_util_ssl.lo ssl_util_sdbm.lo ssl_util_table.lo -lssl -lcrypto -L/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2 -lgcc
ld: skipping incompatible /apache/openssl-0.9.7e/libssl.a when searching for -lssl
ld: cannot find -lssl
make[4]: *** [libssl.so] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/apache/apache_1.3.33/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/apache/apache_1.3.33'
make: *** [build] Error 2

apache-1.3.33$> ld --version
GNU ld 2.11.2
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
Supported emulations:
elf32_sparc
elf64_sparc

apache-1.3.33$> file /apache/openssl-0.9.7e/libssl.a
/apache/openssl-0.9.7e/libssl.a: current ar archive, not a dynamic executable or shared object

My best guess (repeat, this time editing apache-1.3.33/src/Configuration, set EXTRA_CFLAGS="-m64" before configure,
and removing the flex stuff before the make) doesn't fix it.
Any ideas what ld means by saying that libssl is incompatible?

Thanks,

Steve.


____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org

Re: Solaris 9 / modssl-2.8.22-1.3.33 problems

am 17.12.2004 17:28:07 von Steve Parker

Fixed it - using the sytem linker (/usr/ccs/bin/ld) instead of the GNU
linker now works.

Summary of fixes required to build 64-bit modssl-2.8.22 on Solaris 9 SPARC:

- CC="gcc -m64"
- Remove the "flex" command from
apache-1.3.33/src/modules/ssl/Makefile before running "make"
- PATH=/usr/ccs/bin:/usr/local/bin:$PATH (or any other method of
making it use the Solaris ld, not the GNU one).

Regards,

Steve.
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org