View | Details | Raw Unified | Return to bug 170440
Collapse All | Expand All

(-)Makefile (-10 / +11 lines)
Lines 1-5 Link Here
1
# New ports collection makefile for:  gnat-aux
1
# New ports collection makefile for:  gnat-aux
2
# Date created:                       16 December 2010
2
# Date created:                       2010-12-16
3
# Whom:                               John Marino <draco@marino.st>
3
# Whom:                               John Marino <draco@marino.st>
4
#
4
#
5
# $FreeBSD: ports/lang/gnat-aux/Makefile,v 1.8 2012/04/09 11:28:22 culot Exp $
5
# $FreeBSD: ports/lang/gnat-aux/Makefile,v 1.8 2012/04/09 11:28:22 culot Exp $
Lines 7-12 Link Here
7
7
8
PORTNAME=	gnat-aux
8
PORTNAME=	gnat-aux
9
PORTVERSION=	${SNAPSHOT}
9
PORTVERSION=	${SNAPSHOT}
10
PORTREVISION=	1
10
CATEGORIES=	lang
11
CATEGORIES=	lang
11
MASTER_SITES=	http://downloads.dragonlace.net/src/:boot \
12
MASTER_SITES=	http://downloads.dragonlace.net/src/:boot \
12
		http://dragonlace.mirrors.ada.cx/src/:boot \
13
		http://dragonlace.mirrors.ada.cx/src/:boot \
Lines 271-285 Link Here
271
272
272
	cd ${WRKDIR}; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
273
	cd ${WRKDIR}; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
273
.if ${OSVERSION} > 900000
274
.if ${OSVERSION} > 900000
274
	@${ECHO_MSG} "========================================================"
275
	@${ECHO_MSG} "===================================================================="
275
	@${ECHO_MSG} " NOTICE REGARDING ADA TASKING ON FREEBSD 9.x:"
276
	@${ECHO_MSG} " NOTICE REGARDING ADA TASKING ON FREEBSD 9.0:"
276
	@${ECHO_MSG} " Due to a new resource check in the threading library"
277
	@${ECHO_MSG} " Due to a bug in the FreeBSD 9.0 threading library, an exiting task"
277
	@${ECHO_MSG} " starting with FreeBSD 9.0, an exiting task panics with"
278
	@${ECHO_MSG} " panics with the message: 'thread exits with resources held!'."
278
	@${ECHO_MSG} " the message 'thread exits with resources held!'."
279
	@${ECHO_MSG} " This behavior breaks Ada tasking.  These are two solutions:"
279
	@${ECHO_MSG} " Essentially this behavior breaks Ada tasking and 23"
280
	@${ECHO_MSG} " 1) Upgrade to FreeBSD 9.1 or higher"
280
	@${ECHO_MSG} " ACATS tests fail on FreeBSD 9.x. A solution is being"
281
	@${ECHO_MSG} " 2) Patch and rebuild thread library as described in"
281
	@${ECHO_MSG} " sought, but the necessary patches will not be trivial."
282
	@${ECHO_MSG} "    http://www.dragonlace.net/posts/F9_Fix/"
282
	@${ECHO_MSG} "========================================================"
283
	@${ECHO_MSG} "===================================================================="
283
.endif
284
.endif
284
285
285
.include <bsd.port.post.mk>
286
.include <bsd.port.post.mk>
(-)files/diff-core (-32 / +171 lines)
Lines 290-295 Link Here
290
+#define UINTPTR_TYPE      (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE)
290
+#define UINTPTR_TYPE      (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE)
291
--- /dev/null
291
--- /dev/null
292
+++ gcc/config/dragonfly.h
292
+++ gcc/config/dragonfly.h
293
@@ -0,0 +1,141 @@
294
+/* Base configuration file for all DragonFly targets.
295
+   Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
296
+   Copyright (C) 2010-2012 John R. Marino <www.dragonlace.net>
297
+
298
+This file is part of GCC.
299
+
300
+GCC is free software; you can redistribute it and/or modify
301
+it under the terms of the GNU General Public License as published by
302
+the Free Software Foundation; either version 3, or (at your option)
303
+any later version.
304
+
305
+GCC is distributed in the hope that it will be useful,
306
+but WITHOUT ANY WARRANTY; without even the implied warranty of
307
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308
+GNU General Public License for more details.
309
+
310
+You should have received a copy of the GNU General Public License
311
+along with GCC; see the file COPYING3.  If not see
312
+<http://www.gnu.org/licenses/>.  */
313
+
314
+/* Common DragonFly configuration.
315
+   All DragonFly architectures should include this file, which will specify
316
+   their commonalities.
317
+
318
+   Adapted from gcc/config/freebsd.h by
319
+   Joerg Sonnenberger <joerg@bec.de>
320
+
321
+   Adapted from gcc/config/i386/freebsd-elf.h by
322
+   David O'Brien <obrien@FreeBSD.org>.
323
+   Further work by David O'Brien <obrien@FreeBSD.org> and
324
+   Loren J. Rittle <ljrittle@acm.org>.  */
325
+
326
+/* JRM: 15 Nov 2010
327
+   SWITCH_TAKES_ARG & WORD_SWITCH_TAKES_ARG removed due to poisoning.
328
+   http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02102.html
329
+   http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html */
330
+   
331
+#undef  TARGET_OS_CPP_BUILTINS
332
+#define TARGET_OS_CPP_BUILTINS()            \
333
+  do                                        \
334
+    {                                       \
335
+       builtin_define_std ("unix");         \
336
+       builtin_define ("__DragonFly__");    \
337
+       builtin_assert ("system=unix");      \
338
+       builtin_assert ("system=bsd");       \
339
+       builtin_assert ("system=DragonFly"); \
340
+    }                                       \
341
+  while (0)
342
+
343
+#undef  CPP_SPEC
344
+#define CPP_SPEC \
345
+ "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
346
+
347
+#undef  STARTFILE_SPEC
348
+#define STARTFILE_SPEC	\
349
+  "%{!shared: \
350
+     %{pg:gcrt1.o%s} \
351
+     %{!pg: \
352
+       %{p:gcrt1.o%s} \
353
+       %{!p: \
354
+         %{profile: gcrt1.o%s} \
355
+         %{!profile: \
356
+           %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
357
+   crti.o%s \
358
+   %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
359
+
360
+#undef  ENDFILE_SPEC
361
+#define ENDFILE_SPEC \
362
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
363
+
364
+#undef  LIB_SPEC
365
+#define LIB_SPEC \
366
+  "%{pthread:-lpthread} -lc"
367
+
368
+/* Provide a LINK_SPEC appropriate for DragonFly.  Here we provide support
369
+   for the special GCC options -static and -shared, which allow us to
370
+   link things in one of these three modes by applying the appropriate
371
+   combinations of options at link-time.
372
+
373
+   When the -shared link option is used a final link is not being
374
+   done.  */
375
+
376
+#define DFBSD_LINK_SPEC \
377
+ "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
378
+  %{v:-V} \
379
+  %{assert*} %{R*} %{rpath*} %{defsym*} \
380
+  %{shared:-Bshareable %{h*} %{soname*}} \
381
+  %{!shared: \
382
+   %{!static: \
383
+    %{rdynamic:-export-dynamic} \
384
+    -dynamic-linker %(dfbsd_dynamic_linker) \
385
+   } \
386
+  %{static:-Bstatic}} \
387
+  %{!static:--hash-style=both} \
388
+  %{symbolic:-Bsymbolic}"
389
+
390
+#undef  LINK_SPEC
391
+#define LINK_SPEC DFBSD_LINK_SPEC
392
+
393
+#define	DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
394
+
395
+#if defined(HAVE_LD_EH_FRAME_HDR)
396
+#define LINK_EH_SPEC "--eh-frame-hdr"
397
+#endif
398
+
399
+/* Use --as-needed -lgcc_s for eh support.  */
400
+#ifdef HAVE_LD_AS_NEEDED
401
+#define USE_LD_AS_NEEDED 1
402
+#endif
403
+
404
+/************************[  Target stuff  ]***********************************/
405
+
406
+/* All DragonFly Architectures support the ELF object file format.  */
407
+#undef  OBJECT_FORMAT_ELF
408
+#define OBJECT_FORMAT_ELF
409
+
410
+/* Don't assume anything about the header files.  */
411
+#undef  NO_IMPLICIT_EXTERN_C
412
+#define NO_IMPLICIT_EXTERN_C	1
413
+
414
+/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...).  */
415
+
416
+#undef  WCHAR_TYPE
417
+#define WCHAR_TYPE "int"
418
+
419
+#undef  WINT_TYPE
420
+#define WINT_TYPE "int"
421
+
422
+#define MATH_LIBRARY_PROFILE    "m_p"
423
+
424
+/* Code generation parameters.  */
425
+
426
+/* Use periods rather than dollar signs in special g++ assembler names.
427
+   This ensures the configuration knows our system correctly so we can link
428
+   with libraries compiled with the native cc.  */
429
+#undef NO_DOLLAR_IN_LABEL
430
+
431
+/* Used by libgcc2.c.  We support file locking with fcntl / F_SETLKW.
432
+   This enables the test coverage code to use file locking when exiting a
433
+   program, which avoids race conditions if the program has forked.  */
434
+#define TARGET_POSIX_IO
435
--- /dev/null
436
+++ gcc/config/dragonfly.h.orig
293
@@ -0,0 +1,139 @@
437
@@ -0,0 +1,139 @@
294
+/* Base configuration file for all DragonFly targets.
438
+/* Base configuration file for all DragonFly targets.
295
+   Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
439
+   Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
Lines 904-955 Link Here
904
+
1048
+
905
--- /dev/null
1049
--- /dev/null
906
+++ gcc/config/i386/freebsd-unwind.h
1050
+++ gcc/config/i386/freebsd-unwind.h
907
@@ -0,0 +1,184 @@
1051
@@ -0,0 +1,179 @@
908
+/* DWARF2 EH unwinding support for FreeBSD: AMD x86-64 and x86.
1052
+/* DWARF2 EH unwinding support for FreeBSD: AMD x86-64 and x86.
909
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
1053
+   Copyright (C) 2010, 2012 John Marino <draco@marino.st>
910
+   Copyright (C) 2010 John Marino <draco@marino.st>
911
+
912
+This file is part of GCC.
913
+
914
+GCC is free software; you can redistribute it and/or modify
915
+it under the terms of the GNU General Public License as published by
916
+the Free Software Foundation; either version 2, or (at your option)
917
+any later version.
918
+
919
+In addition to the permissions in the GNU General Public License, the
920
+Free Software Foundation gives you unlimited permission to link the
921
+compiled version of this file with other programs, and to distribute
922
+those programs without any restriction coming from the use of this
923
+file.  (The General Public License restrictions do apply in other
924
+respects; for example, they cover modification of the file, and
925
+distribution when not linked into another program.)
926
+
927
+GCC is distributed in the hope that it will be useful,
928
+but WITHOUT ANY WARRANTY; without even the implied warranty of
929
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
930
+GNU General Public License for more details.
931
+
932
+You should have received a copy of the GNU General Public License
933
+along with GCC; see the file COPYING.  If not, write to
934
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
935
+Boston, MA 02110-1301, USA.  */
936
+
1054
+
937
+/* Do code reading to identify a signal frame, and set the frame
1055
+/* Do code reading to identify a signal frame, and set the frame
938
+   state data appropriately.  See unwind-dw2.c for the structs. */
1056
+   state data appropriately.  See unwind-dw2.c for the structs. */
939
+
1057
+
940
+#include <sys/types.h>
1058
+#include <sys/types.h>
941
+#include <sys/sysctl.h>
942
+#include <signal.h>
1059
+#include <signal.h>
943
+#include <sys/ucontext.h>
1060
+#include <sys/ucontext.h>
944
+#include <machine/sigframe.h>
1061
+#include <machine/sigframe.h>
945
+
1062
+
946
+
947
+#define REG_NAME(reg)	sf_uc.uc_mcontext.mc_## reg
1063
+#define REG_NAME(reg)	sf_uc.uc_mcontext.mc_## reg
948
+
1064
+
949
+#ifdef __x86_64__
1065
+#ifdef __x86_64__
950
+#define MD_FALLBACK_FRAME_STATE_FOR x86_64_freebsd_fallback_frame_state
1066
+#define MD_FALLBACK_FRAME_STATE_FOR x86_64_freebsd_fallback_frame_state
951
+
1067
+
952
+
1068
+#if (__FreeBSD__ < 9)
1069
+#include <sys/sysctl.h>
953
+static void
1070
+static void
954
+x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
1071
+x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
955
+{
1072
+{
Lines 965-970 Link Here
965
+  *start = (unsigned char *)ps_strings - 32;
1082
+  *start = (unsigned char *)ps_strings - 32;
966
+  *end   = (unsigned char *)ps_strings;
1083
+  *end   = (unsigned char *)ps_strings;
967
+}
1084
+}
1085
+#endif
968
+
1086
+
969
+
1087
+
970
+static _Unwind_Reason_Code
1088
+static _Unwind_Reason_Code
Lines 976-984 Link Here
976
+  struct sigframe *sf;
1094
+  struct sigframe *sf;
977
+  long new_cfa;
1095
+  long new_cfa;
978
+
1096
+
1097
+#if (__FreeBSD__ < 9)
979
+  x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
1098
+  x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
980
+  if (pc >= sigtramp_end || pc < sigtramp_start)
1099
+  if (pc >= sigtramp_end || pc < sigtramp_start)
981
+    return _URC_END_OF_STACK;
1100
+    return _URC_END_OF_STACK;
1101
+#else
1102
+  /* Prior to FreeBSD 9, the signal trampoline was located immediately
1103
+     before the ps_strings.  To support non-executable stacks on AMD64,
1104
+     the sigtramp was moved to a shared page for FreeBSD 9.  We are
1105
+     stuck looking for frame patterns again (sys/amd64/amd64/sigtramp.S):
1106
+
1107
+     <pc + 00>:  lea     0x10(%rsp),%rdi
1108
+     <pc + 05>:  pushq   $0x0
1109
+     <pc + 17>:  mov     $0x1a1,%rax
1110
+     <pc + 14>:  syscall
1111
+
1112
+     If we can't find this pattern, we're at the end of the stack.
1113
+  */
1114
+
1115
+  if (!(   *(unsigned int *)(context->ra)      == 0x247c8d48
1116
+        && *(unsigned int *)(context->ra +  4) == 0x48006a10
1117
+        && *(unsigned int *)(context->ra +  8) == 0x01a1c0c7
1118
+        && *(unsigned int *)(context->ra + 12) == 0x050f0000 ))
1119
+    return _URC_END_OF_STACK;
1120
+#endif
982
+
1121
+
983
+  sf = (struct sigframe *) context->cfa;
1122
+  sf = (struct sigframe *) context->cfa;
984
+  new_cfa = sf->REG_NAME(rsp);
1123
+  new_cfa = sf->REG_NAME(rsp);
Lines 1029-1035 Link Here
1029
+
1168
+
1030
+#define MD_FALLBACK_FRAME_STATE_FOR x86_freebsd_fallback_frame_state
1169
+#define MD_FALLBACK_FRAME_STATE_FOR x86_freebsd_fallback_frame_state
1031
+
1170
+
1032
+
1171
+#include <sys/sysctl.h>
1033
+static void
1172
+static void
1034
+x86_sigtramp_range (unsigned char **start, unsigned char **end)
1173
+x86_sigtramp_range (unsigned char **start, unsigned char **end)
1035
+{
1174
+{
(-)files/diff-cxx (-3 / +3 lines)
Lines 14-20 Link Here
14
 	enable_clocale_flag=darwin
14
 	enable_clocale_flag=darwin
15
 	;;
15
 	;;
16
+      dragonfly*)
16
+      dragonfly*)
17
+        enable_clocale_flag_dragonfly
17
+        enable_clocale_flag=dragonfly
18
+        ;;
18
+        ;;
19
       *)
19
       *)
20
 	enable_clocale_flag=generic
20
 	enable_clocale_flag=generic
Lines 24-30 Link Here
24
       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
24
       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
25
       ;;
25
       ;;
26
+    dragonfly)
26
+    dragonfly)
27
+      AC_MSG_RESULT(darwin or freebsd)
27
+      AC_MSG_RESULT(dragonfly)
28
 
28
 
29
+      CLOCALE_H=config/locale/generic/c_locale.h
29
+      CLOCALE_H=config/locale/generic/c_locale.h
30
+      CLOCALE_CC=config/locale/dragonfly/c_locale.cc
30
+      CLOCALE_CC=config/locale/dragonfly/c_locale.cc
Lines 69-75 Link Here
69
       ;;
69
       ;;
70
+    dragonfly)
70
+    dragonfly)
71
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: dragonfly" >&5
71
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: dragonfly" >&5
72
+$as_echo "darwin or freebsd" >&6; }
72
+$as_echo "dragonfly" >&6; }
73
 
73
 
74
+      CLOCALE_H=config/locale/generic/c_locale.h
74
+      CLOCALE_H=config/locale/generic/c_locale.h
75
+      CLOCALE_CC=config/locale/dragonfly/c_locale.cc
75
+      CLOCALE_CC=config/locale/dragonfly/c_locale.cc
(-)files/diff-fortran (-1 / +1 lines)
Lines 4-10 Link Here
4
 
4
 
5
   gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, 
5
   gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, 
6
 		      BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST);
6
 		      BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST);
7
+#if defined(__NetBSD__) && (__NetBSD__ > 4)
7
+#if defined(__NetBSD__)
8
+  gfc_define_builtin ("__builtin_cabs", func_cdouble_double, 
8
+  gfc_define_builtin ("__builtin_cabs", func_cdouble_double, 
9
+		      BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST);
9
+		      BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST);
10
+  gfc_define_builtin ("__builtin_cabsf", func_cfloat_float,
10
+  gfc_define_builtin ("__builtin_cabsf", func_cfloat_float,

Return to bug 170440