All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Build with -fno-dwarf2-cfi-asm
@ 2009-09-03 10:22 Colin Watson
  2009-09-03 14:23 ` Colin Watson
  2009-09-03 14:47 ` Robert Millan
  0 siblings, 2 replies; 7+ messages in thread
From: Colin Watson @ 2009-09-03 10:22 UTC (permalink / raw)
  To: grub-devel

I'd like to commit this for 1.97; it's important for users of recent
distributions that use GCC 4.4 by default (which is the current release
series of GCC). Otherwise, the core is too big to embed when using LVM
and RAID (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/423412).
Any objections?

2009-09-03  Colin Watson  <cjwatson@ubuntu.com>

	* configure.ac: By default, GCC 4.4 generates .eh_frame sections
	containing unwind information in some cases where it previously did
	not. Use -fno-dwarf2-cfi-asm if available to restore the old
	behaviour. See http://patchwork.kernel.org/patch/8555/ for related
	discussion.

Index: configure.ac
===================================================================
--- configure.ac	(revision 2561)
+++ configure.ac	(working copy)
@@ -246,6 +246,21 @@
       TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
     fi
   fi
+
+  # By default, GCC 4.4 generates .eh_frame sections containing unwind
+  # information in some cases where it previously did not. GRUB doesn't need
+  # these and they just use up vital space. Restore the old compiler
+  # behaviour.
+  AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
+    CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+		      [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
+		      [grub_cv_cc_fno_dwarf2_cfi_asm=no])
+  ])
+
+  if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
+  fi
 fi
 
 grub_apple_target_cc

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] Build with -fno-dwarf2-cfi-asm
@ 2009-03-23 19:25 Kyle McMartin
  0 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2009-03-23 19:25 UTC (permalink / raw)
  To: torvalds; +Cc: roland, aoliva, sam, linux-kernel, linux-kbuild

From: Kyle McMartin <kyle@redhat.com>

With a sufficiently new compiler and binutils, code which wasn't
previously generating .eh_frame sections has begun to. Certain architectures
(powerpc, in this case) may generate unexpected relocation formats in
response to this, preventing modules from loading.

While the new relocation types should probably be handled, revert to
the previous behaviour with regards to generation of .eh_frame sections.

(This was reported against Fedora, which appears to be the only distro
doing any building against gcc-4.4 at present: RH bz#486545.)

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Cc: roland@redhat.com
Cc: aoliva@redhat.com
Cc: sam@ravnborg.org
---

As near as I can tell, the only case previously was for the vdso images,
which are explicitly built with -fasynchronous-unwind-tables, and
annotated with cfi directives.

Everyone else either unwinds their stack manually, or has a custom
unwind format like parisc or ia64.

Hopefully this is a somewhat better description than the last time.

cheers, Kyle

diff --git a/Makefile b/Makefile
index a2c2efe..057230a 100644
--- a/Makefile
+++ b/Makefile
@@ -569,6 +569,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 # disable invalid "can't wrap" optimzations for signed / pointers
 KBUILD_CFLAGS	+= $(call cc-option,-fwrapv)
 
+# revert to pre-gcc-4.4 behaviour of .eh_frame
+KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
+
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 # But warn user when we do so
 warn-assign = \

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-03 23:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03 10:22 [PATCH] Build with -fno-dwarf2-cfi-asm Colin Watson
2009-09-03 14:23 ` Colin Watson
2009-09-03 14:47 ` Robert Millan
2009-09-03 15:27   ` Colin Watson
2009-09-03 15:38     ` Robert Millan
2009-09-03 23:02       ` Colin Watson
  -- strict thread matches above, loose matches on Subject: below --
2009-03-23 19:25 Kyle McMartin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.