Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 761715 - >=dev-db/mysql-8.0.22: failed build on ppc, riscv (error: static assertion failed: (unsigned) long long type on this platform does not have an always-lock-free property. Bailing out ...)
Summary: >=dev-db/mysql-8.0.22: failed build on ppc, riscv (error: static assertion fa...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 811570 (view as bug list)
Depends on:
Blocks: 789243 riscv-keywording
  Show dependency tree
 
Reported: 2020-12-25 23:55 UTC by Sam James
Modified: 2022-01-10 13:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,34.16 KB, application/x-xz)
2020-12-25 23:56 UTC, Sam James
Details
mysql-8.0.27:20220104-020755.log.xz (mysql-8.0.27:20220104-020755.log.xz,296.12 KB, text/plain)
2022-01-05 06:06 UTC, Alex Fan
Details
ctest.log.xz (ctest.log.xz,112.59 KB, text/plain)
2022-01-05 06:06 UTC, Alex Fan
Details
0001-fix-libatomic.patch (0001-fix-libatomic.patch,1.83 KB, patch)
2022-01-05 06:08 UTC, Alex Fan
Details | Diff
0002-implement-cycle-timer-for-riscv.patch (0002-implement-cycle-timer-for-riscv.patch,1.94 KB, patch)
2022-01-05 06:08 UTC, Alex Fan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester gentoo-dev Security 2020-12-25 23:55:07 UTC
/var/tmp/portage/dev-db/mysql-8.0.22/work/mysql/storage/temptable/include/temptable/lock_free_type.h:153:17: error: static assertion failed: (unsigned) long long type on this platform does not have an always-lock-free property. Bailing out ...

----
Portage 3.0.9 (python 3.8.4-final-0, default/linux/powerpc/ppc32/17.0, gcc-9.3.0, glibc-2.32-r3, 5.4.72-gentoo ppc)
=================================================================
System uname: Linux-5.4.72-gentoo-ppc-POWER8_-architected-,_altivec_supported-with-glibc2.1.3
KiB Mem:    24699464 total,  12585192 free
KiB Swap:   25165820 total,  25130264 free
Timestamp of repository gentoo: Fri, 25 Dec 2020 22:35:07 +0000
sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.8.4-r1::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo, 2.34-r2::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="@FREE"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe -frecord-gcc-switches -fdiagnostics-show-option"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe -frecord-gcc-switches -fdiagnostics-show-option"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --ask-enter-invalid --jobs=4 --load-average 10 --quiet-build --keep-going --complete-graph --with-bdeps=y --deep"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe -frecord-gcc-switches -fdiagnostics-show-option"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe -frecord-gcc-switches -fdiagnostics-show-option"
GENTOO_MIRRORS="https://gentoo.osuosl.org/"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0"
MAKEOPTS="-j12 -l10"
PKGDIR="/var/tmp/portage/ppc32"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl berkdb big-endian bzip2 cli crypt dbus dri elogind fortran gdbm iconv ipv6 libglvnd ncurses nls nptl openmp pam pcre ppc readline seccomp split-usr ssl tcpd unicode xattr zlib" ABI_PPC="32" ADA_TARGET="gnat_2018" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie powermac usb-audio via82xx" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="fbdev glint mga nv r128 radeon dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sam James archtester gentoo-dev Security 2020-12-25 23:56:04 UTC
Created attachment 679503 [details]
build.log.xz
Comment 2 Thomas Deutschmann gentoo-dev Security 2020-12-26 12:55:04 UTC
Looks like this was added in 8.0.22, https://github.com/mysql/mysql-server/commit/6653b43360e0819906dc9272797948abaf22b18c. Please try building previous 8.x to confirm.

But in the end there is not much I can do for PPC.
Comment 3 Larry the Git Cow gentoo-dev 2021-08-13 14:16:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5e09c85854df9e309ab2c146ca42d7f37523632

commit b5e09c85854df9e309ab2c146ca42d7f37523632
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2021-08-13 14:09:45 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2021-08-13 14:15:31 +0000

    dev-db/mysql: keyword 8.0.26 for -riscv
    
    8.0.22+ rely on certain types having an always-lock-free property, which
    is (for now?) not the case on this arch.
    
    Bug: https://bugs.gentoo.org/761715
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 dev-db/mysql/mysql-8.0.26.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Marek Szuba archtester gentoo-dev 2021-09-06 13:26:45 UTC
*** Bug 811570 has been marked as a duplicate of this bug. ***
Comment 5 Sam James archtester gentoo-dev Security 2021-10-16 02:48:34 UTC
This doesn't help ppc, but Debian are applying:

* https://sources.debian.org/patches/mysql-8.0/8.0.23-3/atomic-test-words.patch/ (-latomic fix)
and
* https://sources.debian.org/patches/mysql-8.0/8.0.23-3/use-largest-lock-free-type-selector-on-riscv.patch/

I am not able to say if the latter patch would help on PPC at all and honestly I don't think we care (in a nice way). I think we're better off pursuing keeping MariaDB working on PPC instead given it's an older arch.

The patch is kind of invasive so I don't know if Whissi will want to apply it, but it might be OK if just applied on riscv + tests pass as a result. Not sure.
Comment 6 Larry the Git Cow gentoo-dev 2021-10-16 03:42:49 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd8d0481198229aafb5cda6a3ed36418f5d103f0

commit cd8d0481198229aafb5cda6a3ed36418f5d103f0
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-16 02:42:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-16 03:42:34 +0000

    dev-db/mysql: mark -ppc for >= 8.0.22 due to failing assert
    
    See: b5e09c85854df9e309ab2c146ca42d7f37523632
    Bug: https://bugs.gentoo.org/761715
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-db/mysql/mysql-8.0.22.ebuild    | 3 ++-
 dev-db/mysql/mysql-8.0.23.ebuild    | 3 ++-
 dev-db/mysql/mysql-8.0.25-r1.ebuild | 3 ++-
 dev-db/mysql/mysql-8.0.25.ebuild    | 3 ++-
 dev-db/mysql/mysql-8.0.26.ebuild    | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
Comment 7 Alex Fan archtester 2022-01-05 05:56:22 UTC
(In reply to Sam James from comment #5)
> This doesn't help ppc, but Debian are applying:
> 
> *
> https://sources.debian.org/patches/mysql-8.0/8.0.23-3/atomic-test-words.
> patch/ (-latomic fix)
> and
> *
> https://sources.debian.org/patches/mysql-8.0/8.0.23-3/use-largest-lock-free-
> type-selector-on-riscv.patch/
> 
> I am not able to say if the latter patch would help on PPC at all and
> honestly I don't think we care (in a nice way). I think we're better off
> pursuing keeping MariaDB working on PPC instead given it's an older arch.
> 
> The patch is kind of invasive so I don't know if Whissi will want to apply
> it, but it might be OK if just applied on riscv + tests pass as a result.
> Not sure.

With these two patches, it compiles successfully on riscv, but some router tests fail with missing atomic on runtime (maybe because some of them are linked as MODULE in cmake). I have improved the atomic patch to make it less invasive and the test pass. 

Additionally, a cycle timer implementation is required like mariadb https://github.com/MariaDB/server/pull/1981 otherwise there is timer warning that causes all tests to fail. I also include the patch here.

With these patches, there are still some ```Could not get local host address: Name or service not known``` fails in router unit tests. I am not sure if it is related to my environment.
Comment 8 Alex Fan archtester 2022-01-05 06:06:25 UTC
Created attachment 761331 [details]
mysql-8.0.27:20220104-020755.log.xz
Comment 9 Alex Fan archtester 2022-01-05 06:06:53 UTC
Created attachment 761332 [details]
ctest.log.xz
Comment 10 Alex Fan archtester 2022-01-05 06:08:04 UTC
Created attachment 761333 [details, diff]
0001-fix-libatomic.patch
Comment 11 Alex Fan archtester 2022-01-05 06:08:16 UTC
Created attachment 761334 [details, diff]
0002-implement-cycle-timer-for-riscv.patch
Comment 12 Yixun Lan archtester gentoo-dev 2022-01-10 13:41:46 UTC
hi @mysql team
 ping, can we include these two patches? which at #c10, #c11, since upstream already merged..
 or anything still need to do? just let us know..