postfix-3.4.9 compilation fails with gcc-10

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

postfix-3.4.9 compilation fails with gcc-10

Jaroslav Škarvada
/usr/bin/ld: anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999: multiple definition of `var_tlsp_clnt_policy'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999: first defined here
/usr/bin/ld: anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3995: multiple definition of `var_tlsp_clnt_per_site'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3995: first defined here
/usr/bin/ld: anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3991: multiple definition of `var_tlsp_clnt_level'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3991: first defined here
/usr/bin/ld: anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3987: multiple definition of `var_tlsp_clnt_enforce_tls'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3987: first defined here
/usr/bin/ld: anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3983: multiple definition of `var_tlsp_clnt_use_tls'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3983: first defined here
/usr/bin/ld: bounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999: multiple definition of `var_tlsp_clnt_policy'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999: first defined here
/usr/bin/ld: bounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3995: multiple definition of `var_tlsp_clnt_per_site'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3995: first defined here
/usr/bin/ld: bounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3991: multiple definition of `var_tlsp_clnt_level'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3991: first defined here
/usr/bin/ld: bounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3987: multiple definition of `var_tlsp_clnt_enforce_tls'; abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3987: first defined here
...
collect2: error: ld returned 1 exit status
make: *** [Makefile:206: libpostfix-global.so] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:105: update] Error 1

Probably older versions of postfix fails as well (I haven't tried).

This is caused by a change in GCC 10 from -fcommon to -fno-common [1]:

GCC now defaults to -fno-common. As a result, global variable accesses
are more efficient on various targets. In C, global variables with multiple
 tentative definitions now result in linker errors. With -fcommon such
definitions are silently merged during linking.

If compiling with -fcommon it builds OK

thanks & regards

Jaroslav

[1] https://gcc.gnu.org/gcc-10/changes.html

Reply | Threaded
Open this post in threaded view
|

Re: postfix-3.4.9 compilation fails with gcc-10

Wietse Venema
Jaroslav Skarvada:
> /usr/bin/ld:
> anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999:
> multiple definition of `var_tlsp_clnt_policy';
> abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999:
> first defined here

Fixed in Postfix 3.5. I.e. don't change compilers on a stable release.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix-3.4.9 compilation fails with gcc-10

Wietse Venema
Wietse Venema:
> Jaroslav Skarvada:
> > /usr/bin/ld:
> > anvil_clnt.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999:
> > multiple definition of `var_tlsp_clnt_policy';
> > abounce.o:/builddir/build/BUILD/postfix-3.4.9/src/global/./mail_params.h:3999:
> > first defined here
>
> Fixed in Postfix 3.5. I.e. don't change compilers on a stable release.

Patch for 3.5 is at https://marc.info/?l=postfix-users&m=157960560219966&w=2
and other archives.

        Wietse