rust-bindgen: build-script-build (signal: 11, SIGSEGV: invalid memory reference)
I’m able to build this on Arch 64-bit but not on Ubuntu trusty 32-bit. I’m wondering if the cause could be the 32-bit part.
$ export LIBCLANG_PATH=/usr/lib/llvm-3.9/lib
$ export LD_LIBRARY_PATH=/usr/lib/llvm-3.9/lib
$ RUST_LOG=libbindgen RUST_BACKTRACE=1 cargo build
Compiling bindgen-sigsegv v0.1.0 (file:///home/bbigras/bindgen-sigsegv/bindgen-sigsegv)
error: failed to run custom build command for `bindgen-sigsegv v0.1.0 (file:///home/bbigras/bindgen-sigsegv/bindgen-sigsegv)`
process didn't exit successfully: `/home/bbigras/bindgen-sigsegv/bindgen-sigsegv/target/debug/build/bindgen-sigsegv-3d591becf77542af/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
--- stdout
cargo:rustc-link-lib=gssapi_krb5
Ubuntu 14.04.5 LTS (32-bit) clang-3.9 bindgen 0.20.0
Cargo.toml
[package]
name = "bindgen-sigsegv"
version = "0.1.0"
build = "build.rs"
[build-dependencies]
bindgen = "0.20"
lib.rs
#![allow(non_camel_case_types)]
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
build.rs
extern crate bindgen;
use bindgen::Builder;
use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-lib=gssapi_krb5");
let bindings = Builder::default()
.no_unstable_rust()
.header("wrapper.h")
.whitelisted_function("gss.*")
.whitelisted_function("GSS.*")
.whitelisted_type("gss.*")
.whitelisted_type("GSS.*")
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
wrapper.h
#include <gssapi/gssapi.h>
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (13 by maintainers)
Commits related to this issue
- Update clang-sys. Fixes https://github.com/servo/rust-bindgen/issues/439 — committed to emilio/rust-bindgen by emilio 7 years ago
- Auto merge of #516 - emilio:clang-sys, r=fitzgen Update clang-sys. Fixes https://github.com/servo/rust-bindgen/issues/439 r? @fitzgen — committed to rust-lang/rust-bindgen by deleted user 7 years ago
- lib: Stop using bitflags to declare FFI definitions. Using bitflags for FFI is unsound in linux32, and it causes crashes like https://bugzilla.mozilla.org/show_bug.cgi?id=1406952. This is pretty sim... — committed to emilio/clang-sys by emilio 7 years ago
- Replace usage of bitflags with constants Using bitflags for FFI is unsound in linux32, and it causes crashes like https://bugzilla.mozilla.org/show_bug.cgi?id=1406952. This is pretty similar to http... — committed to KyleMayes/clang-sys by emilio 7 years ago
- Replace usage of bitflags with constants Using bitflags for FFI is unsound in linux32, and it causes crashes like https://bugzilla.mozilla.org/show_bug.cgi?id=1406952. This is pretty similar to http... — committed to RubyOnWorld/clang-sys by se7enstar25 7 years ago
This also affects all the enums and similar as far as I know though
Thanks @jeandudey for the comment, this would have required much more time to debug otherwise!