gcc-10 flipped a default from -fcommon to -fno-common[1] resulting in
the following errors while building postfix-3.5-20200112. Simple
reproducer on an older gcc is to add -fno-common to CFLAGS.
/usr/x86_64-pc-linux-gnu/gcc-bin/10.0.0-pre9999/gcc -shared
-Wl,-soname,libpostfix-global.so -Wl,--enable-new-dtags
-Wl,-rpath,/usr/lib64/postfix/3.5-20200112 -o libpostfix-global.so abounce.o
anvil_clnt.o been_here.o bounce.o bounce_log.o canon_addr.o cfg_parser.o
cleanup_strerror.o cleanup_strflags.o clnt_stream.o conv_time.o db_common.o
debug_peer.o debug_process.o defer.o deliver_completed.o deliver_flock.o
deliver_pass.o deliver_request.o dict_proxy.o domain_list.o dot_lockfile.o
dot_lockfile_as.o dsb_scan.o dsn.o dsn_buf.o dsn_mask.o dsn_print.o dsn_util.o
ehlo_mask.o ext_prop.o file_id.o flush_clnt.o header_opts.o header_token.o
input_transp.o int_filt.o is_header.o log_adhoc.o mail_addr.o
mail_addr_crunch.o mail_addr_find.o mail_addr_map.o mail_command_client.o
mail_command_server.o mail_conf.o mail_conf_bool.o mail_conf_int.o
mail_conf_long.o mail_conf_raw.o mail_conf_str.o mail_conf_time.o
mail_connect.o mail_copy.o mail_date.o mail_dict.o mail_error.o mail_flush.o
mail_open_ok.o mail_params.o mail_pathname.o mail_queue.o mail_run.o
mail_scan_dir.o mail_stream.o mail_task.o mail_trigger.o maps.o mark_corrupt.o
match_parent_style.o mbox_conf.o mbox_open.o mime_state.o mkmap_db.o
mkmap_dbm.o mkmap_open.o msg_stats_print.o msg_stats_scan.o mynetworks.o
mypwd.o namadr_list.o off_cvt.o opened.o own_inet_addr.o pipe_command.o
post_mail.o quote_821_local.o quote_822_local.o rcpt_buf.o rcpt_print.o
rec_attr_map.o rec_streamlf.o rec_type.o recipient_list.o record.o remove.o
resolve_clnt.o resolve_local.o rewrite_clnt.o scache_clnt.o scache_multi.o
scache_single.o sent.o smtp_stream.o split_addr.o string_list.o strip_addr.o
sys_exits.o timed_ipc.o tok822_find.o tok822_node.o tok822_parse.o
tok822_resolve.o tok822_rewrite.o tok822_tree.o trace.o user_acl.o
valid_mailhost_addr.o verify.o verify_clnt.o verp_sender.o wildcard_inet_addr.o
xtext.o delivered_hdr.o fold_addr.o header_body_checks.o mkmap_proxy.o
data_redirect.o match_service.o mail_conf_nint.o addr_match_list.o
mail_conf_nbool.o smtp_reply_footer.o safe_ultostr.o verify_sender_addr.o
dict_memcache.o mail_version.o memcache_proto.o server_acl.o mkmap_fail.o
haproxy_srvr.o dsn_filter.o dynamicmaps.o uxtext.o smtputf8.o attr_override.o
mail_parm_split.o midna_adomain.o dict_ldap.o dict_mysql.o dict_pgsql.o
dict_sqlite.o mkmap_cdb.o mkmap_lmdb.o mkmap_sdbm.o mail_addr_form.o
quote_flags.o maillog_client.o normalize_mailhost_addr.o map_search.o
reject_deliver_request.o info_log_addr_form.o -Wl,-O1 -Wl,--as-needed -ldl
-lpam -lssl -lcrypto -lldap -llber -L/usr/lib64 -lpcre -ldb -lnsl -lresolv -ldl
-licui18n -licuuc -licudata
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
anvil_clnt.o:(.bss+0x0): multiple definition of `var_tlsp_clnt_policy';
abounce.o:(.bss+0x0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
anvil_clnt.o:(.bss+0x8): multiple definition of `var_tlsp_clnt_per_site';
abounce.o:(.bss+0x8): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
anvil_clnt.o:(.bss+0x10): multiple definition of `var_tlsp_clnt_level';
abounce.o:(.bss+0x10): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
anvil_clnt.o:(.bss+0x18): multiple definition of `var_tlsp_clnt_enforce_tls';
abounce.o:(.bss+0x18): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
anvil_clnt.o:(.bss+0x1c): multiple definition of `var_tlsp_clnt_use_tls';
abounce.o:(.bss+0x1c): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
bounce.o:(.bss+0x8): multiple definition of `var_tlsp_clnt_policy';
abounce.o:(.bss+0x0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
bounce.o:(.bss+0x10): multiple definition of `var_tlsp_clnt_per_site';
abounce.o:(.bss+0x8): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
bounce.o:(.bss+0x18): multiple definition of `var_tlsp_clnt_level';
abounce.o:(.bss+0x10): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
bounce.o:(.bss+0x20): multiple definition of `var_tlsp_clnt_enforce_tls';
abounce.o:(.bss+0x18): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/10.0.0-pre9999/../../../../x86_64-pc-linux-gnu/bin/ld:
bounce.o:(.bss+0x24): multiple definition of `var_tlsp_clnt_use_tls';
abounce.o:(.bss+0x1c): first defined here
[...]
collect2: error: ld returned 1 exit status
make: *** [Makefile:208: libpostfix-global.so] Error 1
make: *** [Makefile:100: update] Error 1
the following seems to be the problem:
# grep "multiple definition"
/var/log/portage/mail-mta\:postfix-3.5_pre20200112\:20200120-133517.log | cut
-d" " -f6 | sort | uniq -c
171 `var_tlsp_clnt_enforce_tls';
171 `var_tlsp_clnt_level';
171 `var_tlsp_clnt_per_site';
171 `var_tlsp_clnt_policy';
171 `var_tlsp_clnt_use_tls';
--
Eray
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678