From: Marius Bakke <mbakke@fastmail.com>
To: Danny Milosavljevic <dannym@scratchpost.org>, 38110@debbugs.gnu.org
Subject: [bug#38110] [PATCH core-updates v3] gnu: rust: Bootstrap rust@1.29.0 by mrustc@0.9.
Date: Fri, 20 Mar 2020 17:11:55 +0100 [thread overview]
Message-ID: <877dzf9fas.fsf@devup.no> (raw)
In-Reply-To: <20200315192311.6505-1-dannym@scratchpost.org>
[-- Attachment #1.1: Type: text/plain, Size: 1242 bytes --]
Danny Milosavljevic <dannym@scratchpost.org> writes:
> * gnu/packages/patches/rustc-1.29.0-src.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/rust.scm (rust-1.19): Delete variable.
> (rust-1.20): Delete variable.
> (rust-1.21): Delete variable.
> (rust-1.22): Delete variable.
> (rust-1.23): Delete variable.
> (rust-1.24): Delete variable.
> (rust-1.25): Delete variable.
> (rust-1.26): Delete variable.
> (rust-1.27): Delete variable.
> (rust-1.28): Delete variable.
> (rust-1.29): Bootstrap from mrustc.
> [source]: Add patch.
> (rust-1.30)[inputs]: Remove llvm 3. Add llvm 6.
> (mrustc): Update rustc-version to 1.29.0.
Thanks a lot for this work Danny!
I was able to get one step further by hacking the mrustc compiler to
force "group linking" with --start-group and --end-group, based on a
suggestion in #mrustc. It makes the compiler about 10x slower, but
I suppose that's okay for a one-time job.
Now the build fails when trying to use the built rustc binary, and I'm
struggling to figure out how to proceed. I think we are pretty close!
I've attached my changes as a diff here. Some of the changes are purely
cosmetic, feel free to pick-and-choose what you want/need.
Without further ado...
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Type: text/x-patch, Size: 3323 bytes --]
2 files changed, 26 insertions(+), 5 deletions(-)
gnu/packages/patches/mrustc-group-link.patch | 22 ++++++++++++++++++++++
gnu/packages/rust.scm | 9 ++++-----
new file gnu/packages/patches/mrustc-group-link.patch
@@ -0,0 +1,22 @@
+Surround the libraries with --start-group and --end-group to work
+around <https://github.com/thepowersgang/mrustc/issues/138>.
+
+diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
+--- a/src/trans/codegen_c.cpp
++++ b/src/trans/codegen_c.cpp
+@@ -960,6 +960,7 @@ namespace {
+ {
+ args.push_back("-L"); args.push_back(path);
+ }
++ args.push_back("-Wl,--start-group");
+ for(const auto& lib : m_crate.m_ext_libs) {
+ ASSERT_BUG(Span(), lib.name != "", "");
+ args.push_back("-l"); args.push_back(lib.name.c_str());
+@@ -975,6 +976,7 @@ namespace {
+ {
+ args.push_back("-l"); args.push_back(path.c_str());
+ }
++ args.push_back("-Wl,--end-group");
+ for( const auto& a : Target_GetCurSpec().m_backend_c.m_linker_opts )
+ {
+ args.push_back( a.c_str() );
modified gnu/packages/rust.scm
@@ -98,6 +98,7 @@
(url "https://github.com/thepowersgang/mrustc.git")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
+ (patches (search-patches "mrustc-group-link.patch"))
(sha256
(base32
"194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))))
@@ -128,10 +129,8 @@
(add-after 'patch-date 'unpack-target-compiler
(lambda* (#:key inputs outputs #:allow-other-keys)
(invoke "tar" "xf" (assoc-ref inputs "rustc"))
- (chdir ,(string-append "rustc-" rustc-version "-src"))
- (invoke "patch" "-p0" ,(string-append "../rustc-" rustc-version
+ (invoke "patch" "-p1" ,(string-append "rustc-" rustc-version
"-src.patch"))
- (chdir "..")
(setenv "RUSTC_VERSION" ,rustc-version)
(setenv "MRUSTC_TARGET_VER"
,(version-major+minor rustc-version))
@@ -274,7 +273,7 @@ safety and thread safety guarantees.")
#t))
;; This phase is overridden by newer versions.
(replace 'configure
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda _
(setenv "CXX" "g++")
(setenv "HOST_CXX" "g++")
#t))
@@ -326,7 +325,7 @@ safety and thread safety guarantees.")
(write name)
(newline)
(apply invoke
- "output/rustc-build/rustc"
+ "output/rustc-build/rustc_binary"
"-C" (string-append "linker="
(getenv "CC"))
;; Required for libterm.
[back]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2020-03-20 16:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 22:27 [bug#38110] [PATCH 0/2] Bootstrap rust@1.29.0 directly from mrustc@0.9 Danny Milosavljevic
2019-11-07 22:29 ` [bug#38110] [PATCH 1/2] gnu: mrustc: Update to 0.9 Danny Milosavljevic
2019-11-07 22:30 ` [bug#38110] [PATCH 2/2] gnu: rust: Bootstrap rust@1.29.0 from mrustc Danny Milosavljevic
2019-11-07 23:18 ` Danny Milosavljevic
2019-11-07 23:17 ` [bug#38110] [PATCH 1/2] gnu: mrustc: Update to 0.9 Danny Milosavljevic
2019-11-08 2:46 ` [bug#38110] [PATCH v2 0/2] Bootstrap rust@1.29.0 directly from mrustc@0.9 Danny Milosavljevic
2019-11-08 2:46 ` [bug#38110] [PATCH v2 1/2] gnu: mrustc: Update to 0.9 Danny Milosavljevic
2019-11-08 22:47 ` Ludovic Courtès
2019-11-08 2:46 ` [bug#38110] [PATCH v2 2/2] gnu: rust: Bootstrap rust@1.29.0 by mrustc@0.9 Danny Milosavljevic
2019-11-08 22:50 ` Ludovic Courtès
2020-03-15 14:20 ` Marius Bakke
2020-03-15 19:23 ` Danny Milosavljevic
2020-01-19 22:19 ` [bug#38110] [PATCH v2 0/2] Bootstrap rust@1.29.0 directly from mrustc@0.9 Danny Milosavljevic
2020-01-21 0:15 ` Danny Milosavljevic
2020-03-15 19:23 ` [bug#38110] [PATCH core-updates v3] gnu: rust: Bootstrap rust@1.29.0 by mrustc@0.9 Danny Milosavljevic
2020-03-19 23:58 ` Jakub Kądziołka
2020-03-20 16:11 ` Marius Bakke [this message]
2020-03-23 21:24 ` Danny Milosavljevic
2020-03-23 22:16 ` Marius Bakke
2020-03-24 11:57 ` Danny Milosavljevic
2020-03-24 14:45 ` Marius Bakke
2020-12-10 21:55 ` Maxim Cournoyer
2021-02-05 14:58 ` bug#38110: [PATCH 0/2] Bootstrap rust@1.29.0 directly from mrustc@0.9 Maxim Cournoyer
2020-03-20 16:18 ` [bug#38110] [PATCH core-updates v3] gnu: rust: Bootstrap rust@1.29.0 by mrustc@0.9 Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dzf9fas.fsf@devup.no \
--to=mbakke@fastmail.com \
--cc=38110@debbugs.gnu.org \
--cc=dannym@scratchpost.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.