mysql build failed with: ../../strings/.libs/libmystrings.so: undefined reference to `_db_pargs_' ../../strings/.libs/libmystrings.so: undefined reference to `_db_doprnt_' ../../strings/.libs/libmystrings.so: undefined reference to `_db_enter_' ../../strings/.libs/libmystrings.so: undefined reference to `_db_return_' Tried several times, but the result is the same. It might be ebuild issue also. Please look at upstream, bug report. The similar problem occurs when building from "old tree". I am not sure what stands for "tree" term. ccache disabled.
Created attachment 253839 [details] Build log
Created attachment 253841 [details] Emerge --info output
I am seeing this same build error. I have MySQL on two different machines, and it spits this error out on only one. The only difference between the two is that I have the "debug" USE flag set on the one that is failing. The "debug" USE flag is also set in the attached "emerge --info" output that the OP provided. I'm recompiling now without the flag enabled and will post results as soon as it's finished.
To update, the build completed successfully with the "debug" USE flag turned off. So that would appear to be the immediate workaround for this issue, until somebody can figure out what the problem is with the debugging code.
(In reply to comment #3) > I am seeing this same build error. I have MySQL on two different machines, and > it spits this error out on only one. The only difference between the two is > that I have the "debug" USE flag set on the one that is failing. The "debug" > USE flag is also set in the attached "emerge --info" output that the OP > provided. I'm recompiling now without the flag enabled and will post results > as soon as it's finished. > This also works for me on two PCs.
*** Bug 345693 has been marked as a duplicate of this bug. ***
jmbsvicetto: It looks like that the shared embedded patch is causing this. Ask the patch author to look please?
*** Bug 346963 has been marked as a duplicate of this bug. ***
knielsen is looking at the patch. It seems we'll have to add a link to libdbug on libmystrings or mysql will fail to build when enabling debug.
I think this happens because there is a cyclic dependency between libmysys and libdbug. Apparently this does not work well with -Wl,--as-needed when libmysys and libdbug are build as .so. I pushed a patch here that I think fixes the problem (I only tested applying manually against a MySQL source tarball, not inside gentoo): git@github.com:knielsen/gentoo-mysql-extra.git It avoids building libdbug.so and friends, which should solve the problem
Doing a test run with that updated patch now, thanks.
knielsen: (In reply to comment #10) > I think this happens because there is a cyclic dependency between libmysys and > libdbug. Apparently this does not work well with -Wl,--as-needed when libmysys > and libdbug are build as .so. > > I pushed a patch here that I think fixes the problem (I only tested applying > manually against a MySQL source tarball, not inside gentoo): > git@github.com:knielsen/gentoo-mysql-extra.git > It avoids building libdbug.so and friends, which should solve the problem This patch has problems: 5.1.52: test-unit now fails (it passed on the previous version): make -j4 -l7 test-unit cd unittest && make test make[1]: Entering directory `/var/tmp/portage/dev-db/mysql-5.1.52/work/mysql/unittest' perl unit.pl run mytap mysys strings ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg Running tests: mytap mysys strings ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg mysys/bitmap-t ..... Unrecognized character \x7F at mysys/bitmap-t line 1. ^M ^Mmysys/bitmap-t ..... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run mysys/base64-t ..... Unrecognized character \x7F at mysys/base64-t line 1. ^M ^Mmysys/base64-t ..... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run strings/strings-t .. Unrecognized character \x7F at strings/strings-t line 1. ^M ^Mstrings/strings-t .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- mysys/bitmap-t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output mysys/base64-t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output strings/strings-t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=3, Tests=0, 1 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: FAIL Failed 3/3 test programs. 0/0 subtests failed. make[1]: *** [test] Error 255 5.1.53: compile failure (previous version of patch worked). make[2]: Entering directory `/var/tmp/portage/dev-db/mysql-5.1.53/work/mysql/cmd-line-utils/readline' x86_64-pc-linux-gnu-gcc -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1 -I. -I../../include -I../../include -I../../include -I../.. -Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror -g -DSAFE_MUTEX -DSAFEMALLOC -march=nocona -O2 -pipe -g -DHAVE_ERRNO_AS_DEFINE=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -MT complete.o -MD -MP -MF .deps/complete.Tpo -c -o complete.o complete.c cc1: warnings being treated as errors complete.c: In function 'fnprint': complete.c:676: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result make[2]: *** [complete.o] Error 1 make[2]: *** Waiting for unfinished jobs....
Ignore the last message, I'm testing more combinations and got some of them confused.
I've put USE=debug into package.use.mask for these MySQL versions now, so that I can roll out 5.1.52-r1 and 5.1.53. knielsen: 1. test-unit in 5.1.5[23] breaks with your latest patch. 2. 5.1.53 refuses to compile with USE=debug, regardless of which patch version.
There is something really wierd with those failures: "mysys/bitmap-t ..... Unrecognized character \x7F at mysys/bitmap-t line 1" mysys/bitmap-t is supposed to be an elf binary, but it looks like something is trying to run it as some kind of script (Perl/sh)? I was not able to repeat locally :-( Note that I made and test the patch against 5.1.50, as that is what the version in the file name says ...
please test 5.1.56 and reopen if needed.
(In reply to comment #16) > please test 5.1.56 and reopen if needed. I can't classify this resolution as fix of the problem, but at least it state explicitly that debug not supported. Here is /var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log with debug USE flag * Package: dev-db/mysql-5.1.56 * Repository: gentoo * Maintainer: mysql-bugs@gentoo.org * USE: community debug elibc_glibc kernel_linux perl ssl userland_GNU x86 * FEATURES: sandbox splitdebug * ERROR: dev-db/mysql-5.1.56 failed (setup phase): * Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51 * * Call stack: * ebuild.sh, line 56: Called pkg_setup * ebuild.sh, line 1439: Called mysql_pkg_setup * mysql.eclass, line 804: Called die * The specific snippet of code: * die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51" * * If you need support, post the output of 'emerge --info =dev-db/mysql-5.1.56', * the complete build log and the output of 'emerge -pqv =dev-db/mysql-5.1.56'. * The complete build log is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/die.env'. * S: '/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql'
Created attachment 270939 [details] /var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log Build log w/o debug
(In reply to comment #18) > Created attachment 270939 [details] > /var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log > > Build log w/o debug w/o debug USE flag build fails because of undefined reference: /var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/strings/my_vsnprintf.c:103: undefined reference to `strnmov' collect2: ld returned 1 exit status make[3]: *** [resolve_stack_dump] Error 1 make[3]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra' make[1]: *** [all] Error 2 make[1]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra' make: *** [all-recursive] Error 1 emake failed
The failure you're getting is a different issue. Please follow it on bug 364451.