mozilla

Revision 201489 of Building on Fedora Core 5

  • Revision slug: Building_on_Fedora_Core_5
  • Revision title: Building on Fedora Core 5
  • Revision id: 201489
  • Created:
  • Creator: DBaron
  • Is current revision? No
  • Comment /* Need -fno-omit-frame-pointer */

Revision Content

Building Mozilla applications (Firefox, Thunderbird, SeaMonkey, etc.) on modern Linux distributions is generally relatively trouble-free, although each new distribution tends to introduce a few new issues that need to be fixed in the source. Fedora Core 5 introduces a few of these issues:

Compilation errors relating to JB_BP

Depending on the version of your source and configuration options, you may see compilation errors related to the removal of JB_BP, which was a constant used in code that took stack traces for debugging purposes by getting the frame address by calling setjmp. Patches to fix these problems are in bug 323853.

The patch that affects the default build options has been checked in to the trunk, the MOZILLA_1_8_BRANCH, and the MOZILLA_1_8_0_BRANCH. However, if you are using other debugging tools, particularly on older branches, or building from older branches or release tags, you may need to apply some of these patches yourself.

SELinux execmod denials

For those with SELinux in enforcing mode, you are likely to run into problems both with the shlibsign during the build process and with the running the final build related to SELinux denying execmod permission due at least primarily (if not completely) to a compiler bug.

This problem can be worked around in one of the following two ways

Workaround #1 (sacrifice performance)

Disable the visibility optimizations by making the following change to mozilla/configure:

Index: configure
===================================================================
RCS file: /cvs/mozilla/configure,v
retrieving revision 1.1639
diff -p -u -3 -r1.1639 configure
--- configure   21 Mar 2006 03:04:54 -0000      1.1639
+++ configure   21 Mar 2006 09:00:23 -0000
@@ -7876,7 +7876,7 @@ cross_compiling=$ac_cv_prog_cc_cross

 fi

-if test "$GNU_CC"; then
+if test ""; then
   echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
 echo "configure:7882: checking for visibility(hidden) attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then

Workaround #2 (sacrifice security; have to use workaround more often)

Use a command like (using bash syntax):

 chcon -t texrel_shlib_t $(find . -name "*.so")

within dist/bin to give the shared libraries a security context type that allows execmod (i.e., making previously-writable memory executable).

Debugging tools involving stack traces

Need patches

Because of changes in the meaning of __builtin_frame_address(0), patches from {{template.Bug(331436)}} are needed; they should be checked in to the trunk reasonably soon.

Need -fno-omit-frame-pointer

With gcc 4.1, some optimization levels (e.g., -O, -Os, -O2) have started to imply -fomit-frame-pointer. (Verify this? Which levels?) If you want to use jprof or any of the other stack walking tools, you probably need to use

 ac_add_options --enable-optimize="-O2 -fno-omit-frame-pointer"

when enabling optimization. (Perhaps retest this once patches from bug 331436 are landed.)

Revision Source

<p>Building Mozilla applications (Firefox, Thunderbird, SeaMonkey, etc.) on modern Linux distributions is generally relatively trouble-free, although each new distribution tends to introduce a few new issues that need to be fixed in the source.  Fedora Core 5 introduces a few of these issues:
</p>
<h3 name="Compilation_errors_relating_to_JB_BP"> Compilation errors relating to JB_BP </h3>
<p>Depending on the version of your source and configuration options, you may see compilation errors related to the removal of JB_BP, which was a constant used in code that took stack traces for debugging purposes by getting the frame address by calling setjmp.  Patches to fix these problems are in <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=323853">bug 323853</a>.
</p><p>The patch that affects the default build options has been checked in to the trunk, the MOZILLA_1_8_BRANCH, and the MOZILLA_1_8_0_BRANCH.  However, if you are using other debugging tools, particularly on older branches, or building from older branches or release tags, you may need to apply some of these patches yourself.
</p>
<h3 name="SELinux_execmod_denials"> SELinux execmod denials </h3>
<p>For those with SELinux in enforcing mode, you are likely to run into problems both with the shlibsign during the build process and with the running the final build related to SELinux denying <a class="external" href="http://people.redhat.com/~drepper/selinux-mem.html">execmod permission</a> due at least primarily (if not completely) to <a class="external" href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175442">a compiler bug</a>.  
</p><p>This problem can be worked around in one of the following two ways
</p>
<h4 name="Workaround_.231_.28sacrifice_performance.29"> Workaround #1 (sacrifice performance) </h4>
<p>Disable the visibility optimizations by making the following change to mozilla/configure:
</p>
<pre>Index: configure
===================================================================
RCS file: /cvs/mozilla/configure,v
retrieving revision 1.1639
diff -p -u -3 -r1.1639 configure
--- configure   21 Mar 2006 03:04:54 -0000      1.1639
+++ configure   21 Mar 2006 09:00:23 -0000
@@ -7876,7 +7876,7 @@ cross_compiling=$ac_cv_prog_cc_cross

 fi

-if test "$GNU_CC"; then
+if test ""; then
   echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1&gt;&amp;6
 echo "configure:7882: checking for visibility(hidden) attribute" &gt;&amp;5
 if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then</pre>
<h4 name="Workaround_.232_.28sacrifice_security.3B_have_to_use_workaround_more_often.29"> Workaround #2 (sacrifice security; have to use workaround more often) </h4>
<p>Use a command like (using bash syntax):
</p>
<pre class="eval"> chcon -t texrel_shlib_t $(find . -name "*.so")
</pre>
<p>within dist/bin to give the shared libraries a security context type that allows execmod (i.e., making previously-writable memory executable).
</p>
<h3 name="Debugging_tools_involving_stack_traces"> Debugging tools involving stack traces </h3>
<h4 name="Need_patches"> Need patches </h4>
<p>Because of changes in the meaning of __builtin_frame_address(0), patches from {{template.Bug(331436)}} are needed; they should be checked in to the trunk reasonably soon.
</p>
<h4 name="Need_-fno-omit-frame-pointer"> Need -fno-omit-frame-pointer </h4>
<p>With gcc 4.1, some optimization levels (e.g., -O, -Os, -O2) have started to imply -fomit-frame-pointer.  (Verify this?  Which levels?)  If you want to use jprof or any of the other stack walking tools, you probably need to use
</p>
<pre class="eval"> ac_add_options --enable-optimize="-O2 -fno-omit-frame-pointer"
</pre>
<p>when enabling optimization.  (Perhaps retest this once patches from <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=331436">bug 331436</a> are landed.)
</p>
Revert to this revision