This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libbacktrace] Fix bootstrap with gcc 4.4


The libbacktrace integration broke Solaris 10 and 11 bootstrap when
using gcc 4.4 (any version of gcc without __sync_* support actually):

stage1 config.h has

/* #undef HAVE_SYNC_FUNCTIONS */

and fileline.c and mmap.c fail to compile:

/vol/gcc/src/hg/trunk/local/libbacktrace/fileline.c: In function 'fileline_init
alize':
/vol/gcc/src/hg/trunk/local/libbacktrace/fileline.c:58: error: implicit declarat
ion of function 'abort'

The following patch fixes this by including <stdlib.h> for the abort()
declaration in the affected files.  It allows the Solaris 11 bootstrap
to continue.

Ok for mainline?

Unfortunately, Solaris 10 (and certainly Solaris 9, too) bootstrap is still
broken:

/vol/gcc/src/hg/trunk/local/libbacktrace/dwarf.c:652: error: implicit declaration of function 'strnlen'
make[1]: *** [dwarf.lo] Error 1

Both completely lack strnlen().  I haven't done anything about this yet.

	Rainer


2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* fileline.c: Include <stdlib.h>.
	* mmap.c: Likewise.

# HG changeset patch
# Parent a22dd5d7246fa4e8a73de2e66db7594cf9ae9f5a
Fix bootstrap with gcc 4.4

diff --git a/libbacktrace/fileline.c b/libbacktrace/fileline.c
--- a/libbacktrace/fileline.c
+++ b/libbacktrace/fileline.c
@@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.  */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <stdlib.h>
 
 #include "backtrace.h"
 #include "internal.h"
diff --git a/libbacktrace/mmap.c b/libbacktrace/mmap.c
--- a/libbacktrace/mmap.c
+++ b/libbacktrace/mmap.c
@@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.  */
 
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <sys/mman.h>
 

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]