Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2017 13:33:05 +0000 (UTC)
From:      =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= <dumbbell@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r455198 - in head/lang/rust: . files
Message-ID:  <201711301333.vAUDX50L016409@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Thu Nov 30 13:33:05 2017
New Revision: 455198
URL: https://svnweb.freebsd.org/changeset/ports/455198

Log:
  lang/rust: Disable "omit frame pointers"
  
  Before the patch, the default behavior of the compiler was to omit frame
  pointers. However, even though it looks fine for the code produced
  by the compiler, the compiler itself was broken. When there was a
  compilation error, rustc panics to report that error. While handling
  that panic, it tries to unwind the stack but fails to do so, which
  results in an abort(3).
  
  Here is an example:
  
      $ rustc hello.rs
      error: invalid reference to argument `0` (no arguments given)
       --> hello.rs:2:5
        |
      2 |     println!("Hello {}")
        |     ^^^^^^^^^^^^^^^^^^^^
        |
        = note: this error originates in a macro outside of the current crate
  
      error: aborting due to previous error
  
      fatal runtime error: failed to initiate panic, error 5
      Abort trap (core dumped)
  
  The problem also exists on other systems such as OpenBSD and
  i686-unknown-linux-musl. "omit frame pointers" was already disabled for
  i686-unknown-linux-musl:
  https://github.com/rust-lang/rust/blob/88a28ff6028cf197ed6b4185d8cd4887f05e3e07/src/librustc_back/target/i686_unknown_linux_musl.rs#L22
  
  The patch does the same for *-unknown-freebsd.
  
  See the upstream bug for more informations:
  https://github.com/rust-lang/rust/issues/43575

Modified:
  head/lang/rust/Makefile
  head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs

Modified: head/lang/rust/Makefile
==============================================================================
--- head/lang/rust/Makefile	Thu Nov 30 13:00:44 2017	(r455197)
+++ head/lang/rust/Makefile	Thu Nov 30 13:33:05 2017	(r455198)
@@ -3,7 +3,7 @@
 
 PORTNAME=	rust
 PORTVERSION?=	1.22.1
-PORTREVISION?=	1
+PORTREVISION?=	2
 CATEGORIES=	lang
 MASTER_SITES=	http://static.rust-lang.org/dist/:src \
 		LOCAL/dumbbell/rust:rust_bootstrap \

Modified: head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
==============================================================================
--- head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs	Thu Nov 30 13:00:44 2017	(r455197)
+++ head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs	Thu Nov 30 13:33:05 2017	(r455198)
@@ -1,12 +1,13 @@
 Return struct like OpenBSD, see src/librustc_trans/cabi_x86.rs
 
---- src/librustc_back/target/freebsd_base.rs.orig	2017-07-17 22:10:50 UTC
+--- src/librustc_back/target/freebsd_base.rs.orig	2017-11-22 21:33:00 UTC
 +++ src/librustc_back/target/freebsd_base.rs
-@@ -31,6 +31,7 @@ pub fn opts() -> TargetOptions {
+@@ -31,6 +31,8 @@ pub fn opts() -> TargetOptions {
          target_family: Some("unix".to_string()),
          linker_is_gnu: true,
          has_rpath: true,
 +        is_like_openbsd: true,
++        eliminate_frame_pointer: false,
          pre_link_args: args,
          position_independent_executables: true,
-         exe_allocation_crate: super::maybe_jemalloc(),
+         relro_level: RelroLevel::Full,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711301333.vAUDX50L016409>