Open Bug 1451396 Opened 7 years ago Updated 2 years ago

Configure doesn't complain if you set CXX to gcc-6

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox61 affected)

Tracking Status
firefox61 --- affected

People

(Reporter: Gijs, Unassigned)

References

Details

STR: 1. use Ubuntu 16.04 LTS 2. try to build and fail because gcc is outdated. 3. use steps in https://bugzilla.mozilla.org/show_bug.cgi?id=1451312 to try to install a working gcc 4. after installing the working gcc, try to build again, and find it still fails. 5. be an idiot, and instead of setting CC and CXX to different things in your mozconfig, just set both to `gcc-6` 6. build Actual results: Builds for 40 minutes (well, after also downloading and installing clang, and downloading and installing a new version of rust, etc. etc.) and then fails with cryptic linker errors that say something like: 0:00.23 /usr/bin/gcc-6 [...elided...] -o libfake.so cdm-fake.o cdm-test-decryptor.o cdm-test-storage.o 0:00.33 /home/gijs/mozilla-central/dom/media/fake-cdm/cdm-fake.cpp:61: error: undefined reference to 'operator new(unsigned long)' followed by lots of sad stl headers. Expected results: configure detects that CXX isn't a C++ compiler.
Going to be pedantic here, but that's the cause of the problem: gcc-6 *is* a C++ compiler. That is, giving it .cpp files and making it output objects *works*. In fact, there *is* a configure test that checks whether CXX is a C++ compiler, and it failed with older versions of GCC. The problem here is that gcc-6 is not a C++ linker driver. Incidentally, there is a unit test checking the CXX is a C++ compiler check, which is now wrong because it assumes gcc-6 works like older versions.
In another of my hypocaffeinated blunders, I hit this today too. (Thanks, duplicate suggestor!)
Component: Build Config → General
Product: Toolkit → Firefox Build System
Blocks: gcc-6.1
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.