Accepting request 437035 from home:KGronlund:branches:devel:languages:rust

- Update to 1.11
  + Add support for cdylib crate types
- Remove merged patches:
  * 0001-Fix-misleading-intentation-errors-on-gcc-6.0.patch
  * 0002-Fix-GCC-6-misleading-indentation-error-in-hoedown.patch

OBS-URL: https://build.opensuse.org/request/show/437035
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=5
This commit is contained in:
Kristoffer Gronlund 2016-10-24 07:34:54 +00:00 committed by Git OBS Bridge
parent 1f520ca6a0
commit 743ec85b28
7 changed files with 61 additions and 84 deletions

View File

@ -1,40 +0,0 @@
From 706b2253ff96a46ff98d347842a122299c3eb5cd Mon Sep 17 00:00:00 2001
From: Daniel Firth <locallycompact@gmail.com>
Date: Sun, 22 May 2016 20:47:59 +0100
Subject: [PATCH] Fix misleading intentation errors on gcc 6.0
---
src/rt/miniz.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/rt/miniz.c b/src/rt/miniz.c
index 2b803b0..2daca93 100644
--- a/src/rt/miniz.c
+++ b/src/rt/miniz.c
@@ -575,7 +575,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
{
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
- for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
+ for ( i = 0; i <= 143; ++i) *p++ = 8;
+ for ( ; i <= 255; ++i) *p++ = 9;
+ for ( ; i <= 279; ++i) *p++ = 7;
+ for ( ; i <= 287; ++i) *p++ = 8;
}
else
{
@@ -1393,7 +1396,10 @@ static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahe
if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) break;
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
}
- if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
+ if (!dist) break;
+ p = s; q = d->m_dict + probe_pos;
+ for (probe_len = 0; probe_len < max_match_len; probe_len++)
+ if (*p++ != *q++) break;
if (probe_len > match_len)
{
*pMatch_dist = dist; if ((*pMatch_len = match_len = probe_len) == max_match_len) return;
--
2.8.4

View File

@ -1,26 +0,0 @@
From 89ea75c4545bbc870712571a1c00b2f5b436939a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Mon, 27 Jun 2016 18:44:17 +0200
Subject: [PATCH] Fix GCC 6 misleading indentation error in hoedown
---
src/rt/hoedown/src/document.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/rt/hoedown/src/document.c b/src/rt/hoedown/src/document.c
index e2731da..53652e7 100644
--- a/src/rt/hoedown/src/document.c
+++ b/src/rt/hoedown/src/document.c
@@ -1158,7 +1158,8 @@ char_link(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offse
}
else if (data[i] == ')') {
if (nb_p == 0) break;
- else nb_p--; i++;
+ else nb_p--;
+ i++;
} else if (i >= 1 && _isspace(data[i-1]) && (data[i] == '\'' || data[i] == '"')) break;
else i++;
}
--
2.8.4

35
add-soname.patch Normal file
View File

@ -0,0 +1,35 @@
Description: Set DT_SONAME when building dylibs
In Rust, library filenames include a version-specific hash to help
the run-time linker find the correct version. Unlike in C/C++, the
compiler looks for all libraries matching a glob that ignores the
hash and reads embedded metadata to work out versions, etc.
.
The upshot is that there is no need for the usual "libfoo.so ->
libfoo-1.2.3.so" symlink common with C/C++ when building with Rust,
and no need to communicate an alternate filename to use at run-time
vs compile time. If linking to a Rust dylib from C/C++ however, a
"libfoo.so -> libfoo-$hash.so" symlink may well be useful and in
this case DT_SONAME=libfoo-$hash.so would be required. More
mundanely, various tools (eg: dpkg-shlibdeps) complain if they don't
find DT_SONAME on shared libraries in public directories.
.
This patch passes -Wl,-soname=$outfile when building dylibs (and
using a GNU linker).
Author: Angus Lees <gus@debian.org>
Forwarded: no
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -840,6 +840,12 @@
cmd.args(&rpath::get_rpath_flags(&mut rpath_config));
}
+ if (crate_type == config::CrateTypeDylib || crate_type == config::CrateTypeCdylib) && t.options.linker_is_gnu {
+ let filename = String::from(out_filename.file_name().unwrap().to_str().unwrap());
+ let soname = [String::from("-Wl,-soname=") + &filename];
+ cmd.args(&soname);
+ }
+
// Finally add all the linker arguments provided on the command line along
// with any #[link_args] attributes found inside the crate
if let Some(ref args) = sess.opts.cg.link_args {

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Sep 20 11:46:53 UTC 2016 - kgronlund@suse.com
- Update to 1.11
+ Add support for cdylib crate types
- Remove merged patches:
* 0001-Fix-misleading-intentation-errors-on-gcc-6.0.patch
* 0002-Fix-GCC-6-misleading-indentation-error-in-hoedown.patch
-------------------------------------------------------------------
Tue Sep 6 06:35:03 UTC 2016 - kgronlund@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package rust
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -14,11 +14,13 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global rustc_version 1_10
%global rustc_build_version 1_9
%global rustc_version 1_11
%global rustc_build_version 1_10
Name: rust
Version: 1.10.0
Version: 1.11.0
Release: 0
Summary: A systems programming language
License: MIT or Apache-2.0
@ -26,8 +28,7 @@ Group: Development/Languages/Other
Url: http://www.rust-lang.org
ExclusiveArch: %ix86 x86_64
# renamed to match upstream and other distros
Provides: rustc-%{rustc_version} = %{version}
Obsoletes: rustc-%{rustc_version} <= 1.5
Obsoletes: rustc-1_9
Provides: rustc = %{version}
Provides: rustc-stable = %{version}
#FIXME: currently there's no way to have rustc and rustc-beta installed
@ -42,12 +43,10 @@ Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.gz
#use snap.sh to update following lines from "magic" constanst from src/snapshots.txt
Source100: %{name}-rpmlintrc
# PATCH-FIX-UPSTREAM: Fix misleading intentation errors on gcc 6.0
Patch1: 0001-Fix-misleading-intentation-errors-on-gcc-6.0.patch
# PATCH-FIX-UPSTREAM: Fix GCC 6 misleading indentation error in hoedown
Patch2: 0002-Fix-GCC-6-misleading-indentation-error-in-hoedown.patch
# PATCH-FIX-OPENSUSE: Disable embedding timestamp information
Patch3: 0003-Disable-embedding-timestamp-information.patch
Patch1: 0003-Disable-embedding-timestamp-information.patch
# PATCH-FIX-OPENSUSE: Set DT_SONAME when building dylibs
Patch2: add-soname.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -55,9 +54,9 @@ BuildRequires: curl
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: python
BuildRequires: cmake
%description
Rust is a systems programming language focused on three goals:
@ -84,9 +83,9 @@ Documentation for the Rust language.
%package gdb
Summary: Gdb integration for rust binaries
Group: Development/Languages/Other
Provides: rustc:/usr/bin/rust-gdb
Provides: rust-%{rustc_version}-gdb = %{version}
Obsoletes: rust-%{rustc_build_version}-gdb
Provides: rustc:/usr/bin/rust-gdb
Obsoletes: rust-1_9-gdb
Supplements: packageand(%{name}:gdb)
%description gdb
@ -97,7 +96,6 @@ invoking gdb on rust binaries.
%setup -q -n rustc-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
export CPPFLAGS="$RPM_OPT_FLAGS" # eliminate complain from RPMlint

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869
size 25967780

3
rustc-1.11.0-src.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3685034a78e70637bdfa3117619f759f2481002fd9abbc78cc0f737c9974de6a
size 26126471