clang builds fail on i386

Description

Building fails in linker. Full build log here
Only observed on i386 with clang. Builds OK on i386 on amd64.
Found a potentially relevant bug post on llvm bugzilla hinting at requirement to add alignment.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 [ 47%] Linking CXX static library libsql.a cd /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql && /usr/local/bin/cmake -P CMakeFiles/sql.dir/cmake_clean_target.cmake cd /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/sql.dir/link.txt --verbose=1 /usr/bin/ar qc libsql.a CMakeFiles/sql.dir/__/sql-common/client.c.o CMakeFiles/sql.dir/compat56.cc.o CMakeFiles/sql.dir/derror.cc.o CMakeFiles/sql.dir/des_key_file.cc.o CMakeFiles/sql.dir/discover.cc.o CMakeFiles/sql.dir/__/libmysql/errmsg.c.o CMakeFiles/sql.dir/field.cc.o CMakeFiles/sql.dir/field_conv.cc.o CMakeFiles/sql.dir/filesort_utils.cc.o CMakeFiles/sql.dir/filesort.cc.o CMakeFiles/sql.dir/gstream.cc.o CMakeFiles/sql.dir/sha2.cc.o CMakeFiles/sql.dir/signal_handler.cc.o CMakeFiles/sql.dir/handler.cc.o CMakeFiles/sql.dir/hostname.cc.o CMakeFiles/sql.dir/init.cc.o CMakeFiles/sql.dir/item.cc.o CMakeFiles/sql.dir/item_buff.cc.o CMakeFiles/sql.dir/item_cmpfunc.cc.o CMakeFiles/sql.dir/item_create.cc.o CMakeFiles/sql.dir/item_func.cc.o CMakeFiles/sql.dir/item_geofunc.cc.o CMakeFiles/sql.dir/item_row.cc.o CMakeFiles/sql.dir/item_strfunc.cc.o CMakeFiles/sql.dir/item_subselect.cc.o CMakeFiles/sql.dir/item_sum.cc.o CMakeFiles/sql.dir/item_timefunc.cc.o CMakeFiles/sql.dir/key.cc.o CMakeFiles/sql.dir/log.cc.o CMakeFiles/sql.dir/lock.cc.o CMakeFiles/sql.dir/log_event.cc.o CMakeFiles/sql.dir/rpl_record.cc.o CMakeFiles/sql.dir/rpl_reporting.cc.o CMakeFiles/sql.dir/log_event_old.cc.o CMakeFiles/sql.dir/rpl_record_old.cc.o CMakeFiles/sql.dir/mf_iocache.cc.o CMakeFiles/sql.dir/my_decimal.cc.o CMakeFiles/sql.dir/__/sql-common/my_time.c.o CMakeFiles/sql.dir/mysqld.cc.o CMakeFiles/sql.dir/net_serv.cc.o CMakeFiles/sql.dir/keycaches.cc.o CMakeFiles/sql.dir/__/sql-common/client_plugin.c.o CMakeFiles/sql.dir/opt_range.cc.o CMakeFiles/sql.dir/opt_sum.cc.o CMakeFiles/sql.dir/__/sql-common/pack.c.o CMakeFiles/sql.dir/parse_file.cc.o CMakeFiles/sql.dir/password.c.o CMakeFiles/sql.dir/procedure.cc.o CMakeFiles/sql.dir/protocol.cc.o CMakeFiles/sql.dir/records.cc.o CMakeFiles/sql.dir/repl_failsafe.cc.o CMakeFiles/sql.dir/rpl_filter.cc.o CMakeFiles/sql.dir/set_var.cc.o CMakeFiles/sql.dir/slave.cc.o CMakeFiles/sql.dir/sp.cc.o CMakeFiles/sql.dir/sp_cache.cc.o CMakeFiles/sql.dir/sp_head.cc.o CMakeFiles/sql.dir/sp_pcontext.cc.o CMakeFiles/sql.dir/sp_rcontext.cc.o CMakeFiles/sql.dir/spatial.cc.o CMakeFiles/sql.dir/sql_acl.cc.o CMakeFiles/sql.dir/sql_analyse.cc.o CMakeFiles/sql.dir/sql_base.cc.o CMakeFiles/sql.dir/sql_cache.cc.o CMakeFiles/sql.dir/sql_class.cc.o CMakeFiles/sql.dir/sql_client.cc.o CMakeFiles/sql.dir/sql_crypt.cc.o CMakeFiles/sql.dir/sql_cursor.cc.o CMakeFiles/sql.dir/sql_db.cc.o CMakeFiles/sql.dir/sql_delete.cc.o CMakeFiles/sql.dir/sql_derived.cc.o CMakeFiles/sql.dir/sql_digest.cc.o CMakeFiles/sql.dir/sql_do.cc.o CMakeFiles/sql.dir/sql_error.cc.o CMakeFiles/sql.dir/sql_handler.cc.o CMakeFiles/sql.dir/sql_get_diagnostics.cc.o CMakeFiles/sql.dir/sql_help.cc.o CMakeFiles/sql.dir/sql_insert.cc.o CMakeFiles/sql.dir/sql_lex.cc.o CMakeFiles/sql.dir/sql_list.cc.o CMakeFiles/sql.dir/sql_load.cc.o CMakeFiles/sql.dir/sql_manager.cc.o CMakeFiles/sql.dir/sql_parse.cc.o CMakeFiles/sql.dir/sql_bootstrap.cc.o CMakeFiles/sql.dir/sql_partition.cc.o CMakeFiles/sql.dir/sql_plugin.cc.o CMakeFiles/sql.dir/sql_prepare.cc.o CMakeFiles/sql.dir/sql_rename.cc.o CMakeFiles/sql.dir/debug_sync.cc.o CMakeFiles/sql.dir/sql_repl.cc.o CMakeFiles/sql.dir/sql_select.cc.o CMakeFiles/sql.dir/sql_show.cc.o CMakeFiles/sql.dir/sql_state.c.o CMakeFiles/sql.dir/group_by_handler.cc.o CMakeFiles/sql.dir/sql_statistics.cc.o CMakeFiles/sql.dir/sql_string.cc.o CMakeFiles/sql.dir/sql_table.cc.o CMakeFiles/sql.dir/sql_test.cc.o CMakeFiles/sql.dir/sql_trigger.cc.o CMakeFiles/sql.dir/sql_udf.cc.o CMakeFiles/sql.dir/sql_union.cc.o CMakeFiles/sql.dir/sql_update.cc.o CMakeFiles/sql.dir/sql_view.cc.o CMakeFiles/sql.dir/strfunc.cc.o CMakeFiles/sql.dir/table.cc.o CMakeFiles/sql.dir/thr_malloc.cc.o CMakeFiles/sql.dir/sql_time.cc.o CMakeFiles/sql.dir/tztime.cc.o CMakeFiles/sql.dir/uniques.cc.o CMakeFiles/sql.dir/unireg.cc.o CMakeFiles/sql.dir/item_xmlfunc.cc.o CMakeFiles/sql.dir/rpl_tblmap.cc.o CMakeFiles/sql.dir/sql_binlog.cc.o CMakeFiles/sql.dir/event_scheduler.cc.o CMakeFiles/sql.dir/event_data_objects.cc.o CMakeFiles/sql.dir/event_queue.cc.o CMakeFiles/sql.dir/event_db_repository.cc.o CMakeFiles/sql.dir/sql_tablespace.cc.o CMakeFiles/sql.dir/events.cc.o CMakeFiles/sql.dir/__/sql-common/my_user.c.o CMakeFiles/sql.dir/partition_info.cc.o CMakeFiles/sql.dir/rpl_utility.cc.o CMakeFiles/sql.dir/rpl_injector.cc.o CMakeFiles/sql.dir/sql_locale.cc.o CMakeFiles/sql.dir/rpl_rli.cc.o CMakeFiles/sql.dir/rpl_mi.cc.o CMakeFiles/sql.dir/sql_servers.cc.o CMakeFiles/sql.dir/sql_audit.cc.o CMakeFiles/sql.dir/sql_connect.cc.o CMakeFiles/sql.dir/scheduler.cc.o CMakeFiles/sql.dir/sql_partition_admin.cc.o CMakeFiles/sql.dir/sql_profile.cc.o CMakeFiles/sql.dir/event_parse_data.cc.o CMakeFiles/sql.dir/sql_alter.cc.o CMakeFiles/sql.dir/sql_signal.cc.o CMakeFiles/sql.dir/rpl_handler.cc.o CMakeFiles/sql.dir/mdl.cc.o CMakeFiles/sql.dir/sql_admin.cc.o CMakeFiles/sql.dir/transaction.cc.o CMakeFiles/sql.dir/sys_vars.cc.o CMakeFiles/sql.dir/sql_truncate.cc.o CMakeFiles/sql.dir/datadict.cc.o CMakeFiles/sql.dir/sql_reload.cc.o CMakeFiles/sql.dir/item_inetfunc.cc.o CMakeFiles/sql.dir/sql_explain.cc.o CMakeFiles/sql.dir/sql_analyze_stmt.cc.o CMakeFiles/sql.dir/sql_join_cache.cc.o CMakeFiles/sql.dir/create_options.cc.o CMakeFiles/sql.dir/multi_range_read.cc.o CMakeFiles/sql.dir/opt_index_cond_pushdown.cc.o CMakeFiles/sql.dir/opt_subselect.cc.o CMakeFiles/sql.dir/opt_table_elimination.cc.o CMakeFiles/sql.dir/sql_expression_cache.cc.o CMakeFiles/sql.dir/gcalc_slicescan.cc.o CMakeFiles/sql.dir/gcalc_tools.cc.o CMakeFiles/sql.dir/threadpool_common.cc.o CMakeFiles/sql.dir/__/sql-common/mysql_async.c.o CMakeFiles/sql.dir/my_apc.cc.o CMakeFiles/sql.dir/mf_iocache_encr.cc.o CMakeFiles/sql.dir/my_json_writer.cc.o CMakeFiles/sql.dir/rpl_gtid.cc.o CMakeFiles/sql.dir/rpl_parallel.cc.o CMakeFiles/sql.dir/sql_type.cc.o CMakeFiles/sql.dir/wsrep_check_opts.cc.o CMakeFiles/sql.dir/wsrep_hton.cc.o CMakeFiles/sql.dir/wsrep_mysqld.cc.o CMakeFiles/sql.dir/wsrep_notify.cc.o CMakeFiles/sql.dir/wsrep_sst.cc.o CMakeFiles/sql.dir/wsrep_utils.cc.o CMakeFiles/sql.dir/wsrep_var.cc.o CMakeFiles/sql.dir/wsrep_binlog.cc.o CMakeFiles/sql.dir/wsrep_applier.cc.o CMakeFiles/sql.dir/wsrep_thd.cc.o CMakeFiles/sql.dir/wsrep_xid.cc.o CMakeFiles/sql.dir/table_cache.cc.o CMakeFiles/sql.dir/encryption.cc.o CMakeFiles/sql.dir/sql_builtin.cc.o CMakeFiles/sql.dir/sql_yacc.cc.o CMakeFiles/sql.dir/__/mysys/my_libwrap.c.o CMakeFiles/sql.dir/threadpool_unix.cc.o /usr/bin/ranlib libsql.a [ 47%] Built target sql /usr/bin/make -f sql/CMakeFiles/mysqld.dir/build.make sql/CMakeFiles/mysqld.dir/depend cd /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11 && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11 /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11 /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/CMakeFiles/mysqld.dir/DependInfo.cmake Scanning dependencies of target mysqld /usr/bin/make -f sql/CMakeFiles/mysqld.dir/build.make sql/CMakeFiles/mysqld.dir/build [ 47%] Building CXX object sql/CMakeFiles/mysqld.dir/main.cc.o cd /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql && /usr/bin/c++ -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_OPENSSL -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -Dmysqld_EXPORTS -I/wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/include -I/wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql -I/wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/pcre -I/wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/wsrep -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DWITH_INNODB_DISALLOW_WRITES -fno-exceptions -fno-rtti -O2 -pipe -fstack-protector -fno-strict-aliasing -DDBUG_OFF -o CMakeFiles/mysqld.dir/main.cc.o -c /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/main.cc [ 47%] Linking CXX executable mysqld cd /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/mysqld.dir/link.txt --verbose=1 /usr/bin/c++ -O2 -pipe -fstack-protector -fno-strict-aliasing -DWITH_INNODB_DISALLOW_WRITES -fno-exceptions -fno-rtti -O2 -pipe -fstack-protector -fno-strict-aliasing -DDBUG_OFF -fstack-protector -Wl,--export-dynamic CMakeFiles/mysqld.dir/main.cc.o -o mysqld -pthread libsql.a ../storage/myisammrg/libmyisammrg.a ../storage/maria/libaria.a ../storage/sequence/libsequence.a ../storage/heap/libheap.a ../storage/perfschema/libperfschema.a ../storage/myisam/libmyisam.a ../storage/csv/libcsv.a ../storage/xtradb/libxtradb.a -llzma -lbz2 ../plugin/userstat/libuserstat.a ../plugin/feedback/libfeedback.a libpartition.a ../mysys/libmysys.a ../mysys_ssl/libmysys_ssl.a ../dbug/libdbug.a ../mysys/libmysys.a ../mysys_ssl/libmysys_ssl.a ../dbug/libdbug.a -lz -lm -lexecinfo ../strings/libstrings.a ../vio/libvio.a ../pcre/libpcre.a -lc -lwrap -lcrypt -lssl -lcrypto ../wsrep/libwsrep.a -pthread libsql.a(mysqld.cc.o): In function `my_malloc_size_cb_func(long long, char)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/mysqld.cc:(.text+0xc024): undefined reference to `__atomic_fetch_add_8' libsql.a(slave.cc.o): In function `handle_slave_sql': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/slave.cc:(.text+0x9b6e): undefined reference to `__atomic_fetch_add_8' libsql.a(sql_class.cc.o): In function `add_to_status(system_status_var*, system_status_var*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sql_class.cc:(.text+0x411f): undefined reference to `__atomic_fetch_add_8' libsql.a(sql_parse.cc.o): In function `dispatch_command(enum_server_command, THD*, char*, unsigned int)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sql_parse.cc:(.text+0xdb4): undefined reference to `__atomic_fetch_add_8' /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sql_parse.cc:(.text+0xdca): undefined reference to `__atomic_load_8' /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sql_parse.cc:(.text+0x23fd): undefined reference to `__atomic_fetch_add_8' libsql.a(sql_parse.cc.o): In function `do_handle_bootstrap(THD*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sql_parse.cc:(.text+0x2999): undefined reference to `__atomic_fetch_add_8' libsql.a(rpl_parallel.cc.o): In function `rpt_handle_event(rpl_parallel_thread::queued_event*, rpl_parallel_thread*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/rpl_parallel.cc:(.text+0x3f83): undefined reference to `__atomic_fetch_add_8' libsql.a(table_cache.cc.o): In function `tdc_acquire_share(THD*, char const*, char const*, char const*, unsigned int, unsigned int, unsigned int, TABLE**)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/table_cache.cc:(.text+0x188e): undefined reference to `__atomic_load_8' libsql.a(table_cache.cc.o): In function `tdc_refresh_version()': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/table_cache.cc:(.text+0x19a6): undefined reference to `__atomic_load_8' libsql.a(table_cache.cc.o): In function `tdc_increment_refresh_version()': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/table_cache.cc:(.text+0x2286): undefined reference to `__atomic_fetch_add_8' libsql.a(table_cache.cc.o): In function `tdc_assign_new_table_id(TABLE_SHARE*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/table_cache.cc:(.text+0x236a): undefined reference to `__atomic_fetch_add_8' libsql.a(log_event.cc.o): In function `Query_log_event::do_apply_event(rpl_group_info*, char const*, unsigned int)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/log_event.cc:(.text+0x4418): undefined reference to `__atomic_fetch_add_8' libsql.a(log_event.cc.o): In function `Load_log_event::do_apply_event(st_net*, rpl_group_info*, bool)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/log_event.cc:(.text+0x82be): undefined reference to `__atomic_fetch_add_8' libsql.a(log_event.cc.o): In function `Gtid_log_event::do_apply_event(rpl_group_info*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/log_event.cc:(.text+0x9c8c): undefined reference to `__atomic_fetch_add_8' libsql.a(log_event.cc.o):/wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/log_event.cc:(.text+0x11c46): more undefined references to `__atomic_fetch_add_8' follow libsql.a(sp_head.cc.o): In function `sp_head::execute_function(THD*, Item**, unsigned int, Field*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sp_head.cc:(.text+0x27ee): undefined reference to `__atomic_load_8' libsql.a(sp_head.cc.o): In function `sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*)': /wrkdirs/usr/ports/databases/mariadb101-server/work/mariadb-10.1.11/sql/sp_head.cc:(.text+0x5485): undefined reference to `__atomic_fetch_add_8' c++: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1

Environment

FreeBSD 10.2 i386
clang 3.4

Status

Assignee

Sergei Golubchik

Reporter

Bernard Spil

Labels

None

External issue ID

None

External issue ID

None

Components

Fix versions

Affects versions

10.1.11

Priority

Major