Bug 235878

Summary: databases/mariadb102-server: Fails to link, undefined symbols referenced in storage/innobase/libinnobase.a
Product: Ports & Packages Reporter: Ivan Rozhuk <rozhuk.im>
Component: Individual Port(s)Assignee: Bernard Spil <brnrd>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: ekillips, rozhuk.im
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (brnrd)
Hardware: Any   
OS: Any   
URL: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236546
Attachments:
Description Flags
make.conf
none
clang configure
none
gcc configure
none
diff gcc clang configure none

Description Ivan Rozhuk 2019-02-20 12:18:36 UTC
[706/1807] : && /usr/local/libexec/ccache/c++  -O2 -pipe -O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline -fstack-protector-all -isystem /usr/local/include -fno-strict-aliasing -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline  -isystem /usr/local/include -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -fno-rtti -O2 -pipe -O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline -fstack-protector-all -isystem /usr/local/include -fno-strict-aliasing -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline  -isystem /usr/local/include -D_FORTIFY_SOURCE=2 -DDBUG_OFF  -Wl,-rpath,/usr/local/lib -fstack-protector extra/mariabackup/CMakeFiles/mbstream.dir/ds_buffer.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/ds_local.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/ds_stdout.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/datasink.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream_read.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream_write.cc.o  -o extra/mariabackup/mbstream  -Wl,-rpath,:::::::::::::: -pthread storage/innobase/libinnobase.a /usr/local/lib/liblz4.so /usr/local/lib/liblzo2.so -llzma -lbz2 mysys/libmysys.a extra/mariabackup/crc/libcrc.a dbug/libdbug.a mysys_ssl/libmysys_ssl.a mysys/libmysys.a dbug/libdbug.a mysys_ssl/libmysys_ssl.a -lm -lexecinfo strings/libstrings.a /usr/local/lib/libssl.so /usr/local/lib/libcrypto.so storage/innobase/libinnobase.a -pthread -lz /usr/local/lib/liblz4.so /usr/local/lib/liblzo2.so -llzma -lbz2 && :
FAILED: extra/mariabackup/mbstream 
: && /usr/local/libexec/ccache/c++  -O2 -pipe -O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline -fstack-protector-all -isystem /usr/local/include -fno-strict-aliasing -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline  -isystem /usr/local/include -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -fno-rtti -O2 -pipe -O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline -fstack-protector-all -isystem /usr/local/include -fno-strict-aliasing -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline  -isystem /usr/local/include -D_FORTIFY_SOURCE=2 -DDBUG_OFF  -Wl,-rpath,/usr/local/lib -fstack-protector extra/mariabackup/CMakeFiles/mbstream.dir/ds_buffer.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/ds_local.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/ds_stdout.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/datasink.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream_read.cc.o extra/mariabackup/CMakeFiles/mbstream.dir/xbstream_write.cc.o  -o extra/mariabackup/mbstream  -Wl,-rpath,:::::::::::::: -pthread storage/innobase/libinnobase.a /usr/local/lib/liblz4.so /usr/local/lib/liblzo2.so -llzma -lbz2 mysys/libmysys.a extra/mariabackup/crc/libcrc.a dbug/libdbug.a mysys_ssl/libmysys_ssl.a mysys/libmysys.a dbug/libdbug.a mysys_ssl/libmysys_ssl.a -lm -lexecinfo strings/libstrings.a /usr/local/lib/libssl.so /usr/local/lib/libcrypto.so storage/innobase/libinnobase.a -pthread -lz /usr/local/lib/liblz4.so /usr/local/lib/liblzo2.so -llzma -lbz2 && :
ld: error: undefined symbol: sql_print_information(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::info::~info()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_warning(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::warn::~warn()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_error(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::error::~error()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_error(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::fatal::~fatal()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_error(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::error_or_warn::~error_or_warn()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_warning(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::error_or_warn::~error_or_warn()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: sql_print_error(char const*, ...)
>>> referenced by ut0ut.cc
>>>               ut0ut.cc.o:(ib::fatal_or_error::~fatal_or_error()) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: wsrep_on
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: wsrep_trx_is_aborting
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: thd_wait_begin
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: thd_wait_end
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: wsrep_debug
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: thd_wait_end
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(srv_conc_enter_innodb(row_prebuilt_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: wsrep_debug
>>> referenced by srv0conc.cc
>>>               srv0conc.cc.o:(wsrep_srv_conc_cancel_wait(trx_t*)) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: create_thd()
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_destructor_proxy) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: set_thd_proc_info
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_destructor_proxy) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: set_thd_proc_info
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_destructor_proxy) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: thread_count
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_destructor_proxy) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: destroy_thd(THD*)
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_destructor_proxy) in archive storage/innobase/libinnobase.a

ld: error: undefined symbol: thd_slave_thread
>>> referenced by ha_innodb.cc
>>>               ha_innodb.cc.o:(thd_is_replication_slave_thread(THD*)) in archive storage/innobase/libinnobase.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-02-20 12:23:37 UTC
@Reporter, could you please provide

- complete system information (uname -a, etc)
- /etc/make.conf and other build configuration information
- Try to reproduce with ccache disabled
Comment 2 Ivan Rozhuk 2019-02-20 13:39:27 UTC
Created attachment 202184 [details]
make.conf

FreeBSD firewall 12.0-STABLE FreeBSD 12.0-STABLE #1 r344219M: Sun Feb 17 15:39:49 MSK 2019     root@firewall:/usr/obj/usr/src/amd64.amd64/sys/RIM_SRV  amd64

I try to disable ccache in make.conf and deinstall it - not help.
Port options:
LZ4
LZO
INNOBASE
XTRADB
GSSAPI_NONE
Comment 3 Bernard Spil freebsd_committer freebsd_triage 2019-02-20 20:36:28 UTC
Comment on attachment 202184 [details]
make.conf

Can you try disabling XtraDB? Having both XtraDB and InnoDB doesn't make much sense as at run-time you can't have them both...
Comment 4 Ivan Rozhuk 2019-02-20 22:09:09 UTC
(In reply to Bernard Spil from comment #3)
INNOBASE only - fail
XTRADB only - ok
Comment 5 Bernard Spil freebsd_committer freebsd_triage 2019-02-22 20:03:12 UTC
That's weird. I have the default options building just fine on vanilla 12.0 amd64.
Comment 6 Ivan Rozhuk 2019-04-27 21:53:11 UTC
I try to build with gcc, it is ok.
env USE_GCC=yes make
1782 files to build.
make package - ok.

clang try to build 1811 files.
clang always show:
c++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]

I also try to build with clang and
env LLD_UNSAFE=yes make
builds 1811 files ok.
make package - ok.

There was another bug that fixed with LLD_UNSAFE:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236546
probably something happen with lld on FreeBSD 12.
Comment 7 Ivan Rozhuk 2019-04-27 21:54:41 UTC
Created attachment 204070 [details]
clang configure
Comment 8 Ivan Rozhuk 2019-04-27 21:55:18 UTC
Created attachment 204071 [details]
gcc configure
Comment 9 Ivan Rozhuk 2019-04-27 21:56:47 UTC
Created attachment 204072 [details]
diff gcc clang configure

clang and clang +LLD_UNSAFE=yes diff only with:
+===>   mariadb102-server-10.2.23 depends on file: /usr/local/bin/as - found
Comment 10 Ivan Rozhuk 2019-11-03 17:09:09 UTC
Now works ok, probably update llvm in system fix it.