unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Jan P. Kessler
Hi postfix-users,

today I have the pleasure to update sparc some machines, that haven't
been touched for more than 2.5 years :/

The systems use sunstudio compiler. Openssl, bind, ... went fine but
now, as it comes to postfix, I'm failing. The build scripts are in use
since long time, and worked fine until the last update (postfix 2.11.4).
Now with 3.3.2 the build breaks with the following error:

$ make makefiles CC=/opt/SUNWspro/bin/cc CXX=/opt/SUNWspro/bin/cc  
CCARGS="-DHAS_DB -DUSE_TLS -DHAS_PCRE -DHAS_CDB
-I/opt/custom/libs/bdb/include -I/opt/custom/libs/ssl/include
-I/opt/custom/libs/pcre/include -I/opt/custom/libs/cdb/include"  
AUXLIBS="-R/opt/custom/libs/bdb/lib -R/opt/custom/libs/ssl/lib
-R/opt/custom/libs/pcre/lib -L/opt/custom/libs/bdb/lib
-L/opt/custom/libs/ssl/lib -L/opt/custom/libs/pcre/lib
/opt/custom/libs/cdb/lib/libcdb.a -ldb -lssl -lcrypto -lpcre"

rm -f libexec/post-install && ln -f conf/post-install libexec/post-install
rm -f libexec/postfix-files && ln -f conf/postfix-files
libexec/postfix-files
rm -f libexec/postfix-script && ln -f conf/postfix-script
libexec/postfix-script
rm -f libexec/postfix-wrapper && ln -f conf/postfix-wrapper
libexec/postfix-wrapper
rm -f libexec/main.cf && ln -f conf/main.cf libexec/main.cf
rm -f libexec/master.cf && ln -f conf/master.cf libexec/master.cf
rm -f libexec/postmulti-script && ln -f conf/postmulti-script
libexec/postmulti-script
set -e; for i in src/util src/global src/dns src/tls src/xsasl
src/milter src/master  src/postfix src/fsstone src/smtpstone 
src/sendmail src/error src/pickup src/cleanup src/smtpd src/local 
src/trivial-rewrite src/qmgr src/oqmgr src/smtp src/bounce  src/pipe
src/showq src/postalias src/postcat src/postconf src/postdrop 
src/postkick src/postlock src/postlog src/postmap src/postqueue 
src/postsuper src/qmqpd src/spawn src/flush src/verify  src/virtual
src/proxymap src/anvil src/scache src/discard src/tlsmgr  src/postmulti
src/postscreen src/dnsblog src/tlsproxy  src/posttls-finger; do \
(set -e; echo "[$i]"; cd $i; make 'CC=/opt/SUNWspro/bin/cc -I.
-I../../include -DHAS_DB -DUSE_TLS -DHAS_PCRE -DHAS_CDB
-I/opt/custom/libs/bdb/include -I/opt/custom/libs/ssl/include
-I/opt/custom/libs/pcre/include -I/opt/custom/libs/cdb/include
-DNO_NISPLUS -Dstrcasecmp=fix_strcasecmp                
-Dstrncasecmp=fix_strncasecmp -Wmissing-prototypes -Wformat
-Wno-comment' update MAKELEVEL=) || exit 1; \
done

[src/util]
/opt/SUNWspro/bin/cc -I. -I../../include -DHAS_DB -DUSE_TLS -DHAS_PCRE
-DHAS_CDB -I/opt/custom/libs/bdb/include -I/opt/custom/libs/ssl/include
-I/opt/custom/libs/pcre/include -I/opt/custom/libs/cdb/include
-DNO_NISPLUS -Dstrcasecmp=fix_strcasecmp               
-Dstrncasecmp=fix_strncasecmp -Wmissing-prototypes -Wformat -Wno-comment
-g -O -I. -DSUNOS5 -c alldig.c
cc: illegal option -Wmissing-prototypes
*** Error code 1
make: Fatal error: Command failed for target `alldig.o'
Current working directory
/export/home/install/compile/postfix/postfix-2.11.7/src/util
*** Error code 1
make: Fatal error: Command failed for target `update'

 
Below some system information. It would be nice, if you could give me a
clue. Maybe it is of interest, that I found another old source archive
of postfix-2.11.7.tar.gz in that home of that user. Trying to build
that, it fails with the same error. So I guess that there's been a
change between 2.11.4 and 2.11.7. Neither libs nor compiler were
changed, except openssl that build successfully for the current
openssl-1.0.2q. postfix-2.11.4 still builds fine without errors on that
system. I know that the cc-version is ancient, but it would be great if
is somehow possible to keep the build environment - any chance?

$ /opt/SUNWspro/bin/cc -V
cc: Sun C 5.9 SunOS_sparc 2007/05/03
usage: cc [ options] files.  Use 'cc -flags' for details

$ uname -a
SunOS gv-vmail-201 5.10 Generic_148888-03 sun4v sparc SUNW,T5140

Kind regards
  Jan
Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Jan P. Kessler
Hello,

I'm sorry for line breaks and showing the wrong output. It's not easy to
get that information here. Hope this will be readable.

    ### make makefiles finished; performing make ###

     
    rm -f meta/main.cf.proto && ln -f conf/main.cf meta/main.cf.proto
    rm -f meta/master.cf.proto && ln -f conf/master.cf meta/master.cf.proto
    rm -f meta/postfix-files
    (if [ "no" = "no" -o "no" = "" ]; then \
        sed -e '/^\$shlib_directory/d' \
            -e '/dynamicmaps.cf/d' conf/postfix-files; \
    elif [ "" = ":" -o "" = "" ]; then \
        sed -e '/dynamicmaps.cf/d' \
            -e '/^\$shlib_directory\/\${LIB_PREFIX}/d' \
            conf/postfix-files | sed -e "s;\${LIB_PREFIX};;"  -e
    "s;\${LIB_SUFFIX};.a;"; \
    else \
        sed -e "s;\${LIB_PREFIX};;"  -e "s;\${LIB_SUFFIX};.a;"
    conf/postfix-files | awk -F: ' \
            BEGIN { \
                count = split("'"db pcre cdb dev_urandom"'", names, " "); \
                for (n = 1; n <= count; n++) \
                    have["$shlib_directory/" names[n] \
                        ".a"] = 1; } \
            /^[$]shlib_directory./ { \
                if (have[$1]) print; next } \
            { print } \
        '; \
    fi) | case "" in \
    *) cat;; \
    esac > meta/postfix-files
    grep -v SHLIB_ENV conf/makedefs.out > meta/makedefs.out
    rm -f libexec/post-install && ln -f conf/post-install
    libexec/post-install
    rm -f libexec/postfix-script && ln -f conf/postfix-script
    libexec/postfix-script
    rm -f libexec/postfix-wrapper && ln -f conf/postfix-wrapper
    libexec/postfix-wrapper
    rm -f libexec/postmulti-script && ln -f conf/postmulti-script
    libexec/postmulti-script
    rm -f libexec/postfix-tls-script && ln -f conf/postfix-tls-script
    libexec/postfix-tls-script
    set -e; for i in src/util src/global src/dns src/tls src/xsasl
    src/master src/milter  src/postfix src/fsstone src/smtpstone 
    src/sendmail src/error src/pickup src/cleanup src/smtpd src/local 
    src/trivial-rewrite src/qmgr src/oqmgr src/smtp src/bounce  src/pipe
    src/showq src/postalias src/postcat src/postconf src/postdrop 
    src/postkick src/postlock src/postlog src/postmap src/postqueue 
    src/postsuper src/qmqpd src/spawn src/flush src/verify  src/virtual
    src/proxymap src/anvil src/scache src/discard src/tlsmgr 
    src/postmulti src/postscreen src/dnsblog src/tlsproxy 
    src/posttls-finger; do \
    (set -e; echo "[$i]"; cd $i; make 'WARN=-Wmissing-prototypes
    -Wformat -Wno-comment' update MAKELEVEL=) || exit 1; \
    done
    [src/util]
    /opt/SUNWspro/bin/cc -I. -I../../include -DHAS_DB -DUSE_TLS
    -DHAS_PCRE -DHAS_CDB -I/opt/custom/libs/bdb/include
    -I/opt/custom/libs/ssl/include -I/opt/custom/libs/pcre/include
    -I/opt/custom/libs/cdb/include -DNO_NISPLUS
    -Dstrcasecmp=fix_strcasecmp              
    -Dstrncasecmp=fix_strncasecmp -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\"no\"
    -DHAS_DEV_URANDOM -UUSE_DYNAMIC_LIBS -DDEF_SHLIB_DIR=\"no\"
    -UUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat -Wno-comment  -g -O
    -I. -DSUNOS5 -c alldig.c
    cc: illegal option -Wmissing-prototypes
    *** Error code 1
    make: Fatal error: Command failed for target `alldig.o'
    Current working directory
    /export/home/install/compile/postfix/postfix-3.3.2/src/util
    *** Error code 1
    make: Fatal error: Command failed for target `update'


Build-Script:

    #!/bin/bash

    # compiler
    MYLIB=/opt/custom/libs
    MYPATH=/opt/SUNWspro/bin
    MYCC=/opt/SUNWspro/bin/cc
    MYCXX=/opt/SUNWspro/bin/cc
    MYLIBS="-R${MYLIB}/bdb/lib -R${MYLIB}/ssl/lib -R${MYLIB}/pcre/lib
    -L${MYLIB}/bdb/lib -L${MYLIB}/ssl/lib -L${MYLIB}/pcre/lib
    ${MYLIB}/cdb/lib/libcdb.a"
    MYINCL="-I${MYLIB}/bdb/include -I${MYLIB}/ssl/include
    -I${MYLIB}/pcre/include -I${MYLIB}/cdb/include"

    PATH=$MYPATH:${MYLIB}/ssl/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,T5140/sbin:/opt/sun/bin:/opt/SUNWldm/bin
    unset LD_LIBRARY_PATH

    make tidy
    make makefiles CC=$MYCC CXX=$MYCXX \
      CCARGS="-DHAS_DB -DUSE_TLS -DHAS_PCRE -DHAS_CDB ${MYINCL}" \
      AUXLIBS="${MYLIBS} -ldb -lssl -lcrypto -lpcre"
    echo; echo; echo "### make makefiles finished; performing make ###";
    echo
    sleep 4
    make
    exit




Thanks, Jan


Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Wietse Venema
Jan P. Kessler:
>     -UUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat -Wno-comment? -g -O
>     -I. -DSUNOS5 -c alldig.c
>     cc: illegal option -Wmissing-prototypes

Try:

    make makefiles ...optional arguments...
    make WARN=

Sorry, I haven't built with /opt/SUNWspro/bin/cc for ~10 years.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Jan P. Kessler

> Try: make makefiles ...optional arguments... make WARN= Sorry, I
> haven't built with /opt/SUNWspro/bin/cc for ~10 years. Wietse

No problem. Seems like it's time for a change. After emptying WARN it
looked promising, but then the build broke here:

    "milter.c", line 621: non-constant initializer involving a cast
    "milter.c", line 622: non-constant initializer involving a cast
    "milter.c", line 623: non-constant initializer involving a cast
    "milter.c", line 627: non-constant initializer involving a cast
    "milter.c", line 628: non-constant initializer involving a cast
    cc: acomp failed for milter.c
    *** Error code 2
    make: Fatal error: Command failed for target `milter.o'
    Current working directory
    /export/home/install/compile/postfix/postfix-3.3.2/src/milter
    *** Error code 1
    make: Fatal error: Command failed for target `update'



I've managed to bring a gcc 4 to the system. Now everything works as
expected. Should have sold them more than 2h. You should really feel
ashamed for not supporting a 12 year old compiler suite anymore ;-)

Thank you for postfix and advice. R.I.P. sunstudio
   Jan

Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Wietse Venema
Jan P. Kessler:
>
> > Try: make makefiles ...optional arguments... make WARN= Sorry, I
> > haven't built with /opt/SUNWspro/bin/cc for ~10 years. Wietse
>
> No problem. Seems like it's time for a change. After emptying WARN it
> looked promising, but then the build broke here:
>
>     "milter.c", line 621: non-constant initializer involving a cast

That is a compiler bug.

    620 static ATTR_OVER_TIME time_table[] = {
    621     7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,

VAR_MILT_CONN_TIME is a constant ("milter_connect_timeout") therefore
7 + VAR_MILT_CONN_TIME ("connect_timeout") is a constant.

This code was introduced in Postfix 3.0, and by that time I no
longer had a SUN compiler to play with at work, otherwise I might
have found a workaround.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Jan P. Kessler

> That is a compiler bug. 620 static ATTR_OVER_TIME time_table[] = { 621
> 7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
> VAR_MILT_CONN_TIME is a constant ("milter_connect_timeout") therefore
> 7 + VAR_MILT_CONN_TIME ("connect_timeout") is a constant.

Good hint, thank you. I was able to get a newer version of sunstudio
(12.6) on that system. Now the build succeeds with "make WARN=". Am I
right to assume that I can safely ignore these?

    "../../include/vstream.h", line 215: warning: syntax error:  empty
    declaration
    "../../include/vstream.h", line 216: warning: syntax error:  empty
    declaration
    "../../include/mail_server.h", line 78: warning: syntax error: 
    empty declaration
    "../../include/mail_server.h", line 79: warning: syntax error: 
    empty declaration


Kind regards and again thank you for your help. It would save me a bunch
of work and a lot of explanations if I could stay with sunstudio. There
are a lot of depending libraries, that have been compiled with it and
the systems will be migrated by middle/end of the year (byebye niagara).
Therefore I didn't want to put too much work in this task.


Jan


Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Wietse Venema
Jan P. Kessler:

>
> > That is a compiler bug. 620 static ATTR_OVER_TIME time_table[] = { 621
> > 7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
> > VAR_MILT_CONN_TIME is a constant ("milter_connect_timeout") therefore
> > 7 + VAR_MILT_CONN_TIME ("connect_timeout") is a constant.
>
> Good hint, thank you. I was able to get a newer version of sunstudio
> (12.6) on that system. Now the build succeeds with "make WARN=". Am I
> right to assume that I can safely ignore these?
>
>     "../../include/vstream.h", line 215: warning: syntax error:? empty
>     declaration
>     "../../include/vstream.h", line 216: warning: syntax error:? empty
>     declaration
>     "../../include/mail_server.h", line 78: warning: syntax error:?
>     empty declaration
>     "../../include/mail_server.h", line 79: warning: syntax error:?
>     empty declaration

No idea. It if works, great. Otherwise, try compiling with this
workaround:

    make makefiles CCARGS='DNO_INLINE ...'

makedefs says:

    -DNO_INLINE
         Do not require support for C99 "inline" functions.  Instead,
         implement argument typechecks for non-(printf/scanf)-like
         functions with ternary operators and unreachable code.
 
> Kind regards and again thank you for your help. It would save me a bunch
> of work and a lot of explanations if I could stay with sunstudio. There
> are a lot of depending libraries, that have been compiled with it and
> the systems will be migrated by middle/end of the year (byebye niagara).
> Therefore I didn't want to put too much work in this task.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Jan P. Kessler

> No idea. It if works, great. Otherwise, try compiling with this
> workaround:

It works! Thanks to postfix and easy "make upgrade" the migration took
only seconds. I didn't even had to clear caches (tls,
recipient_verification) or such. Cool! Case closed.


Btw - nice for me to see, that postfwd runs stable for them - obviously :)


    Jan 20 18:10:51 postfwd-40/master[24907]: [STATS] postfwd-40::policy 1.35: 36550170 requests since 1146 days, 01:00:39 hours
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS] Requests: 12.60/min last, 22.15/min overall, 656.24/min top
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS] Dnsstats: 77.90/min last, 111.72/min overall, 1662.63/min top
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS] Hitrates: 97.6% ruleset, 0.0% parent, 0.0% child, 2.4% rates
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS] Timeouts: 0.0% (158 of 184363777 dns queries)
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS]   35664038 matches for id:  RBLA01
    Jan 20 18:10:52 postfwd-40/master[24907]: [STATS]   26945988 matches for id:  SC_RWL_01

Reply | Threaded
Open this post in threaded view
|

Re: unsuccessful build of postfix 3.3.2 on solaris (sparc) with sunstudio compiler

Wietse Venema
Jan P. Kessler:
>
> > No idea. It if works, great. Otherwise, try compiling with this
> > workaround:
>
> It works! Thanks to postfix and easy "make upgrade" the migration took
> only seconds. I didn't even had to clear caches (tls,
> recipient_verification) or such. Cool! Case closed.

To summarize, these were required?

    make makefiles CC=/opt/SUNWspro/bin/cc CCARGS="-DNO_INLINE ..." ...
    make WARN=

I'll see if I can automate that when CC is set to the SUN compiler.

> Btw - nice for me to see, that postfwd runs stable for them - obviously :)

Postfix has more workarounds for SUN than others, but then
it worked really well.

        Wietse