The lmdb-master-sys package in the heed crate does not support cross-compilation correctly. When attempting to cross-compile using the command:
cargo build --target aarch64-unknown-linux-gnu
the library generates incompatible binary files:
8c28d618c08bdb0c-mdb.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
8c28d618c08bdb0c-midl.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
lmdb_master_sys-f5d577e22e9dc6e8.lmdb_master_sys.4026053b71a9477b-cgu.0.rcgu.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
This results in a linking error:
aarch64-unknown-linux-gnu-ld: release/deps/liblmdb_master_sys-4cb3ac6e86087a04.rlib: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
Context
Some libraries, such as zstd, can resolve cross-compilation issues by setting environment variables:
However, it appears that lmdb-master-sys does not utilize pkg-config for its configuration. This results in the generation of object files for the host architecture instead of the target architecture.
Steps to Reproduce
Set up a cross-compilation environment for aarch64-unknown-linux-gnu.
Attempt to build a project that includes the heed crate with the following command:
cargo build --target aarch64-unknown-linux-gnu
Observe the generated object files and the resulting linking error.
Expected Behavior
The lmdb-master-sys package should correctly generate object files for the target architecture (aarch64-unknown-linux-gnu) and link them without errors.
Actual Behavior
The package generates object files for the host architecture (x86-64), leading to a linking error.
Description
The
lmdb-master-sys
package in theheed
crate does not support cross-compilation correctly. When attempting to cross-compile using the command:the library generates incompatible binary files:
This results in a linking error:
Context
Some libraries, such as
zstd
, can resolve cross-compilation issues by setting environment variables:However, it appears that
lmdb-master-sys
does not utilizepkg-config
for its configuration. This results in the generation of object files for the host architecture instead of the target architecture.Steps to Reproduce
aarch64-unknown-linux-gnu
.heed
crate with the following command:Expected Behavior
The
lmdb-master-sys
package should correctly generate object files for the target architecture (aarch64-unknown-linux-gnu
) and link them without errors.Actual Behavior
The package generates object files for the host architecture (
x86-64
), leading to a linking error.Additional Information
cargo
version: cargo 1.80.1 (376290515 2024-07-16)rustc
version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)aarch64-unknown-linux-gnu
x86_64-unknown-linux-gnu
Thank you for your attention to this issue. Please let me know if you need any further information or assistance in reproducing the problem.