diff options
author | David O'Brien <obrien@FreeBSD.org> | 2002-11-01 22:19:38 +0000 |
---|---|---|
committer | David O'Brien <obrien@gcc.gnu.org> | 2002-11-01 22:19:38 +0000 |
commit | 8df91177c05fa3a53a531415724889ad332eaab7 (patch) | |
tree | 42aa59b6a42d767d23b6b46aa238a7ccc51b9222 | |
parent | 616dc555ce0c2993ab791afc0623f5b7ed830778 (diff) | |
download | gcc-8df91177c05fa3a53a531415724889ad332eaab7.zip gcc-8df91177c05fa3a53a531415724889ad332eaab7.tar.gz gcc-8df91177c05fa3a53a531415724889ad332eaab7.tar.bz2 |
freebsd.h (CPP_CPU64_DEFAULT_SPEC): Define __arch64__.
2002-11-01 David O'Brien <obrien@FreeBSD.org>
* config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Define __arch64__.
(TRANSFER_FROM_TRAMPOLINE): Reformat.
Add comment.
Approved by: Mark Mitchell <mark@codesourcery.com>
Message-ID: <15490000.1036182355@warlock.codesourcery.com>
From-SVN: r58730
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/sparc/freebsd.h | 54 |
2 files changed, 31 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e38b11..20e95b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-01 David O'Brien <obrien@FreeBSD.org> + + * config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Define __arch64__. + (TRANSFER_FROM_TRAMPOLINE): Reformat. + Add comment. + 2002-11-01 Kazu Hirata <kazu@cs.umass.edu> * config/h8300/h8300.h (CAN_ELIMINATE): Simplify. diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index 73155ae..a220b06 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -18,11 +18,13 @@ You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* FreeBSD needs's the platform name (sparc64) defined. */ +/* FreeBSD needs's the platform name (sparc64) defined. + Emacs needs to know if the arch is 64 or 32-bits. */ #undef CPP_CPU64_DEFAULT_SPEC -#define CPP_CPU64_DEFAULT_SPEC "-D__sparc64__ -D__sparc_v9__" +#define CPP_CPU64_DEFAULT_SPEC "-D__sparc64__ -D__sparc_v9__ -D__arch64__" +/* Because we include sparc/sysv4.h. */ #undef CPP_PREDEFINES #define CPP_PREDEFINES FBSD_CPP_PREDEFINES @@ -97,35 +99,29 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define SPARC_DEFAULT_CMODEL CM_MEDLOW #define TRANSFER_FROM_TRAMPOLINE \ -static int need_enable_exec_stack; \ + static int need_enable_exec_stack; \ + static void check_enabling(void) __attribute__ ((constructor)); \ + static void check_enabling(void) \ + { \ + extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\ + int prot = 0; \ + size_t len = sizeof(prot); \ \ -static void check_enabling(void) __attribute__ ((constructor)); \ -static void check_enabling(void) \ -{ \ - extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\ - size_t len; \ - int prot; \ - \ - prot = 0; \ - len = sizeof(prot); \ - sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0); \ - if (prot != 7) \ - need_enable_exec_stack = 1; \ -} \ - \ -extern void __enable_execute_stack (void *); \ -void \ -__enable_execute_stack (addr) \ - void *addr; \ -{ \ - if (!need_enable_exec_stack) \ - return; \ - else { \ - /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \ - if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0) \ - perror ("mprotect of trampoline code"); \ + sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0); \ + if (prot != 7) \ + need_enable_exec_stack = 1; \ } \ -} + extern void __enable_execute_stack (void *); \ + void __enable_execute_stack (void *addr) \ + { \ + if (!need_enable_exec_stack) \ + return; \ + else { \ + /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \ + if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0) \ + perror ("mprotect of trampoline code"); \ + } \ + } /************************[ Assembler stuff ]********************************/ |