Open Bug 1285668 Opened 8 years ago Updated 2 years ago

[Tracking] Make mozilla-central buildable with clang 3.9 and --enable-warnings-as-errors

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox50 affected)

Tracking Status
firefox50 --- affected

People

(Reporter: dholbert, Unassigned)

References

Details

(Keywords: meta)

Attachments

(4 obsolete files)

I tried building with clang 3.9 today (on Linux64), and I got a pile of build errors (presumably from new-in-clang-3.9 build warnings, which are promoted to errors due to --enable-warnings-as-errors in my mozconfig).

Filing this bug as a metabug to track bugs that I/others file for these issues. I'll consider this bug resolved when you can build mozilla-central with clang 3.9 and with ac_add_options --enable-warnings-as-errors in your mozconfig.
(For the record, I'm using my own locally-built version of llvm, loosely following the build instructions at https://developer.mozilla.org/en-US/docs/Mozilla/Testing/Firefox_and_Address_Sanitizer#LLVMClang but using REV=274897 which seems to be the latest revision, as of today.)
FWIW, this hackaround (combined with my patches on bug 1285640 and bug 1285660) lets me successfully get through a build.
Attachment #8769369 - Attachment description: hackaround v1: add "-Wno-error=[warning]" in a bunch of moz.build files → (hackaround v1, with extra MQ junk in commit message; ignore)
Depends on: 1289608
Component: General → Build Config
Depends on: 1290170
Summary: Make mozilla-central buildable with clang 3.9 and --enable-warnings-as-errors → [Tracking] Make mozilla-central buildable with clang 3.9 and --enable-warnings-as-errors
Depends on: 1291397
Depends on: 1291423
Attached patch (wrong version of patch) (obsolete) — Splinter Review
Here's an updated version of the hackaround patch, which I was able to build with today, using a local clang build from revision 285863, and
ac_add_options --enable-warnings-as-errors
ac_add_options --enable-debug --disable-optimize
Attachment #8769370 - Attachment is obsolete: true
Attachment #8806948 - Attachment description: hackaround v2: add "-Wno-error=[warning]" in a bunch of moz.build files → (wrong version of patch)
Attachment #8806948 - Attachment is obsolete: true
Sorry, I just uploaded a slightly-stale patch version.

Here's the actual up-to-date version (with the dom/bindings hackaround removed, now that bug 1291397 has been addressed in clang).
Depends on: 1324242
Depends on: 1324248
No longer depends on: 1290170
Attachment #8806949 - Attachment is obsolete: true
Of the 3 moz.build tweaks in my latest hackaround patch here (from comment 5):
 - 2 have effectively landed elsewhere (in bug 1324248 and bug 1324242)
 - the third (in extensions/spellcheck/hunspell/glue) is no longer needed, possibly due to the hunspell upgrade that landed in bug 1318955.

So, no hackarounds are needed right now, to build mozilla-central with --enable-warnings-as-errors (and enable-debug/disable-optimize) on clang trunk (currently testing revision 288055).

So, I think we can call this FIXED!
(In reply to Daniel Holbert [:dholbert] from comment #6)
>  - the third (in extensions/spellcheck/hunspell/glue) is no longer needed,
> possibly due to the hunspell upgrade that landed in bug 1318955.


Actually, it turns out that we do still spam the hunspell warning, but it's non-fatal, now that the hunspell/glue C++ files are compiled as a unified C++ file. (because compilers are less strict about some warnings spammed for code in #included files)

I can manually resurrect this build issue by converting hunspell/glue from UNIFIED_SOURCES back to just SOURCES. But for now, we're fine.

For posterity, the warning there (whether fatal or nonfatal) is as follows:
{
In file included from <built-in>:2:
In file included from $OBJ/mozilla-config.h:236:
In file included from $SRC/extensions/spellcheck/hunspell/glue/hunspell_alloc_hooks.h:51:
In file included from $SRC/extensions/spellcheck/hunspell/glue/mozHunspellAllocator.h:10:
Warning: -Wundefined-var-template in $OBJ/dist/include/mozilla/CountingAllocatorBase.h: instantiation of variable 'mozilla::CountingAllocatorBase<HunspellAllocator>::sAmount' required here, but no definition is available
$OBJ/dist/include/mozilla/CountingAllocatorBase.h:65:5: warning: instantiation of variable 'mozilla::CountingAllocatorBase<HunspellAllocator>::sAmount' required here, but no definition is available [-Wundefined-var-template]
    sAmount += MallocSizeOfOnAlloc(p);
    ^
/scratch/work/builds/llvm/build-288055/bin/../lib/clang/4.0.0/include/mm_malloc.h:49:12: note: in instantiation of member function 'mozilla::CountingAllocatorBase<HunspellAllocator>::CountingMalloc' requested here
    return malloc(__size);
           ^
$SRC/extensions/spellcheck/hunspell/glue/hunspell_alloc_hooks.h:53:41: note: expanded from macro 'malloc'
#define malloc(size) HunspellAllocator::CountingMalloc(size)
                                        ^
$OBJ/dist/include/mozilla/CountingAllocatorBase.h:132:25: note: forward declaration of template entity is here
  static Atomic<size_t> sAmount;
                        ^
$OBJ/dist/include/mozilla/CountingAllocatorBase.h:65:5: note: add an explicit instantiation declaration to suppress this warning if 'mozilla::CountingAllocatorBase<HunspellAllocator>::sAmount' is explicitly instantiated in another translation unit
    sAmount += MallocSizeOfOnAlloc(p);
    ^
}
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: