gcc-13.3.1 for aarch64 is failing to compile with the sanitize flag enabled. It seems to be a known old issue, as described in the reported URL. crosstool-ng is now carrying a patch to fix this issue (attached to the GCC bug report at the mentioned URL), which maybe should be ported to gentoo-crossdev too. Reproducible: Always
I ran into the same issue when building cross-aarch64-unknown-linux-gnu/gcc-13.3.1_p20240614. As workaround i emerged sys-libs/libxcrypt using the following command: ROOT=/usr/aarch64-unknown-linux-gnu/ emerge --nodeps sys-libs/libxcrypt
You need to install libxcrypt as mentioned in comment 1. Recent versions of crossdev will do that for you when creating a new cross compiler.
I tried: ROOT=/usr/armv6j-unknown-linux-gnueabihf/ emerge --nodeps sys-libs/libxcrypt and it fails at install stage, ldconfig exec format error: >>> Installing (1 of 1) sys-libs/libxcrypt-4.4.36-r3::gentoo to /usr/armv6j-unknown-linux-gnueabihf/ Process Process-20: Traceback (most recent call last): File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.12/site-packages/portage/util/_async/ForkProcess.py", line 326, in _bootstrap sys.exit(target(*(args or []), **(kwargs or {}))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/dbapi/_MergeProcess.py", line 276, in _target rval = mylink.merge( ^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/dbapi/vartree.py", line 1895, in wrapper return f(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/dbapi/vartree.py", line 6041, in merge retval = self.treewalk( ^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/dbapi/vartree.py", line 5247, in treewalk env_update( File "/usr/lib/python3.12/site-packages/portage/proxy/objectproxy.py", line 30, in __call__ return result(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/util/env_update.py", line 81, in env_update return _env_update( ^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/util/env_update.py", line 384, in _env_update ret = subprocess.run( ^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 548, in run with Popen(*popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: '/usr/armv6j-unknown-linux-gnueabihf/sbin/ldconfig' >>> Completed (1 of 1) sys-libs/libxcrypt-4.4.36-r3::gentoo to /usr/armv6j-unknown-linux-gnueabihf/ >>> Failed to install sys-libs/libxcrypt-4.4.36-r3 to /usr/armv6j-unknown-linux-gnueabihf/, Log file: >>> '/nas/tmp/portage/sys-libs/libxcrypt-4.4.36-r3/temp/build.log'
Sorry, comment 1 is incorrect. You should install libxcrypt in your cross root using a proper cross compiler.
You could also install cross-aarch64-linux-gnu/libxcrypt by setting up a symlink in your cross repo.
Oh, it seems I a misremember why we added cross support to libxcrypt. It was for LLVM, not crossdev (GNU toolchain). https://github.com/gentoo/gentoo/pull/20601 It's possible crossdev needs an update indeed. However, installing sys-libs/libxcrypt in ROOT using a proper cross-emerge should still resolve the issue.
Err, crossdev doesn't really do patching; we handle that in the ebuilds. Assigning to toolchain.
In my case this worked: armv7a-unknown-linux-gnueabihf-emerge --nodeps sys-libs/libxcrypt
I've been troubled by this bug for months. For that I believe we can change it from unconfirmed to confirmed. Also, the solution with installing libxcrypt fixed it: aarch64-unknown-linux-gnu-emerge -qv --nodeps sys-libs/libxcrypt