Make --enable-address-sanitizer pass the correct -fsanitize arguments to the toolchain

RESOLVED WORKSFORME

Status

defect
RESOLVED WORKSFORME
5 years ago
Last year

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Assignee

Description

5 years ago
No description provided.
Assignee

Updated

5 years ago
Assignee: nobody → ehsan.akhgari
Blocks: winasan
Assignee

Updated

5 years ago
Attachment #8506572 - Flags: review?(mh+mozilla)
Attachment #8506572 - Flags: review?(mh+mozilla) → review+
Assignee

Comment 3

5 years ago
glandium, can you please help me figure this out?

Here's the stuff that I have tried so far:

* I can reproduce the bustage locally with my patch applied.
* While trying to see what's different before and after my patch, I realized that before my patch, HOST_C/CXX/LDFLAGS contain -fsanitize=address but after my patch they don't, presumably because the in-tree ASAN mozconfigs don't set the HOST variables.  Adding the flag to the HOST_ counterparts in configure.in however did not help.
* Looking at the build logs from both before and after my patch, we build certutil.c (which is the NSS utility hit by this) both with -fsanitize=address, so the difference isn't there either.

Here is a link to my push earlier today: <https://treeherder.mozilla.org/ui/index.html#/jobs?repo=mozilla-inbound&revision=2b1c2663f92a>
Flags: needinfo?(mh+mozilla)
I bet the problem is that you *need* to link with -fsanitize=address. Well, that obviously won't work with link.exe, but it seems to me -fsanitize=address is making the compiler add something to the link command. IIRC, asan links a library so that'd be what it does. So you'd need to do that. Either by making the build link through clang, or by adding the right LDFLAGS.
Flags: needinfo?(mh+mozilla)
huh, except comment 4 is assuming the problem is with building clang-cl asan, which is not what the problem was.
Assignee

Comment 6

5 years ago
Yeah, the linking should also be handled fine in my patch.  Do you have any other ideas?
Flags: needinfo?(mh+mozilla)
Try "export LDFLAGS=" in the mozconfig.
Flags: needinfo?(mh+mozilla)
Assignee

Comment 8

5 years ago
(In reply to Mike Hommey [:glandium] from comment #7)
> Try "export LDFLAGS=" in the mozconfig.

That didn't help, unfortunately: https://tbpl.mozilla.org/?tree=Try&rev=d7f64393b11e
Assignee

Comment 9

5 years ago
glandium, do you have any other ideas?  I've run out of them. :/
Flags: needinfo?(mh+mozilla)
Assignee

Comment 10

5 years ago
Ping?
It looks like the necessary changes got applied in bug 1280637 (making --enable-*-sanitizer DTRT) and bug 1307547 (don't pass the sanitizer flags on windows).
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(mh+mozilla)

Updated

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