Ich bin auf einer Debian-Maschine und ich möchte ein Projekt für meine Raspberry Pi 2 kompilieren. Ich habe es geschafft, es für eine einfache Hallo Welt mit Rost zu tun, aber konnte nicht Ich finde heraus, wie man die Rost-Openssl-Kiste zusammenstellt.Cross kompilieren Rost-Openssl für Raspberry Pi 2
Ich habe openssl mit arm-linux-gnueabihf-gcc kompiliert und in meinem Verzeichnis home/opensslArm
installiert.
Als ich
OPENSSL_LIB_DIR=/home/johann/opensslArm/lib OPENSSL_INCLUDE_DIR=/home/johann/opensslArm/include cargo build --target=armv7-unknown-linux-gnueabihf
laufen bekomme ich diesen Fehler:
failed to run custom build command for `openssl-sys-extras v0.7.11`
Process didn't exit successfully: `/home/johann/projects/test/target/debug/build/openssl-sys-extras-e1c84960cd35bc93/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("armv7-unknown-linux-gnueabihf")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("armv7-unknown-linux-gnueabihf")
debug=true opt-level=0
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CC_armv7-unknown-linux-gnueabihf = None
CC_armv7_unknown_linux_gnueabihf = None
TARGET_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_armv7-unknown-linux-gnueabihf = None
CFLAGS_armv7_unknown_linux_gnueabihf = None
TARGET_CFLAGS = None
CFLAGS = None
running: "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fPIC" "-march=armv7-a" "-o" "/home/johann/projects/test/target/armv7-unknown-linux-gnueabihf/debug/build/openssl-sys-extras-e1c84960cd35bc93/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
ExitStatus(ExitStatus(256))
command did not execute successfully, got: exit code: 1
--- stderr
In file included from src/openssl_shim.c:1:0:
/usr/include/openssl/hmac.h:61:34: fatal error: openssl/opensslconf.h: No such file or directory
compilation terminated.
thread '<main>' panicked at 'explicit panic', /home/johann/.cargo/registry/src/github.com-88ac128001ac3a9a/gcc-0.3.28/src/lib.rs:840
note: Run with `RUST_BACKTRACE=1` for a backtrace.
ich den gleichen Fehler, wenn ich die Variablen in Frage exportieren.
Ich weiß nicht genau, was ich tun soll, ich bin kein Experte im Cross Compiling. Hat es jemand geschafft?
EDIT: Ich verwendete Rost-Openssl 0.7.11. Ein Upgrade auf 0.7.13 fixiert dieses Problem (ich jetzt cargo Kompilieren Rost openssl Abhängigkeiten, ohne einen Fehler sehen), aber ich habe jetzt ein anderes:
error: linking with `arm-linux-gnueabihf-gcc` failed: exit code: 1
...
note: /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld: /home/johann/opensslArm/lib/libssl.a(s23_meth.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/johann/opensslArm/lib/libssl.a: error adding symbols: Bad value
Wie kann ich -fPIC
Flagge? Sollte ich opensslArm mit bestimmten Flags neu kompilieren?
Mit dass '/ usr/include/openssl/hmac .h' in der Ausgabe ist wirklich verdächtig. Das ist Ihre normalerweise installierte Version von OpenSSL, nicht die benutzerdefinierte Version. Ich frage mich, ob die ['#include' anstelle von '#include" foo "'] (https://github.com/sfackler/rust-openssl/blob/875f4ccb39e3863c6592b6275e067bd7692031d7/openssl-sys-extras/src/openssl_shim.C# L1-L4) wird ein Problem verursachen ... –
Shepmaster
Danke für den Kommentar! Ich habe versucht, rost-openssl zu klonen und openssl-sys-extra manuell zu kompilieren ... und es hat funktioniert !! Also habe ich ein 'cargo update' gemacht, rost-openssl von 0.7.11 auf 0.7.13 upgegraded und jetzt habe ich eine' linking mit 'arm-linux-gnueabihf-gcc' failed' Fehler – tafia