Skip to content

build-script-build (signal: 11, SIGSEGV: invalid memory reference) #439

Closed
@bbigras

Description

@bbigras

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions