Last Comment Bug 743988 - linking with MOZ_GLUE_PROGRAM_LDFLAGS should use the C++ compiler if necessary
: linking with MOZ_GLUE_PROGRAM_LDFLAGS should use the C++ compiler if necessary
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla14
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on: 1272626
Blocks: 614188 744444 747348
  Show dependency treegraph
 
Reported: 2012-04-10 07:00 PDT by Nathan Froyd [:froydnj]
Modified: 2016-05-13 04:16 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (4.44 KB, patch)
2012-04-10 11:08 PDT, Nathan Froyd [:froydnj]
ted: review+
Details | Diff | Splinter Review

Description Nathan Froyd [:froydnj] 2012-04-10 07:00:23 PDT
rules.mk for PROGRAMS and SIMPLE_PROGRAMS says:

ifeq ($(CPP_PROG_LINK),1)
    $(EXPAND_CCC) ... $(MOZ_GLUE_PROGRAM_LDFLAGS) ...
else
    $(EXPAND_CC) ... $(MOZ_GLUE_PROGRAM_LDFLAGS) ...
endif

If MOZ_GLUE_PROGRAM_LDFLAGS links in C++ code, then we should be using the platform's C++ compiler to link to ensure that we correctly link any necessary C++ runtime code.  (Should we do this unconditionally?  I don't know all the permutations of cases for things that go in or places that use MOZ_GLUE_PROGRAM_LDFLAGS.)

This doesn't cause problems now, but it will as more code is added to places like MFBT, for instance.
Comment 1 Ted Mielczarek [:ted.mielczarek] 2012-04-10 07:07:34 PDT
I'd say just link everything as C++ and if anything blows up, fix it.
Comment 2 Nathan Froyd [:froydnj] 2012-04-10 11:08:32 PDT
Created attachment 613683 [details] [diff] [review]
patch

This patch looks like it at least builds on try.

I didn't nuke CPP_PROG_LINK, as it's still used for purify/quantify targets (which could probably be nuked in a separate bug).
Comment 3 Ted Mielczarek [:ted.mielczarek] 2012-04-11 09:36:44 PDT
Comment on attachment 613683 [details] [diff] [review]
patch

Review of attachment 613683 [details] [diff] [review]:
-----------------------------------------------------------------

If you're not going to rip out CPP_PROG_LINK, can you at least file a followup on doing so?

::: config/rules.mk
@@ +868,5 @@
>  # 2-second granularity
>  	touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
>  endif
>  else # !WINNT || GNU_CC
> +# mozglue contains C++ code, so we need to link with the C++ compiler.

I wouldn't bother with this comment.
Comment 4 Ted Mielczarek [:ted.mielczarek] 2012-04-11 09:45:52 PDT
Comment on attachment 613683 [details] [diff] [review]
patch

Review of attachment 613683 [details] [diff] [review]:
-----------------------------------------------------------------

::: config/rules.mk
@@ +868,5 @@
>  # 2-second granularity
>  	touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
>  endif
>  else # !WINNT || GNU_CC
> +# mozglue contains C++ code, so we need to link with the C++ compiler.

I wouldn't bother with this comment.
Comment 7 Mike Hommey [:glandium] 2016-05-13 03:11:09 PDT
Funnily, 4 years later, this makes us link nspr with libstdc++...

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