Open Bug 1516758 Opened 6 years ago Updated 3 months ago

-Wodr: C++ One Definition Rule violations in Firefox

Categories

(Firefox Build System :: General: Unsupported Platforms, defect, P5)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: jh, Unassigned)

References

Details

Attachments

(2 files)

Attached file odr.txt
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0 Steps to reproduce: I built Firefox with GCC 8 and LTO Actual results: I got warnings about ODR vilations Expected results: There should be no warnigs
Blocks: 1455279
Here is the kind of warnings: /aux/hubicka/firefox-2018/release/security/ct/CTLogVerifier.h:29:7: warning: type ‘struct CTLogVerifier’ violates the C++ One Definition Rule [-Wodr]
Blocks: build-gcc-8
No longer blocks: 1455279
Summary: C++ One Definition Rule violations in Firefox → -Wodr: C++ One Definition Rule violations in Firefox
Component: Untriaged → General: Unsupported Platforms
Product: Firefox → Firefox Build System
Note that the log I attached is produced by GCC9 where I made the warning hopefully more understandable. Some of issues are easy to fix because they are caused by misplaced forward declarations that should be in proper name-space. I will try to get around preparing patch for them.
Blocks: build-gcc-9
No longer blocks: build-gcc-8
Priority: -- → P5

Hi! I am new here, how can I do to build Firefox with GCC 8 and LTO to replicate the warning?

Severity: normal → S3
Attached file warnings

This is still reproducible, there are also some lto type mismatch warnings. see the attached log for more info.

Note that these issues exist with Clang too, it's just that Clang doesn't diagnose them (doesn't have -Wodr or -Wlto-type-mismatch right now, I've filed bugs asking for them to support it).

Version: 64 Branch → unspecified

(Note that clang does have -Wodr but this flag really makes sense when merging compilation unit)

Depends on: 1923081
Depends on: 1923084
Depends on: 1923085

(In reply to Sam James from comment #5)

Note that these issues exist with Clang too, it's just that Clang doesn't diagnose them (doesn't have -Wodr or -Wlto-type-mismatch right now, I've filed bugs asking for them to support it).

See https://github.com/llvm/llvm-project/issues/34914 (maskray also covers it on his blog at https://maskray.me/blog/2022-11-13-odr-violation-detection, but tl;dr is "only asan or C++ modules" and https://github.com/llvm/llvm-project/issues/56487.

Thank you for taking a look Serge!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: