{"action":"created","issue":{"url":"https://api.github.com/repos/japaric/rust-cross/issues/4","repository_url":"https://api.github.com/repos/japaric/rust-cross","labels_url":"https://api.github.com/repos/japaric/rust-cross/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/japaric/rust-cross/issues/4/comments","events_url":"https://api.github.com/repos/japaric/rust-cross/issues/4/events","html_url":"https://github.com/japaric/rust-cross/issues/4","id":134178350,"number":4,"title":"openssl dependency","user":{"login":"hdhoang","id":12537,"avatar_url":"https://avatars.githubusercontent.com/u/12537?v=3","gravatar_id":"","url":"https://api.github.com/users/hdhoang","html_url":"https://github.com/hdhoang","followers_url":"https://api.github.com/users/hdhoang/followers","following_url":"https://api.github.com/users/hdhoang/following{/other_user}","gists_url":"https://api.github.com/users/hdhoang/gists{/gist_id}","starred_url":"https://api.github.com/users/hdhoang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdhoang/subscriptions","organizations_url":"https://api.github.com/users/hdhoang/orgs","repos_url":"https://api.github.com/users/hdhoang/repos","events_url":"https://api.github.com/users/hdhoang/events{/privacy}","received_events_url":"https://api.github.com/users/hdhoang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T04:53:00Z","updated_at":"2016-02-18T02:46:30Z","closed_at":null,"body":"I need a few more steps to build a program depending on openssl-sys (via hyper). These are tested on archlinux:\r\n\r\n1. Fixing `openssl/hmac.h` not found: copying the target's /usr/include/openssl to /arm-gcc-prefix/include\r\n2. Fixing linking:\r\n\r\n- Copy the target's libssl.so, libcrypto.so, libz.so to /arm-gcc-prefix/lib\r\n- Explicitly link to libz, used by libcrypto:\r\n```\r\ncargo rustc --target=arm-unknown-linux-gnueabihf --release -- -lz -Clinker=arm-linux-gnueabihf-gcc\r\n```"},"comment":{"url":"https://api.github.com/repos/japaric/rust-cross/issues/comments/185517850","html_url":"https://github.com/japaric/rust-cross/issues/4#issuecomment-185517850","issue_url":"https://api.github.com/repos/japaric/rust-cross/issues/4","id":185517850,"user":{"login":"hdhoang","id":12537,"avatar_url":"https://avatars.githubusercontent.com/u/12537?v=3","gravatar_id":"","url":"https://api.github.com/users/hdhoang","html_url":"https://github.com/hdhoang","followers_url":"https://api.github.com/users/hdhoang/followers","following_url":"https://api.github.com/users/hdhoang/following{/other_user}","gists_url":"https://api.github.com/users/hdhoang/gists{/gist_id}","starred_url":"https://api.github.com/users/hdhoang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdhoang/subscriptions","organizations_url":"https://api.github.com/users/hdhoang/orgs","repos_url":"https://api.github.com/users/hdhoang/repos","events_url":"https://api.github.com/users/hdhoang/events{/privacy}","received_events_url":"https://api.github.com/users/hdhoang/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T02:46:30Z","updated_at":"2016-02-18T02:46:30Z","body":"Yes, I dropped them in its installation in /usr/arm-linux-gnueabihf.\r\n\r\nYour suggestion works. I copy them to $PWD/arm/include and $PWD/arm/lib, then build with:\r\n```\r\nTARGET_CFLAGS=\"-I $PWD/arm/include\" cargo rustc --target arm-unknown-linux-gnueabihf -- -C linker=arm-linux-gnueabihf-gcc -L $PWD/arm/lib -lz\r\n```\r\n\r\nLeaving out `-lz` fails to resolve deflate symbols, even if libz.so.1 exists in $PWD/arm/lib:\r\n```\r\n   Compiling luser v0.1.0 (file:///home/hdhoang/luser)\r\nerror: linking with `arm-linux-gnueabihf-gcc` failed: exit code: 1\r\nnote: \"arm-linux-gnueabihf-gcc\" \"-Wl,--as-needed\" \"-Wl,-z,noexecstack\" \"-L\" \"/home/hdhoang/.multirust/toolchains/nightly/lib/rustlib/arm-unknown-linux-gnueabihf/lib\" \"/home/hdhoang/luser/target/arm-unknown-linux-gnueabihf/debug/luser.0.o\" \"-o\" \"/home/hdhoang/luser/target/arm-unknown-linux-gnueabihf/debug/luser\" \"-Wl,--gc-sections\" \"-pie\" \"-nodefaultlibs\" \"-L\" \"/home/hdhoang/luser/arm/lib\" \"-L\"\r\n[........]\r\n/toolchains/nightly/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liblibc-fd663c41.rlib\" \"/home/hdhoang/.multirust/toolchains/nightly/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcore-fd663c41.rlib\" \"-l\" \"ssl\" \"-l\" \"crypto\" \"-l\" \"dl\" \"-l\" \"pthread\" \"-l\" \"gcc_s\" \"-l\" \"pthread\" \"-l\" \"c\" \"-l\" \"m\" \"-l\" \"rt\" \"-Wl,-rpath,$ORIGIN/../../../../.multirust/toolchains/nightly/lib/rustlib/arm-unknown-linux-gnueabihf/lib\" \"-Wl,-rpath,/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib\" \"-Wl,--enable-new-dtags\" \"-l\" \"compiler-rt\"\r\nnote: /usr/bin/arm-linux-gnueabihf-ld: warning: libz.so.1, needed by /home/hdhoang/luser/arm/lib/libcrypto.so, not found (try using -rpath or -rpath-link)\r\n/home/hdhoang/luser/arm/lib/libcrypto.so: undefined reference to `deflateInit_'\r\n```"}}