Closed Bug 1185664 Opened 9 years ago Closed 8 years ago

Support debug assertions and symbols for rustc

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1268617

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(1 file)

Map --enable-debug-symbols to rustc’s -g.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1177608#c3
Blocks: oxidation
You should do both this and bug 1185662 with the same patch.
(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: nobody → ato
Status: NEW → ASSIGNED
Summary: Support debug symbols for rustc → Support debug assertions and 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)
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
Closed: 8 years ago
Flags: needinfo?(ato)
Resolution: --- → DUPLICATE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: