Support debug assertions and symbols for rustc

RESOLVED DUPLICATE of bug 1268617

Status

RESOLVED DUPLICATE of bug 1268617
3 years ago
8 months ago

People

(Reporter: ato, Assigned: ato)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Map --enable-debug-symbols to rustc’s -g.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1177608#c3
(Assignee)

Updated

3 years ago
Blocks: 1135640
You should do both this and bug 1185662 with the same patch.
(Assignee)

Updated

3 years ago
Duplicate of this bug: 1185662
(Assignee)

Comment 3

3 years ago
(In reply to Mike Hommey [:glandium] from comment #1)
> You should do both this and bug 1185662 with the same patch.

OK.

Remember to also map --enable-debug to -C debug-assertions=on for rustc.
(Assignee)

Updated

3 years ago
Assignee: nobody → ato
Status: NEW → ASSIGNED
(Assignee)

Updated

3 years ago
Summary: Support debug symbols for rustc → Support debug assertions and symbols for rustc
(Assignee)

Comment 4

3 years ago
Created attachment 8638558 [details]
MozReview Request: Bug 1185664: Support debug symbols for rustc

Bug 1185664: Support debug symbols for rustc

This changes the default compile output of rustc to include debug symbols
and introduces the ability to switch on debug assertions, specifically:

--enable-debug will add debug assertions to rustc through
`-C debug-assertions=on`, but are not enabled unless explicitly set.

--enable-debug-symbols will produce extra debug information from rustc
through `-g`, and is enabled by default but will have to be explicitly
disabled through the use of --disable-debug-symbols if unwanted.

r=glandium
Attachment #8638558 - Flags: review?(mh+mozilla)
(Assignee)

Comment 5

3 years ago
Comment on attachment 8638558 [details]
MozReview Request: Bug 1185664: Support debug symbols for rustc

Bug 1185664: Support debug symbols for rustc

This changes the default compile output of rustc to include debug symbols
and introduces the ability to switch on debug assertions, specifically:

--enable-debug will add debug assertions to rustc through
`-C debug-assertions=on`, but are not enabled unless explicitly set.

--enable-debug-symbols will produce extra debug information from rustc
through `-g`, and is enabled by default but will have to be explicitly
disabled through the use of --disable-debug-symbols if unwanted.

r=glandium
Comment on attachment 8638558 [details]
MozReview Request: Bug 1185664: Support debug symbols for rustc

https://reviewboard.mozilla.org/r/14113/#review12839

::: build/autoconf/compiler-opts.m4:154
(Diff revision 2)
> -dnl = Enable generation of debug symbols
> +dnl = Debug symbols (-DTRACE &c. for cc and c++, -g for Rust)

I think you've been confused by the code -DTRAC*ING*  is for debugging options, not debug symbols. I'd argue your changes to this file make the situation more confusing than it already is. I'd rather leave it alone.

::: config/config.mk:210
(Diff revision 2)
> +  OS_RUSTFLAGS += -C debug-assertions=on

No need to mimic 15 years of accumulated cruft ;)
Just do RUSTFLAGS += -C debug-assertions=on

::: config/config.mk:213
(Diff revision 2)
> +  OS_RUSTFLAGS += -g

RUSTFLAGS += -g

... come to think of it, this would be better defined in configure.in... and since I actually don't see a necessity to differentiate optimization flags and debug flags for rust, just set RUSTFLAGS in configure.in.
Attachment #8638558 - Flags: review?(mh+mozilla)
Andreas, are you still willing to work on this?
Flags: needinfo?(ato)
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(ato)
Resolution: --- → DUPLICATE
Duplicate of bug: 1268617

Updated

8 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.