Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e737626 authored by Ivan Lozano's avatar Ivan Lozano Committed by Gerrit Code Review
Browse files

Merge "Rust: abort on panic"

parents 24907d11 bf7a9029
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -130,6 +130,9 @@ func TestStaticBinaryFlags(t *testing.T) {
	if !strings.Contains(flags, "-C relocation-model=static") {
		t.Errorf("static binary missing '-C relocation-model=static' in rustcFlags, found: %#v", flags)
	}
	if !strings.Contains(flags, "-C panic=abort") {
		t.Errorf("static binary missing '-C panic=abort' in rustcFlags, found: %#v", flags)
	}
	if !strings.Contains(linkFlags, "-static") {
		t.Errorf("static binary missing '-static' in linkFlags, found: %#v", flags)
	}
+3 −1
Original line number Diff line number Diff line
@@ -49,7 +49,9 @@ var (
		"-C relocation-model=pic",
	}

	deviceGlobalRustFlags = []string{}
	deviceGlobalRustFlags = []string{
		"-C panic=abort",
	}

	deviceGlobalLinkFlags = []string{
		// Prepend the lld flags from cc_config so we stay in sync with cc
+3 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ func (test *testDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
	if test.testHarness() {
		flags.RustFlags = append(flags.RustFlags, "--test")
	}
	if ctx.Device() {
		flags.RustFlags = append(flags.RustFlags, "-Z panic_abort_tests")
	}
	return flags
}