Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Nov 2011 21:22:51 +0000 (UTC)
From:      Andreas Tobler <andreast@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227586 - head/contrib/gcc/config/rs6000
Message-ID:  <201111162122.pAGLMpJD067193@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andreast
Date: Wed Nov 16 21:22:51 2011
New Revision: 227586
URL: http://svn.freebsd.org/changeset/base/227586

Log:
  Copy over the ASM_DECLARE_FUNCTION_SIZE macro from linux64.h. This macro
  declares the proper size of a function. Without this macro recent GNU as will
  complain about with:
  'Error: .size expression for main does not evaluate to a constant.'
  
  Up to now we produce this:
  
  .L.main:
   	....
  	.size   main, .-main
  
  With the macro defined the output is this:
  
  .L.main:
   	....
  	.size   main,.-.L.main
  
  This affects only the 64-bit compiler.
  Tested with world and kernel on both, 32 and 64-bit powerpc.

Modified:
  head/contrib/gcc/config/rs6000/freebsd.h

Modified: head/contrib/gcc/config/rs6000/freebsd.h
==============================================================================
--- head/contrib/gcc/config/rs6000/freebsd.h	Wed Nov 16 20:18:25 2011	(r227585)
+++ head/contrib/gcc/config/rs6000/freebsd.h	Wed Nov 16 21:22:51 2011	(r227586)
@@ -253,3 +253,22 @@ extern int dot_symbols;
 
 #undef NEED_INDICATE_EXEC_STACK
 #define NEED_INDICATE_EXEC_STACK 1
+
+/* This is how to declare the size of a function.  */
+#undef  ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
+  do                                                                    \
+    {                                                                   \
+      if (!flag_inhibit_size_directive)                                 \
+        {                                                               \
+          fputs ("\t.size\t", (FILE));                                  \
+          if (TARGET_64BIT && DOT_SYMBOLS)                              \
+            putc ('.', (FILE));                                         \
+          assemble_name ((FILE), (FNAME));                              \
+          fputs (",.-", (FILE));                                        \
+          rs6000_output_function_entry (FILE, FNAME);                   \
+          putc ('\n', (FILE));                                          \
+        }                                                               \
+    }                                                                   \
+  while (0)
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111162122.pAGLMpJD067193>