Compiler error on 3.3.1. Mac Mojave

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

Compiler error on 3.3.1. Mac Mojave

rachalmers

It’s almost through the build but failing on this.

Undefined symbols for architecture x86_64:
  "_db_create", referenced from:
      import-atom in libpostfix-util.dylib
  "_db_env_create", referenced from:
      import-atom in libpostfix-util.dylib
  "_db_version", referenced from:
      import-atom in libpostfix-util.dylib
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [master] Error 1
make: *** [update] Error 1
make: *** [update] Error 2


My Make script is this:

make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/opt/local/include/sasl -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include -DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" -DEF_MANPAGE_DIR=\"/usr/local/man\" -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" -DEF_README_DIR=\"/usr/share/doc/postfix\" -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib' 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc' 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’

any ideas where to turn?
Thanks
Robert
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.1. Mac Mojave

James Brown
On 8 Nov 2018, at 8:20 pm, Robert Chalmers <[hidden email]> wrote:

>
>
> It’s almost through the build but failing on this.
>
> Undefined symbols for architecture x86_64:
>  "_db_create", referenced from:
>      import-atom in libpostfix-util.dylib
>  "_db_env_create", referenced from:
>      import-atom in libpostfix-util.dylib
>  "_db_version", referenced from:
>      import-atom in libpostfix-util.dylib
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [master] Error 1
> make: *** [update] Error 1
> make: *** [update] Error 2
>
>
> My Make script is this:
>
> make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/opt/local/include/sasl -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include -DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" -DEF_MANPAGE_DIR=\"/usr/local/man\" -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" -DEF_README_DIR=\"/usr/share/doc/postfix\" -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib' 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc' 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’
>
> any ideas where to turn?
> Thanks
> Robert

Here’s my make script:

make -f Makefile.init makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\"dovecot\" \
-DDEF_COMMAND_DIR=\"/usr/local/sbin\" \
-DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" \
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" \
-DHAS_PCRE -I/usr/local/opt//include \
-DHAS_SSL -I/usr/local/opt/openssl@1.1 \
-DHAS_MYSQL -I/usr/local/opt/mysql@5.7/include/mysql' AUXLIBS='-L/usr/local/lib -lpcre -lssl -lcrypto -L/usr/local/opt/mysql@5.7/lib \
-lmysqlclient -lz -lm' sendmail_path=/usr/local/sbin/sendmail newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq

Victor Dukhovni suggested this a week ago on this mailing list:


You can make the recipe cleaner:

set --      -DUSE_TLS
set -- "$@" -DUSE_SASL_AUTH '-DDEF_SERVER_SASL_TYPE=\"dovecot\"'
set -- "$@" -DHAS_PCRE -I/usr/local/opt/include
set -- "$@" -DHAS_SSL -I/usr/local/opt/openssl@1.1
set -- "$@" -DHAS_MYSQL -I/usr/local/opt/mysql@5.7/include/mysql
CCARGS="$@"

set --      -L/usr/local/lib
set -- "$@" -lpcre
set -- "$@" -lssl -lcrypto
set -- "$@" -L/usr/local/opt/mysql@5.7/lib -lmysqlclient -lz -lm
AUXLIBS="$@"

set --      config_directory=/usr/local/etc/postfix
set -- "$@" command_directory=/usr/local/sbin
set -- "$@" daemon_directory=/usr/local/libexec/postfix
set -- "$@" sendmail_path=/usr/local/sbin/sendmail
set -- "$@" newaliases_path=/usr/local/bin/newaliases
set -- "$@" mailq_path=/usr/local/bin/mailq

make -f Makefile.init makefiles "$@" "CCARGS=${CCARGS}" "AUXLIBS=${AUXLIBS}"
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.1. Mac Mojave

Viktor Dukhovni
In reply to this post by rachalmers


> On Nov 8, 2018, at 4:20 AM, Robert Chalmers <[hidden email]> wrote:
>
> s almost through the build but failing on this.
>
> Undefined symbols for architecture x86_64:
>  "_db_create", referenced from:
>      import-atom in libpostfix-util.dylib
>  "_db_env_create", referenced from:
>      import-atom in libpostfix-util.dylib
>  "_db_version", referenced from:
>      import-atom in libpostfix-util.dylib
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [master] Error 1
> make: *** [update] Error 1
> make: *** [update] Error 2

You're compiling with Berkeley DB support enabled, but not providing
a "AUXLIBS" suitable library in which the Berkeley DB implementation
is to be find.  You may need homebrew or "macports", ... for that.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.1. Mac Mojave

Bill Cole-3
In reply to this post by rachalmers
On 8 Nov 2018, at 4:20, Robert Chalmers wrote:

> It’s almost through the build but failing on this.
>
> Undefined symbols for architecture x86_64:
>   "_db_create", referenced from:
>       import-atom in libpostfix-util.dylib
>   "_db_env_create", referenced from:
>       import-atom in libpostfix-util.dylib
>   "_db_version", referenced from:
>       import-atom in libpostfix-util.dylib
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make: *** [master] Error 1
> make: *** [update] Error 1
> make: *** [update] Error 2

Those symbols are from Berkeley DB. This implies that somewhere you have
included headers for BDB but can't find the BDB libraries at link time.

> My Make script is this:
>
> make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL
> -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL
> -I/opt/local/include/sasl
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl
> -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include

Hmmm.... Looks like you are building against both stuff installed under
/usr/local (used by Homebrew and many OSS projects by default) and under
/opt/local (typically MacPorts) and if you have a version of BDB
installed in either tree, Postfix may find its headers and so expect to
be able to find implementations of its symbols at link time.

Complicating matters, in any event the configure stage will find
/usr/include/db.h, the header for the original simpler Berkeley DB
implementation built into macOS.

> -DEF_COMMAND_DIR=\"/usr/local/sbin\"
> -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\"
> -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\"
> -DEF_DATA_DIR=\"/var/lib/postfix\"
> -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\"
> -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\"
> -DEF_MANPAGE_DIR=\"/usr/local/man\"
> -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\"
> -DEF_QUEUE_DIR=\"/private/var/spool/postfix\"
> -DEF_README_DIR=\"/usr/share/doc/postfix\"
> -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib
> -lsasl2 -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib'
> 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc'

So that's Homebrew...

> 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm'
> 'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’

Unless you've done an unusual installation of BDB, nothing here will
find a BDB implementation. You would need a '-L' option pointing to the
installation directory and '-ldb' telling the linker to load the db
library.

Also note: You MAY have libraries in that jumble linked against one or
more existing BDB installations and that becomes a mess pretty fast.

> any ideas where to turn?

Find where you've got a Berkeley DB implementation installed and see the
Postfix DB_README for details. Alternatively, you could just use the
MacPorts port of Postfix and have it handle all the details for you,
rather than grabbing random components from the base, Homebrew, manual
installations, and MacPorts. Build consistency across Postfix and its
dependencies is critical and using MacPorts would assure that for you.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.1. Mac Mojave

rachalmers
@Bill Cole, and others.

Thanks Bill. The key in all this was the “-ldb” … I’d missed that one. This is my make script now.

As you can see, I’m trying to remove all references to macports - and I think I have, and rely only only on Homebrew for extra stuff. It was - is - a bit of a mess I know. Been putting stuff on and off this machine for years now.
However - it all still works, and the build from this Makefile completed without errors this time.
I’m aware that it could use a bit of cleaning up as well, but for now - it works.

make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL -I/usr/local/include/mysql -I/usr/local/include -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include -DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" -DEF_MANPAGE_DIR=\"/usr/local/man\" -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" -DEF_README_DIR=\"/usr/share/doc/postfix\" -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib -ldb' 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc' 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'A
UXLIBS_PCRE=-L/usr/local/lib -lpcre’

In summary of the switches.
I have built in
MySQL
SASL
Cyrus-Sasl SASL support
Dovecot SASL support
PCRE
OpenSSL
Crypto
TLS


Thanks for the detailed breakdown. I pointed me right to the missing library. It was installed, I just wasn’t pointing to it.

Robert


On 8 Nov 2018, at 16:18, Bill Cole <[hidden email]> wrote:

On 8 Nov 2018, at 4:20, Robert Chalmers wrote:

It’s almost through the build but failing on this.

Undefined symbols for architecture x86_64:
 "_db_create", referenced from:
     import-atom in libpostfix-util.dylib
 "_db_env_create", referenced from:
     import-atom in libpostfix-util.dylib
 "_db_version", referenced from:
     import-atom in libpostfix-util.dylib
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [master] Error 1
make: *** [update] Error 1
make: *** [update] Error 2

Those symbols are from Berkeley DB. This implies that somewhere you have included headers for BDB but can't find the BDB libraries at link time.

My Make script is this:

make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/opt/local/include/sasl -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include

Hmmm.... Looks like you are building against both stuff installed under /usr/local (used by Homebrew and many OSS projects by default) and under /opt/local (typically MacPorts) and if you have a version of BDB installed in either tree, Postfix may find its headers and so expect to be able to find implementations of its symbols at link time.

Complicating matters, in any event the configure stage will find /usr/include/db.h, the header for the original simpler Berkeley DB implementation built into macOS.

-DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" -DEF_MANPAGE_DIR=\"/usr/local/man\" -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" -DEF_README_DIR=\"/usr/share/doc/postfix\" -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib' 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc'

So that's Homebrew...

'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’

Unless you've done an unusual installation of BDB, nothing here will find a BDB implementation. You would need a '-L' option pointing to the installation directory and '-ldb' telling the linker to load the db library.

Also note: You MAY have libraries in that jumble linked against one or more existing BDB installations and that becomes a mess pretty fast.

any ideas where to turn?

Find where you've got a Berkeley DB implementation installed and see the Postfix DB_README for details. Alternatively, you could just use the MacPorts port of Postfix and have it handle all the details for you, rather than grabbing random components from the base, Homebrew, manual installations, and MacPorts. Build consistency across Postfix and its dependencies is critical and using MacPorts would assure that for you.

Robert Chalmers
https://robert-chalmers.uk
[hidden email]
@R_A_Chalmers

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

rachalmers
In reply to this post by rachalmers
I'm now trying 3.3.2 and running into a mess of compile errors again.

Firstly -
Had to add this patch; referenced elsewhere, but known about.
     src/global/dict_mysql.c (postfix 3.2.0-5, 3.3.0 and current) to allow
build against MySQL 8.x
   
 Then had to add this define to dict_mysql.c

#define MYSQL_OPT_SSL_VERIFY_SERVER_CERT 0

Because the compiler was complaining that it wasn't declared. Compiles fine
past this until it gets to...

....... lots of these .......
 "_X509_getm_notBefore", referenced from:
      import-atom in libpostfix-tls.dylib
  "_X509_up_ref", referenced from:
      import-atom in libpostfix-tls.dylib
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make: *** [smtpd] Error 1
make: *** [update] Error 1
make: *** [update] Error 2

As mentioned previously, I'm on a Mac, mostly Homebrew installs of code
things.





--
Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

Viktor Dukhovni
You must be using LibreSSL, rather than OpenSSL.  LibreSSL is not
supported.

LibreSSL is squatting on OPENSSL_VERSION_NUMBER values for what
would be OpenSSL 2.x.y, which would be expected to have features
introduced in OpenSSL 1.1.0 and 1.1.1.

Recent MacOS ships LibreSSL, you need to use the include files
and libraries of the real OpenSSL from Homebrew.

> On Nov 27, 2018, at 4:58 AM, rachalmers <[hidden email]> wrote:
>
> "_X509_getm_notBefore", referenced from:
>      import-atom in libpostfix-tls.dylib
>  "_X509_up_ref", referenced from:
>      import-atom in libpostfix-tls.dylib
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make: *** [smtpd] Error 1
> make: *** [update] Error 1
> make: *** [update] Error 2
>
> As mentioned previously, I'm on a Mac, mostly Homebrew installs of code
> things.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

rachalmers
Thanks Victor.
Indeed, that was it the openssl problem.

I now have it set to the brew version of openssl. It compiled right through to the end.

set -- '-DUSE_TLS -I/usr/local/Cellar/openssl/1.0.2p/include'
set -- "$@" '-I/usr/local/opt/icu4c/include'
set -- "$@" '-DHAS_MYSQL -I/usr/local/include/mysql'
set -- '-DHAS_PCRE -I/usr/local/include'
set -- "$@" '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl'
CCARGS="$@"

set -- '-lsasl2'
set -- "$@" '-L/usr/local/Cellar/openssl/1.0.2p/lib -lssl -lcrypto'
set -- "$@" '-L/usr/local/lib -ldb'
set -- "$@" '-L/usr/lib -lsasl2'
set -- "$@" '-L/usr/local/opt/icu4c/lib -licuuc'
AUXLIBS="$@"


make -f Makefile.init shared=yes dynamicmaps=yes \
       config_directory=/usr/local/etc/postfix \
       command_directory=/usr/local/sbin \
       daemon_directory=/usr/local/libexec/postfix \
       queue_directory=/var/spool/postfix \
       data_directory=/var/lib/postfix \
       html_directory=/usr/share/doc/postfix/html \
       manpage_directory=/usr/local/man \
       readme_directory=/usr/share/doc/postfix \
       mailq_path=/usr/local/bin/mailq \
       newaliases_path=/usr/local/bin/newaliases \
       sendmail_path=/usr/local/sbin/sendmail \
       "CCARGS=${CCARGS}" \
       "AUXLIBS=${AUXLIBS}" \
       'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' \
       'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’


Thanks again. You’re a legend!
Robert

> On 27 Nov 2018, at 14:49, Viktor Dukhovni <[hidden email]> wrote:
>
> You must be using LibreSSL, rather than OpenSSL.  LibreSSL is not
> supported.
>
> LibreSSL is squatting on OPENSSL_VERSION_NUMBER values for what
> would be OpenSSL 2.x.y, which would be expected to have features
> introduced in OpenSSL 1.1.0 and 1.1.1.
>
> Recent MacOS ships LibreSSL, you need to use the include files
> and libraries of the real OpenSSL from Homebrew.
>
>> On Nov 27, 2018, at 4:58 AM, rachalmers <[hidden email]> wrote:
>>
>> "_X509_getm_notBefore", referenced from:
>>     import-atom in libpostfix-tls.dylib
>> "_X509_up_ref", referenced from:
>>     import-atom in libpostfix-tls.dylib
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> make: *** [smtpd] Error 1
>> make: *** [update] Error 1
>> make: *** [update] Error 2
>>
>> As mentioned previously, I'm on a Mac, mostly Homebrew installs of code
>> things.
>
> --
> Viktor.
>

Robert Chalmers
https://robert-chalmers.uk
[hidden email]
@R_A_Chalmers

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

Viktor Dukhovni
> On Nov 27, 2018, at 10:33 AM, Robert Chalmers <[hidden email]> wrote:
>
> set -- '-DUSE_TLS -I/usr/local/Cellar/openssl/1.0.2p/include'
> set -- "$@" '-I/usr/local/opt/icu4c/include'
> set -- "$@" '-DHAS_MYSQL -I/usr/local/include/mysql'
> set -- '-DHAS_PCRE -I/usr/local/include'
> set -- "$@" '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl'
> CCARGS="$@"
>
> set -- '-lsasl2'
> set -- "$@" '-L/usr/local/Cellar/openssl/1.0.2p/lib -lssl -lcrypto'
> set -- "$@" '-L/usr/local/lib -ldb'
> set -- "$@" '-L/usr/lib -lsasl2'
> set -- "$@" '-L/usr/local/opt/icu4c/lib -licuuc'
> AUXLIBS="$@"

If homebrew also provides OpenSSL 1.1.1a, I'd recommend 1.1.1a over 1.0.2p,
as support for the latter ends in December 2019, while 1.1.1 is the new
long-term stable release, for 5 years starting Sep 2018.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

Alice Wonder
On 11/27/2018 10:47 AM, Viktor Dukhovni wrote:

>> On Nov 27, 2018, at 10:33 AM, Robert Chalmers <[hidden email]> wrote:
>>
>> set -- '-DUSE_TLS -I/usr/local/Cellar/openssl/1.0.2p/include'
>> set -- "$@" '-I/usr/local/opt/icu4c/include'
>> set -- "$@" '-DHAS_MYSQL -I/usr/local/include/mysql'
>> set -- '-DHAS_PCRE -I/usr/local/include'
>> set -- "$@" '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl'
>> CCARGS="$@"
>>
>> set -- '-lsasl2'
>> set -- "$@" '-L/usr/local/Cellar/openssl/1.0.2p/lib -lssl -lcrypto'
>> set -- "$@" '-L/usr/local/lib -ldb'
>> set -- "$@" '-L/usr/lib -lsasl2'
>> set -- "$@" '-L/usr/local/opt/icu4c/lib -licuuc'
>> AUXLIBS="$@"
>
> If homebrew also provides OpenSSL 1.1.1a, I'd recommend 1.1.1a over 1.0.2p,
> as support for the latter ends in December 2019, while 1.1.1 is the new
> long-term stable release, for 5 years starting Sep 2018.
>

I might be wrong about this, but also I seem to recall seeing OpenSSL
1.1.0 or newer was needed for the Ed25519-sha256 sig support coming in
next OpenDKIM (and already in their Beta2 release).

Probably not a good idea to start signing that way yet but probably is
good idea to be able to validate others who adopt early.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

Viktor Dukhovni


> On Nov 27, 2018, at 2:14 PM, Alice Wonder <[hidden email]> wrote:
>
> I might be wrong about this, but also I seem to recall seeing OpenSSL 1.1.0
> or newer was needed for the Ed25519-sha256 sig support coming in next OpenDKIM
> (and already in their Beta2 release).

Actually, you need 1.1.1 (not 1.1.0) for Ed25519 support.

> Probably not a good idea to start signing that way yet but probably is good
> idea to be able to validate others who adopt early.

But Postfix outsources DKIM to milters, so Postfix itself does not need
the same OpenSSL version as the milter.  Still it is probably saner to
to depend on just the 1.1.1 version across the board.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

Wietse Venema
In reply to this post by rachalmers
rachalmers:

> I'm now trying 3.3.2 and running into a mess of compile errors again.
>
> Firstly -
> Had to add this patch; referenced elsewhere, but known about.
>      src/global/dict_mysql.c (postfix 3.2.0-5, 3.3.0 and current) to allow
> build against MySQL 8.x
>    
>  Then had to add this define to dict_mysql.c
>
> #define MYSQL_OPT_SSL_VERIFY_SERVER_CERT 0
>
> Because the compiler was complaining that it wasn't declared. Compiles fine

This is what we have in Postfix 3.4 development release:

/* MySQL 8.x API change */

#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50023
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
#elif MYSQL_VERSION_ID >= 80000
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
#endif

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.3.2. Mac Mojave (3.3.2)

rachalmers
Thanks for looking at this Viktor, I’ll catch up with your suggestions tomorrow, and will also look into 3.4 if it’s available yet. 
I realise I’m on a non- standard system but as Apple are steadily discontinuing 3rd party packages, and have already abandoned their own server, I’m happy I’m having a head start on all this.
I’ve got to get this build going clean because I want to install on my server to replace my 3.1

Robert


-----
Robert Chalmers
https://robert-chalmers.uk
[hidden email]
@R_A_Chalmers


On 27 Nov 2018, at 7:25 pm, Wietse Venema <[hidden email]> wrote:

rachalmers:
I'm now trying 3.3.2 and running into a mess of compile errors again.

Firstly -
Had to add this patch; referenced elsewhere, but known about.
    src/global/dict_mysql.c (postfix 3.2.0-5, 3.3.0 and current) to allow
build against MySQL 8.x

Then had to add this define to dict_mysql.c

#define MYSQL_OPT_SSL_VERIFY_SERVER_CERT 0

Because the compiler was complaining that it wasn't declared. Compiles fine

This is what we have in Postfix 3.4 development release:

/* MySQL 8.x API change */

#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50023
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
#elif MYSQL_VERSION_ID >= 80000
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
#endif

   Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Compiler error on 3.4. Mac Mojave (3.3.2)

rachalmers
In reply to this post by Wietse Venema

1 more error.

This error persists across 3.3.1, 3.3.2, and now 3.4. Obviously I’m doing something wrong but cant find what it is about the Berkeley db thing.

dict_db.c:768:2: error: "Unsupported Berkeley DB version"
#error "Unsupported Berkeley DB version"
 ^
1 error generated.
make: *** [dict_db.o] Error 1
make: *** [update] Error 1
make: *** [update] Error 2

The only way I could get past it was with the CCARGS=‘-DNO_DB’ switch. Kind of defeats my needs, because I use hash tables.

If I point to /usr/local/opt/berkeley-db@18/ for example, it still breaks. That's the latest available Berkeley-db


This build script…
set -- '-DUSE_TLS -I/usr/local/Cellar/openssl@1.1/1.1.1/include'
set -- "$@" '-I/usr/local/opt/icu4c/include'
set -- "$@" '-DHAS_MYSQL -I/usr/local/include/mysql'
set -- "$@" '-DHAS_PCRE -I/usr/local/include'
set -- "$@" '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DDEF_SERVER_SASL_TYPE=\"dovecot\" -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl'
CCARGS="$@"

set -- '-lsasl2'
set -- "$@" '-L/usr/local/Cellar/openssl@1.1/1.1.1/lib -lssl -lcrypto'
set -- "$@" '-L/usr/local/lib -ldb'
set -- "$@" '-L/usr/lib -lsasl2'
set -- "$@" '-L/usr/local/opt/icu4c/lib -licuuc'
set -- "$@" '-L/usr/local/opt/berkeley-db@18/lib -ldb'
AUXLIBS="$@"


make -f Makefile.init shared=yes dynamicmaps=yes \
       config_directory=/usr/local/etc/postfix \
       command_directory=/usr/local/sbin \
       daemon_directory=/usr/local/libexec/postfix \
       queue_directory=/var/spool/postfix \
       data_directory=/var/lib/postfix \
       html_directory=/usr/share/doc/postfix/html \
       manpage_directory=/usr/local/man \
       readme_directory=/usr/share/doc/postfix \
       mailq_path=/usr/local/bin/mailq \
       newaliases_path=/usr/local/bin/newaliases \
       sendmail_path=/usr/local/sbin/sendmail \
       "CCARGS=${CCARGS}" \
       "AUXLIBS=${AUXLIBS}" \
       'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' \
       'AUXLIBS_PCRE=-L/usr/local/lib -lpcre'

Any ideas where to turn...


> On 27 Nov 2018, at 19:25, Wietse Venema <[hidden email]> wrote:
>
> rachalmers:
>> I'm now trying 3.3.2 and running into a mess of compile errors again.
>>
>> Firstly -
>> Had to add this patch; referenced elsewhere, but known about.
>>     src/global/dict_mysql.c (postfix 3.2.0-5, 3.3.0 and current) to allow
>> build against MySQL 8.x
>>
>> Then had to add this define to dict_mysql.c
>>
>> #define MYSQL_OPT_SSL_VERIFY_SERVER_CERT 0
>>
>> Because the compiler was complaining that it wasn't declared. Compiles fine
>
> This is what we have in Postfix 3.4 development release:
>
> /* MySQL 8.x API change */
>
> #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50023
> #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
> #elif MYSQL_VERSION_ID >= 80000
> #define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
> #endif
>
> Wietse

Robert Chalmers
https://robert-chalmers.uk
[hidden email]
@R_A_Chalmers