From e31e5c362d7ab3843b44277eab47b6c9d778d77b Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Tue, 21 Jun 2016 11:37:26 +0200 Subject: [PATCH] Building for ARMv6, silenced unknown lints --- .cargo/config | 5 +++++ build.rs | 2 +- src/cloud.rs | 2 ++ src/crypto.rs | 1 + src/types.rs | 1 + src/udpmessage.rs | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..f799a0b --- /dev/null +++ b/.cargo/config @@ -0,0 +1,5 @@ +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + +[target.arm-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" diff --git a/build.rs b/build.rs index e8ef6e2..0ab8c41 100644 --- a/build.rs +++ b/build.rs @@ -23,7 +23,7 @@ fn main() { if target.ends_with("-musl") { args.extend(vec!["CC=musl-gcc"]); } - if target == "armv7-unknown-linux-gnueabihf" { + if target == "arm-unknown-linux-gnueabihf" || target == "armv7-unknown-linux-gnueabihf" { args.extend(vec!["CC=arm-linux-gnueabihf-gcc"]); } Command::new("sh").args(&args).current_dir(&libsodium_dir).status().unwrap(); diff --git a/src/cloud.rs b/src/cloud.rs index e937212..146f6ee 100644 --- a/src/cloud.rs +++ b/src/cloud.rs @@ -174,6 +174,7 @@ pub struct GenericCloud { } impl GenericCloud

{ + #[allow(unknown_lints)] #[allow(too_many_arguments)] pub fn new(device: Device, listen: u16, network_id: Option, table: Box, peer_timeout: Duration, learning: bool, broadcast: bool, addresses: Vec, @@ -440,6 +441,7 @@ impl GenericCloud

{ Ok(()) } + #[allow(unknown_lints)] #[allow(cyclomatic_complexity)] pub fn run(&mut self) { let dummy_time = Instant::now(); diff --git a/src/crypto.rs b/src/crypto.rs index 4fb21b4..9ef032e 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -184,6 +184,7 @@ impl Crypto { } } + #[allow(unknown_lints)] #[allow(match_same_arms)] pub fn additional_bytes(&self) -> usize { match *self { diff --git a/src/types.rs b/src/types.rs index 41af8ae..e4c20ab 100644 --- a/src/types.rs +++ b/src/types.rs @@ -108,6 +108,7 @@ impl fmt::Debug for Address { impl FromStr for Address { type Err=Error; + #[allow(unknown_lints)] #[allow(needless_range_loop)] fn from_str(text: &str) -> Result { if let Ok(addr) = Ipv4Addr::from_str(text) { diff --git a/src/udpmessage.rs b/src/udpmessage.rs index 7822b49..7e6c387 100644 --- a/src/udpmessage.rs +++ b/src/udpmessage.rs @@ -94,6 +94,7 @@ impl<'a> fmt::Debug for Message<'a> { } } +#[allow(unknown_lints)] #[allow(needless_range_loop)] pub fn decode<'a>(data: &'a mut [u8], crypto: &mut Crypto) -> Result<(Options, Message<'a>), Error> { let mut end = data.len(); @@ -194,6 +195,7 @@ pub fn decode<'a>(data: &'a mut [u8], crypto: &mut Crypto) -> Result<(Options, M Ok((options, msg)) } +#[allow(unknown_lints)] #[allow(needless_range_loop)] pub fn encode<'a>(options: &Options, msg: &'a mut Message, mut buf: &'a mut [u8], crypto: &mut Crypto) -> &'a mut [u8] { let mut start = 64;