fix build on arm64

This commit is contained in:
Martin Dahl 2021-04-29 13:26:06 +02:00
parent 37f3cdd1d4
commit 71c743f9b2
4 changed files with 14 additions and 5 deletions

View File

@ -100,6 +100,7 @@ fn main() {
.blacklist_type("rosidl_runtime_c__uint64__Sequence") .blacklist_type("rosidl_runtime_c__uint64__Sequence")
.blacklist_type("rosidl_runtime_c__int64__Sequence") .blacklist_type("rosidl_runtime_c__int64__Sequence")
.size_t_is_usize(true) .size_t_is_usize(true)
.no_debug("_OSUnaligned.*")
.default_enum_style(bindgen::EnumVariation::Rust { .default_enum_style(bindgen::EnumVariation::Rust {
non_exhaustive: false, non_exhaustive: false,
}); });

View File

@ -23,17 +23,16 @@ fn main() {
} }
println!("cargo:rustc-link-lib=dylib=rcl"); println!("cargo:rustc-link-lib=dylib=rcl");
// println!("cargo:rustc-link-lib=dylib=rcl_logging_noop");
// default logging seem to be changed to spdlog
println!("cargo:rustc-link-lib=dylib=rcl_logging_spdlog"); println!("cargo:rustc-link-lib=dylib=rcl_logging_spdlog");
println!("cargo:rustc-link-lib=dylib=rcl_yaml_param_parser"); println!("cargo:rustc-link-lib=dylib=rcl_yaml_param_parser");
println!("cargo:rustc-link-lib=dylib=rcutils"); println!("cargo:rustc-link-lib=dylib=rcutils");
println!("cargo:rustc-link-lib=dylib=rmw"); println!("cargo:rustc-link-lib=dylib=rmw");
println!("cargo:rustc-link-lib=dylib=rmw_implementation");
println!("cargo:rustc-link-lib=dylib=rosidl_typesupport_c"); println!("cargo:rustc-link-lib=dylib=rosidl_typesupport_c");
println!("cargo:rustc-link-lib=dylib=rosidl_runtime_c"); println!("cargo:rustc-link-lib=dylib=rosidl_runtime_c");
let bindings = builder.generate().expect("Unable to generate bindings"); let bindings = builder
.no_debug("_OSUnaligned.*")
.generate().expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings bindings

View File

@ -135,7 +135,13 @@ macro_rules! primitive_sequence {
primitive_sequence!(rosidl_runtime_c__float32, f32); primitive_sequence!(rosidl_runtime_c__float32, f32);
primitive_sequence!(rosidl_runtime_c__float64, f64); primitive_sequence!(rosidl_runtime_c__float64, f64);
#[cfg(target_arch = "aarch64")]
primitive_sequence!(rosidl_runtime_c__long_double, f64);
#[cfg(not(target_arch = "aarch64"))]
primitive_sequence!(rosidl_runtime_c__long_double, u128); primitive_sequence!(rosidl_runtime_c__long_double, u128);
primitive_sequence!(rosidl_runtime_c__char, i8); primitive_sequence!(rosidl_runtime_c__char, i8);
primitive_sequence!(rosidl_runtime_c__wchar, u16); primitive_sequence!(rosidl_runtime_c__wchar, u16);
primitive_sequence!(rosidl_runtime_c__boolean, bool); primitive_sequence!(rosidl_runtime_c__boolean, bool);

View File

@ -12,7 +12,10 @@ fn doesnt_crash() -> Result<(), Error> {
for c in 0..10 { for c in 0..10 {
let mut ths = Vec::new(); let mut ths = Vec::new();
for i in 0..30 { // I have lowered this from 30 to 10 because cyclonedds can only handle a hard-coded number of
// publishers in threads. See
// https://github.com/eclipse-cyclonedds/cyclonedds/blob/cd2136d9321212bd52fdc613f07bbebfddd90dec/src/core/ddsc/src/dds_init.c#L115
for i in 0..10 {
// create concurrent nodes that max out the cpu // create concurrent nodes that max out the cpu
let ctx = ctx.clone(); let ctx = ctx.clone();
ths.push(thread::spawn(move || { ths.push(thread::spawn(move || {