mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 18:20:51 +08:00
re PR pch/14940 (PCH largefile test fails on various platforms)
gcc: PR pch/14940 * config/host-solaris.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Redefine to sol_gt_pch_get_address. (TRY_EMPTY_VM_SPACE): Define for all combinations of 32 and 64-bit, SPARC and x86. (sol_gt_pch_get_address): New function. gcc/testsuite: PR pch/14940 * gcc.dg/pch/pch.exp: Don't XFAIL largefile.c on i?86-*-solaris2.10. From-SVN: r157141
This commit is contained in:
parent
72a30e3cf0
commit
291c0a12c4
@ -1,3 +1,12 @@
|
||||
2010-03-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
PR pch/14940
|
||||
* config/host-solaris.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Redefine
|
||||
to sol_gt_pch_get_address.
|
||||
(TRY_EMPTY_VM_SPACE): Define for all combinations of 32 and
|
||||
64-bit, SPARC and x86.
|
||||
(sol_gt_pch_get_address): New function.
|
||||
|
||||
2010-03-01 Marco Poletti <poletti.marco@gmail.com>
|
||||
|
||||
* toplev.h (inform_n, error_n): Declare.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Solaris host-specific hook definitions.
|
||||
Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -25,9 +25,48 @@
|
||||
#include "hosthooks-def.h"
|
||||
|
||||
|
||||
#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
|
||||
#define HOST_HOOKS_GT_PCH_GET_ADDRESS sol_gt_pch_get_address
|
||||
#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
|
||||
#define HOST_HOOKS_GT_PCH_USE_ADDRESS sol_gt_pch_use_address
|
||||
|
||||
/* For various ports, try to guess a fixed spot in the vm space
|
||||
that's probably free. Based on McDougall, Mauro, Solaris Internals, 2nd
|
||||
ed., p.460-461, fig. 9-3, 9-4, 9-5. */
|
||||
#if defined(__sparcv9__)
|
||||
/* This low to avoid VA hole on UltraSPARC I/II. */
|
||||
# define TRY_EMPTY_VM_SPACE 0x70000000000
|
||||
#elif defined(__sparc__)
|
||||
# define TRY_EMPTY_VM_SPACE 0x80000000
|
||||
#elif defined(__x86_64__)
|
||||
# define TRY_EMPTY_VM_SPACE 0x8000000000000000
|
||||
#elif defined(__i386__)
|
||||
# define TRY_EMPTY_VM_SPACE 0xB0000000
|
||||
#else
|
||||
# define TRY_EMPTY_VM_SPACE 0
|
||||
#endif
|
||||
|
||||
/* Determine a location where we might be able to reliably allocate
|
||||
SIZE bytes. FD is the PCH file, though we should return with the
|
||||
file unmapped. */
|
||||
|
||||
static void *
|
||||
sol_gt_pch_get_address (size_t size, int fd)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
addr = mmap ((caddr_t) TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE, fd, 0);
|
||||
|
||||
/* If we failed the map, that means there's *no* free space. */
|
||||
if (addr == (void *) MAP_FAILED)
|
||||
return NULL;
|
||||
/* Unmap the area before returning. */
|
||||
munmap ((caddr_t) addr, size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
|
||||
mapping the data at BASE, -1 if we couldn't. */
|
||||
|
||||
|
@ -43,7 +43,6 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
|
||||
set test "largefile.c"
|
||||
set testh "largefile.hs"
|
||||
set f [open $test w]
|
||||
puts $f "/* { dg-xfail-if \"PR 14940\" { \"i?86-*-solaris2.10\" } { \"*\" } { \"\" } } */"
|
||||
puts $f "/* { dg-timeout-factor 4.0 } */"
|
||||
set v 0
|
||||
for { set v 0 } { $v < 10000 } { incr v } {
|
||||
|
Loading…
x
Reference in New Issue
Block a user