New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-23892: Misc fixes to MIPS build and run compatibility #1716
Conversation
6d805ae
to
471f77c
Compare
Quality assuranceSalsa-CIPasses Travis-CIPasses BuildbotOverview visible at http://buildbot.askmonty.org/buildbot/grid?branch=ok-10.5-mips-fixes&category=main&category=experimental On http://buildbot.askmonty.org/buildbot/builders/kvm-bintar-trusty-amd64/builds/20761/steps/compile/logs/stdio the configure steps fails on:
The job at http://buildbot.askmonty.org/buildbot/builders/kvm-deb-stretch-amd64/builds/17874/steps/minor-upgrade-all/logs/stdio fails on:
This is however intentional as there is a new dependency added. |
@cvicentiu Is this OK to merge? It is your original code, I think you should finalize this. |
drop the _bss_start patch - MDEV-23491 was fixed by removing _bss_start references. libatomics looks good. connect engine patch, @an3l please take a look. |
FYI: I had to update this patch downstream where it is still maintained. I wonder why it hasn't been merged upstream, should be pretty clear cut thing. |
I rebased this now on latest 10.5. Please merge @cvicentiu I already had to update the patches when importing MariaDB 10.5.10 to Debian (https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/12d5cef22365db16ca22766bcbb1e3475b7f1f09#7867810dd1d691e3c39b7941a80bc35405fae55d_40_39). It is waste of my time to maintain these patches in Debian when the it could be permanently solved by simply merging these patches at upstream now. |
I did have a clear cut ask for to drop the _bss_start patch - MDEV-23491 as it was fixed by removing _bss_start references. Note Debian should make use of CMAKE_CROSSCOMPILING_EMULATOR to eliminate some of the cross compilation build time assumptions especially on upstream no-supported architectures less fragile. |
@grooverdan These patches were originally written mostly by @cvicentiu, they are in Debian and are proven to fix the MIPS issues. I suggest these would be merged now (unless a bug is found), and further improvements done in a later iteration. Regarding CMAKE_CROSSCOMPILING_EMULATOR, I read https://manpages.debian.org/stretch/cmake-data/cmake-variables.7.en.html#CMAKE_CROSSCOMPILING_EMULATOR and looked quickly on https://codesearch.debian.net/search?q=CMAKE_CROSSCOMPILING_EMULATOR&literal=1&perpkg=1 how other Debian packages might be using it, but I didn't find a clear purpose and method to use it. Note that we already have it in MariaDB CMake files. I don't have critisism to the current use nor any ideas on how to use CMAKE_CROSSCOMPILING_EMULATOR in a better way. |
Some architectures (mips) require libatomic to support proper atomic operations. Check first if support is available without linking, otherwise use the library. Contributors: James Cowgill <jcowgill@debian.org> Jessica Clarke <jrtc27@debian.org> Vicențiu Ciorbaru <vicentiu@mariadb.org>
…class On MIPS platforms (and probably others) unaligned memory access results in a bus error. In the connect storage engine, block data for some data formats is stored packed in memory and the TYPBLK class is used to read values from it. Since TYPBLK does not have special handling for this packed memory, it can quite easily result in unaligned memory accesses. The simple way to fix this is to perform all accesses to the main buffer through memcpy. With GCC and optimizations turned on, this call to memcpy is completely optimized away on architectures where unaligned accesses are ok (like x86). Contributors: James Cowgill <jcowgill@debian.org>
MIPS (and possibly other) platforms require linking against libatomic to support 64-bit atomic integers. Groonga was failing to do so and all related tests were failing with an atomics relocation error on MIPS. Contributors: James Cowgill <jcowgill@debian.org>
@an3l @cvicentiu Any comments here? Ok to merge? |
Hi @ottok regarding |
@cvicentiu This is your code, please finalize and merge it. Thanks! |
@ottok I have merged the Connect and MIPS libatomic linkage fix. The Mroonga patch doesn't work as expected, it fails in BB. I will close this PR when I have a proper fix for it. |
These patches have been in Debian for several years or months already and have thus proven themselves to be the correct solutions for certain libatomic etc issues so that MariaDB builds and runs correctly mainly on MIPS but as a side effect also on other platforms.
When this PR is merged we can drop 4 patches from https://salsa.debian.org/mariadb-team/mariadb-10.5/-/tree/master/debian/patches