[Midnightbsd-cvs] src [11078] trunk/contrib/gcclibs: add misisng files.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Jun 19 10:08:16 EDT 2018
Revision: 11078
http://svnweb.midnightbsd.org/src/?rev=11078
Author: laffer1
Date: 2018-06-19 10:08:15 -0400 (Tue, 19 Jun 2018)
Log Message:
-----------
add misisng files.
Added Paths:
-----------
trunk/contrib/gcclibs/libcpp/ChangeLog.apple
trunk/contrib/gcclibs/libcpp/ChangeLog.gcc43
trunk/contrib/gcclibs/libcpp/directives-only.c
trunk/contrib/gcclibs/libgomp/ChangeLog.gcc44
trunk/contrib/gcclibs/libgomp/config/bsd/
trunk/contrib/gcclibs/libgomp/config/bsd/proc.c
trunk/contrib/gcclibs/libgomp/config/linux/affinity.c
trunk/contrib/gcclibs/libgomp/config/linux/proc.c
trunk/contrib/gcclibs/libgomp/config/mingw32/proc.c
trunk/contrib/gcclibs/libgomp/config/posix/affinity.c
trunk/contrib/gcclibs/libiberty/ChangeLog.gcc43
Added: trunk/contrib/gcclibs/libcpp/ChangeLog.apple
===================================================================
--- trunk/contrib/gcclibs/libcpp/ChangeLog.apple (rev 0)
+++ trunk/contrib/gcclibs/libcpp/ChangeLog.apple 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,14 @@
+2008-08-04 Bill Wendling <wendling at apple.com>
+
+ Radar 6121572
+ * charset.c (_cpp_convert_input): Don't read to.text[-1].
+
+2008-05-01 Mike Stump <mrs at apple.com>
+
+ Radar 5774975
+ * charset.c (_cpp_convert_input): Eat UTF-8 BOM.
+
+2005-02-17 Devang Patel <dpatel at apple.com>
+
+ Radar 3958387
+ * libcpp/lex.c (_cpp_get_fresh_line): Check warn_newline_at_eof.
Added: trunk/contrib/gcclibs/libcpp/ChangeLog.gcc43
===================================================================
--- trunk/contrib/gcclibs/libcpp/ChangeLog.gcc43 (rev 0)
+++ trunk/contrib/gcclibs/libcpp/ChangeLog.gcc43 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,57 @@
+2007-06-05 Joerg Wunsch <j.gnu at uriah.heep.sax.de> (r250566)
+
+ PR preprocessor/23479
+ * expr.c (cpp_classify_number): Implement 0b-prefixed binary
+ integer constants.
+ (append_digit): Likewise.
+ * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
+ binary integer constants.
+
+2007-05-31 Dave Korn <dave.korn at artimi.com> (r125212)
+
+ PR preprocessor/14331
+ * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
+
+2007-05-21 Ian Lance Taylor <iant at google.com> (r124929)
+
+ * internal.h (struct cpp_reader): Add new fields:
+ nonexistent_file_hash and nonexistent_file_ob.
+ * files.c: Include "obstack.h".
+ (find_file_in_dir): Before trying to open the file, look up the
+ path name in the hash table of nonexistent files. After failing
+ to open the file, add the path name to the hash table.
+ (_cpp_find_file): Cache the results of looking up the file name
+ starting with the quote and bracket chain heads, if we can.
+ (nonexistent_file_hash_eq): New static function.
+ (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
+ pfile->nonexistent_file_ob.
+ (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
+ pfile->nonexistent_file_ob.
+
+2007-05-14 Janis Johnson <janis187 at us.ibm.com> (r124731)
+
+ PR c/31924
+ * expr.c (interpret_float_suffix): Check for invalid suffix.
+
+2007-05-02 Eric Christopher <echristo at apple.com> (r124358)
+
+ * expr.c (num_div_op): Don't overflow if the result is
+ zero.
+
+2007-05-02 Tom Tromey <tromey at redhat.com> (r124356)
+
+ PR preprocessor/28709:
+ * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
+
+2007-01-30 Tom Tromey <tromey at redhat.com> (r121340)
+
+ PR preprocessor/29966:
+ * macro.c (lex_expansion_token): Save and restore cpp_reader's
+ cur_token.
+ (_cpp_create_definition): Don't restore cur_token here.
+ * lex.c (_cpp_lex_token): Added assertion.
+
+2006-12-29 Ian Lance Taylor <iant at google.com> (r120263)
+
+ * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
+ look backward at the end of the line unless we saw a backslash.
Added: trunk/contrib/gcclibs/libcpp/directives-only.c
===================================================================
--- trunk/contrib/gcclibs/libcpp/directives-only.c (rev 0)
+++ trunk/contrib/gcclibs/libcpp/directives-only.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,229 @@
+/* CPP Library - directive only preprocessing for distributed compilation.
+ Copyright (C) 2007
+ Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw at google.com>.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "cpplib.h"
+#include "internal.h"
+
+/* DO (Directive only) flags. */
+#define DO_BOL (1 << 0) /* At the beginning of a logical line. */
+#define DO_STRING (1 << 1) /* In a string constant. */
+#define DO_CHAR (1 << 2) /* In a character constant. */
+#define DO_BLOCK_COMMENT (1 << 3) /* In a block comment. */
+#define DO_LINE_COMMENT (1 << 4) /* In a single line "//-style" comment. */
+
+#define DO_LINE_SPECIAL (DO_STRING | DO_CHAR | DO_LINE_COMMENT)
+#define DO_SPECIAL (DO_LINE_SPECIAL | DO_BLOCK_COMMENT)
+
+/* Writes out the preprocessed file, handling spacing and paste
+ avoidance issues. */
+void
+_cpp_preprocess_dir_only (cpp_reader *pfile,
+ const struct _cpp_dir_only_callbacks *cb)
+{
+ struct cpp_buffer *buffer;
+ const unsigned char *cur, *base, *next_line, *rlimit;
+ cppchar_t c, last_c;
+ unsigned flags;
+ int lines, col;
+ source_location loc;
+
+ restart:
+ /* Buffer initialization ala _cpp_clean_line(). */
+ buffer = pfile->buffer;
+ buffer->cur_note = buffer->notes_used = 0;
+ buffer->cur = buffer->line_base = buffer->next_line;
+ buffer->need_line = false;
+
+ /* This isn't really needed. It prevents a compiler warning, though. */
+ loc = pfile->line_table->highest_line;
+
+ /* Scan initialization. */
+ next_line = cur = base = buffer->cur;
+ rlimit = buffer->rlimit;
+ flags = DO_BOL;
+ lines = 0;
+ col = 1;
+
+ for (last_c = '\n', c = *cur; cur < rlimit; last_c = c, c = *++cur, ++col)
+ {
+ /* Skip over escaped newlines. */
+ if (__builtin_expect (c == '\\', false))
+ {
+ const unsigned char *tmp = cur + 1;
+
+ while (is_nvspace (*tmp) && tmp < rlimit)
+ tmp++;
+ if (*tmp == '\r')
+ tmp++;
+ if (*tmp == '\n' && tmp < rlimit)
+ {
+ CPP_INCREMENT_LINE (pfile, 0);
+ lines++;
+ col = 0;
+ cur = tmp;
+ c = last_c;
+ continue;
+ }
+ }
+
+ if (__builtin_expect (last_c == '#', false) && !(flags & DO_SPECIAL))
+ {
+ if (c != '#' && (flags & DO_BOL))
+ {
+ struct line_maps *line_table;
+
+ if (!pfile->state.skipping && next_line != base)
+ cb->print_lines (lines, base, next_line - base);
+
+ /* Prep things for directive handling. */
+ buffer->next_line = cur;
+ buffer->need_line = true;
+ _cpp_get_fresh_line (pfile);
+
+ /* Ensure proper column numbering for generated error messages. */
+ buffer->line_base -= col - 1;
+
+ _cpp_handle_directive (pfile, 0 /* ignore indented */);
+
+ /* Sanitize the line settings. Duplicate #include's can mess
+ things up. */
+ line_table = pfile->line_table;
+ line_table->highest_location = line_table->highest_line;
+
+ /* The if block prevents us from outputing line information when
+ the file ends with a directive and no newline. Note that we
+ must use pfile->buffer, not buffer. */
+ if (pfile->buffer->cur != pfile->buffer->rlimit)
+ cb->maybe_print_line (pfile->line_table->highest_line);
+
+ goto restart;
+ }
+
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+ else if (__builtin_expect (last_c == '/', false) \
+ && !(flags & DO_SPECIAL) && c != '*' && c != '/')
+ {
+ /* If a previous slash is not starting a block comment, clear the
+ DO_BOL flag. */
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+
+ switch (c)
+ {
+ case '/':
+ if ((flags & DO_BLOCK_COMMENT) && last_c == '*')
+ {
+ flags &= ~DO_BLOCK_COMMENT;
+ c = 0;
+ }
+ else if (!(flags & DO_SPECIAL) && last_c == '/')
+ flags |= DO_LINE_COMMENT;
+ else if (!(flags & DO_SPECIAL))
+ /* Mark the position for possible error reporting. */
+ LINEMAP_POSITION_FOR_COLUMN (loc, pfile->line_table, col);
+
+ break;
+
+ case '*':
+ if (!(flags & DO_SPECIAL))
+ {
+ if (last_c == '/')
+ flags |= DO_BLOCK_COMMENT;
+ else
+ {
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+ }
+
+ break;
+
+ case '\'':
+ case '"':
+ {
+ unsigned state = (c == '"') ? DO_STRING : DO_CHAR;
+
+ if (!(flags & DO_SPECIAL))
+ {
+ flags |= state;
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+ else if ((flags & state) && last_c != '\\')
+ flags &= ~state;
+
+ break;
+ }
+
+ case '\\':
+ {
+ if ((flags & (DO_STRING | DO_CHAR)) && last_c == '\\')
+ c = 0;
+
+ if (!(flags & DO_SPECIAL))
+ {
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+
+ break;
+ }
+
+ case '\n':
+ CPP_INCREMENT_LINE (pfile, 0);
+ lines++;
+ col = 0;
+ flags &= ~DO_LINE_SPECIAL;
+ if (!(flags & DO_SPECIAL))
+ flags |= DO_BOL;
+ break;
+
+ case '#':
+ next_line = cur;
+ /* Don't update DO_BOL yet. */
+ break;
+
+ case ' ': case '\t': case '\f': case '\v': case '\0':
+ break;
+
+ default:
+ if (!(flags & DO_SPECIAL))
+ {
+ flags &= ~DO_BOL;
+ pfile->mi_valid = false;
+ }
+ break;
+ }
+ }
+
+ if (flags & DO_BLOCK_COMMENT)
+ cpp_error_with_line (pfile, CPP_DL_ERROR, loc, 0, "unterminated comment");
+
+ if (!pfile->state.skipping && cur != base)
+ cb->print_lines (lines, base, cur - base);
+
+ _cpp_pop_buffer (pfile);
+ if (pfile->buffer)
+ goto restart;
+}
Property changes on: trunk/contrib/gcclibs/libcpp/directives-only.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libgomp/ChangeLog.gcc44
===================================================================
--- trunk/contrib/gcclibs/libgomp/ChangeLog.gcc44 (rev 0)
+++ trunk/contrib/gcclibs/libgomp/ChangeLog.gcc44 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,8 @@
+2008-09-19 Jakub Jelinek <jakub at redhat.com> (r140497)
+ Andreas Tobler <a.tobler at schweiz.org>
+
+ * config/bsd/proc.c: New file.
+ * configure.tgt (*-*-darwin*): Use config_path "darwin posix".
+ * configure.ac: Check for header <sys/sysctl.h>
+ * configure: Regenerate.
+ * config.h.in: Likewise.
Added: trunk/contrib/gcclibs/libgomp/config/bsd/proc.c
===================================================================
--- trunk/contrib/gcclibs/libgomp/config/bsd/proc.c (rev 0)
+++ trunk/contrib/gcclibs/libgomp/config/bsd/proc.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,117 @@
+/* Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth at redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This file contains system specific routines related to counting
+ online processors and dynamic load balancing. It is expected that
+ a system may well want to write special versions of each of these.
+
+ The following implementation uses a mix of POSIX and BSD routines. */
+
+#include "libgomp.h"
+#include <unistd.h>
+#include <stdlib.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+static int
+get_num_procs (void)
+{
+#ifdef _SC_NPROCESSORS_ONLN
+ return sysconf (_SC_NPROCESSORS_ONLN);
+#elif defined HW_NCPU
+ int ncpus = 1;
+ size_t len = sizeof(ncpus);
+ sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
+ return ncpus;
+#else
+ return 0;
+#endif
+}
+
+/* At startup, determine the default number of threads. It would seem
+ this should be related to the number of cpus online. */
+
+void
+gomp_init_num_threads (void)
+{
+ int ncpus = get_num_procs ();
+
+ if (ncpus > 0)
+ gomp_global_icv.nthreads_var = ncpus;
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+ threads we should spawn for this team. */
+/* ??? I have no idea what best practice for this is. Surely some
+ function of the number of processors that are *still* online and
+ the load average. Here I use the number of processors online
+ minus the 15 minute load average. */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+ unsigned n_onln, loadavg;
+ unsigned nthreads_var = gomp_icv (false)->nthreads_var;
+
+ n_onln = get_num_procs ();
+ if (!n_onln || n_onln > nthreads_var)
+ n_onln = nthreads_var;
+
+ loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+ {
+ double dloadavg[3];
+ if (getloadavg (dloadavg, 3) == 3)
+ {
+ /* Add 0.1 to get a kind of biased rounding. */
+ loadavg = dloadavg[2] + 0.1;
+ }
+ }
+#endif
+
+ if (loadavg >= n_onln)
+ return 1;
+ else
+ return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+ int ncpus = get_num_procs ();
+ if (ncpus <= 0)
+ ncpus = gomp_icv (false)->nthreads_var;
+ return ncpus;
+}
+
+ialias (omp_get_num_procs)
Property changes on: trunk/contrib/gcclibs/libgomp/config/bsd/proc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libgomp/config/linux/affinity.c
===================================================================
--- trunk/contrib/gcclibs/libgomp/config/linux/affinity.c (rev 0)
+++ trunk/contrib/gcclibs/libgomp/config/linux/affinity.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,107 @@
+/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub at redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This is a Linux specific implementation of a CPU affinity setting. */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+
+static unsigned int affinity_counter;
+#ifndef HAVE_SYNC_BUILTINS
+static gomp_mutex_t affinity_lock;
+#endif
+
+void
+gomp_init_affinity (void)
+{
+ cpu_set_t cpuset;
+ size_t idx, widx;
+
+ if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset))
+ {
+ gomp_error ("could not get CPU affinity set");
+ free (gomp_cpu_affinity);
+ gomp_cpu_affinity = NULL;
+ gomp_cpu_affinity_len = 0;
+ return;
+ }
+
+ for (widx = idx = 0; idx < gomp_cpu_affinity_len; idx++)
+ if (gomp_cpu_affinity[idx] < CPU_SETSIZE
+ && CPU_ISSET (gomp_cpu_affinity[idx], &cpuset))
+ gomp_cpu_affinity[widx++] = gomp_cpu_affinity[idx];
+
+ if (widx == 0)
+ {
+ gomp_error ("no CPUs left for affinity setting");
+ free (gomp_cpu_affinity);
+ gomp_cpu_affinity = NULL;
+ gomp_cpu_affinity_len = 0;
+ return;
+ }
+
+ gomp_cpu_affinity_len = widx;
+ CPU_ZERO (&cpuset);
+ CPU_SET (gomp_cpu_affinity[0], &cpuset);
+ pthread_setaffinity_np (pthread_self (), sizeof (cpuset), &cpuset);
+ affinity_counter = 1;
+#ifndef HAVE_SYNC_BUILTINS
+ gomp_mutex_init (&affinity_lock);
+#endif
+}
+
+void
+gomp_init_thread_affinity (pthread_attr_t *attr)
+{
+ unsigned int cpu;
+ cpu_set_t cpuset;
+
+#ifdef HAVE_SYNC_BUILTINS
+ cpu = __sync_fetch_and_add (&affinity_counter, 1);
+#else
+ gomp_mutex_lock (&affinity_lock);
+ cpu = affinity_counter++;
+ gomp_mutex_unlock (&affinity_lock);
+#endif
+ cpu %= gomp_cpu_affinity_len;
+ CPU_ZERO (&cpuset);
+ CPU_SET (gomp_cpu_affinity[cpu], &cpuset);
+ pthread_attr_setaffinity_np (attr, sizeof (cpu_set_t), &cpuset);
+}
+
+#else
+
+#include "../posix/affinity.c"
+
+#endif
Property changes on: trunk/contrib/gcclibs/libgomp/config/linux/affinity.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libgomp/config/linux/proc.c
===================================================================
--- trunk/contrib/gcclibs/libgomp/config/linux/proc.c (rev 0)
+++ trunk/contrib/gcclibs/libgomp/config/linux/proc.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,179 @@
+/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub at redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This file contains system specific routines related to counting
+ online processors and dynamic load balancing. */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+# endif
+#endif
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+static unsigned long
+cpuset_popcount (cpu_set_t *cpusetp)
+{
+#ifdef CPU_COUNT
+ /* glibc 2.6 and above provide a macro for this. */
+ return CPU_COUNT (cpusetp);
+#else
+ size_t i;
+ unsigned long ret = 0;
+ extern int check[sizeof (cpusetp->__bits[0]) == sizeof (unsigned long int)];
+
+ (void) check;
+ for (i = 0; i < sizeof (*cpusetp) / sizeof (cpusetp->__bits[0]); i++)
+ {
+ unsigned long int mask = cpusetp->__bits[i];
+ if (mask == 0)
+ continue;
+ ret += __builtin_popcountl (mask);
+ }
+ return ret;
+#endif
+}
+#endif
+
+/* At startup, determine the default number of threads. It would seem
+ this should be related to the number of cpus online. */
+
+void
+gomp_init_num_threads (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+ cpu_set_t cpuset;
+
+ if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset) == 0)
+ {
+ /* Count only the CPUs this process can use. */
+ gomp_nthreads_var = cpuset_popcount (&cpuset);
+ if (gomp_nthreads_var == 0)
+ gomp_nthreads_var = 1;
+ return;
+ }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+ gomp_nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
+#endif
+}
+
+static int
+get_num_procs (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+ cpu_set_t cpuset;
+
+ if (gomp_cpu_affinity == NULL)
+ {
+ /* Count only the CPUs this process can use. */
+ if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset),
+ &cpuset) == 0)
+ {
+ int ret = cpuset_popcount (&cpuset);
+ return ret != 0 ? ret : 1;
+ }
+ }
+ else
+ {
+ size_t idx;
+ static int affinity_cpus;
+
+ /* We can't use pthread_getaffinity_np in this case
+ (we have changed it ourselves, it binds to just one CPU).
+ Count instead the number of different CPUs we are
+ using. */
+ CPU_ZERO (&cpuset);
+ if (affinity_cpus == 0)
+ {
+ int cpus = 0;
+ for (idx = 0; idx < gomp_cpu_affinity_len; idx++)
+ if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpuset))
+ {
+ cpus++;
+ CPU_SET (gomp_cpu_affinity[idx], &cpuset);
+ }
+ affinity_cpus = cpus;
+ }
+ return affinity_cpus;
+ }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+ return sysconf (_SC_NPROCESSORS_ONLN);
+#else
+ return gomp_nthreads_var;
+#endif
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+ threads we should spawn for this team. */
+/* ??? I have no idea what best practice for this is. Surely some
+ function of the number of processors that are *still* online and
+ the load average. Here I use the number of processors online
+ minus the 15 minute load average. */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+ unsigned n_onln, loadavg;
+
+ n_onln = get_num_procs ();
+ if (n_onln > gomp_nthreads_var)
+ n_onln = gomp_nthreads_var;
+
+ loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+ {
+ double dloadavg[3];
+ if (getloadavg (dloadavg, 3) == 3)
+ {
+ /* Add 0.1 to get a kind of biased rounding. */
+ loadavg = dloadavg[2] + 0.1;
+ }
+ }
+#endif
+
+ if (loadavg >= n_onln)
+ return 1;
+ else
+ return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+ return get_num_procs ();
+}
+
+ialias (omp_get_num_procs)
Property changes on: trunk/contrib/gcclibs/libgomp/config/linux/proc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libgomp/config/mingw32/proc.c
===================================================================
--- trunk/contrib/gcclibs/libgomp/config/mingw32/proc.c (rev 0)
+++ trunk/contrib/gcclibs/libgomp/config/mingw32/proc.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,82 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ Contributed by Danny Smith <dannysmith at users.sourceforge.net>
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This file contains system specific routines related to counting
+ online processors and dynamic load balancing. It is expected that
+ a system may well want to write special versions of each of these.
+
+ The following implementation uses win32 API routines. */
+
+#include "libgomp.h"
+#include <windows.h>
+
+/* Count the CPU's currently available to this process. */
+static int
+count_avail_process_cpus ()
+{
+ DWORD_PTR process_cpus;
+ DWORD_PTR system_cpus;
+
+ if (GetProcessAffinityMask (GetCurrentProcess (),
+ &process_cpus, &system_cpus))
+ {
+ unsigned int count;
+ for (count = 0; process_cpus != 0; process_cpus >>= 1)
+ if (process_cpus & 1)
+ count++;
+ return count;
+ }
+ return 1;
+}
+
+/* At startup, determine the default number of threads. It would seem
+ this should be related to the number of cpus available to the process. */
+
+void
+gomp_init_num_threads (void)
+{
+ gomp_nthreads_var = count_avail_process_cpus ();
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+ threads we should spawn for this team. FIXME: How do we adjust for
+ load average on MS Windows? */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+ int n_onln = count_avail_process_cpus ();
+ return n_onln > gomp_nthreads_var ? gomp_nthreads_var : n_onln;
+}
+
+int
+omp_get_num_procs (void)
+{
+ return count_avail_process_cpus ();
+}
+
+ialias (omp_get_num_procs)
Property changes on: trunk/contrib/gcclibs/libgomp/config/mingw32/proc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libgomp/config/posix/affinity.c
===================================================================
--- trunk/contrib/gcclibs/libgomp/config/posix/affinity.c (rev 0)
+++ trunk/contrib/gcclibs/libgomp/config/posix/affinity.c 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,41 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub at redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This is a generic stub implementation of a CPU affinity setting. */
+
+#include "libgomp.h"
+
+void
+gomp_init_affinity (void)
+{
+}
+
+void
+gomp_init_thread_affinity (pthread_attr_t *attr)
+{
+ (void) attr;
+}
Property changes on: trunk/contrib/gcclibs/libgomp/config/posix/affinity.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/gcclibs/libiberty/ChangeLog.gcc43
===================================================================
--- trunk/contrib/gcclibs/libiberty/ChangeLog.gcc43 (rev 0)
+++ trunk/contrib/gcclibs/libiberty/ChangeLog.gcc43 2018-06-19 14:08:15 UTC (rev 11078)
@@ -0,0 +1,60 @@
+2007-05-05 Geoffrey Keating <geoffk at apple.com> (r124467)
+
+ PR 31775
+ * mangle.c (write_mangled_name): Mangle static variable names.
+ (write_unqualified_name): Use local-source-name for
+ namespace-scope static variables.
+
+2007-03-15 Geoffrey Keating <geoffk at apple.com> (r122972)
+
+ * cp-demangle.c (d_encoding): Exit early on error.
+ (d_pointer_to_member_type): Exit early if cplus_demangle_type
+ returns NULL.
+ (cplus_demangle_type): Likewise.
+ * testsuite/demangle-expected: New testcase.
+
+2007-01-31 Ben Elliston <bje at au.ibm.com> (r121364)
+
+ * strsignal.c (psignal): Change type of signo to int.
+ * functions.texi: Regenerate.
+
+2007-01-12 Ben Elliston <bje at au.ibm.com> (r120702)
+
+ * pex-unix.c (writeerr): Cast write result to void.
+
+ * choose-temp.c (choose_temp_base): Check the result of the call
+ to mktemp rather than testing the length of the modified string.
+
+2006-12-20 Geoffrey Keating <geoffk at apple.com> (r120097)
+
+ * cp-demangle.h: Add comment explaining what to do to avoid
+ overrunning string.
+ (d_check_char): New.
+ (d_next_char): Don't advance past trailing '\0'.
+ * cp-demangle.c (cplus_demangle_mangled_name): Use d_check_char.
+ (d_nested_name): Likewise.
+ (d_special_name): Likewise.
+ (d_call_offset): Likewise.
+ (d_function_type): Likewise.
+ (d_array_type): Likewise.
+ (d_pointer_to_member_type): Likewise.
+ (d_template_param): Likewise.
+ (d_template_args): Likewise.
+ (d_template_arg): Likewise.
+ (d_expr_primary): Likewise.
+ (d_local_name): Likewise.
+ (d_substitution): Likewise.
+ (d_ctor_dtor_name): Use d_advance rather than d_next_char.
+ * testsuite/test-demangle.c: Include sys/mman.h.
+ (MAP_ANONYMOUS): Define.
+ (protect_end): New.
+ (main): Use protect_end.
+ * testsuite/demangle-expected: Add testcases for overrunning
+ the end of the string.
+
+2006-11-07 Julian Brown <julian at codesourcery.com> (r118552)
+
+ * floatformat.c (get_field): Fix segfault with little-endian word
+ order on 64-bit hosts.
+ (put_field): Likewise.
+ (min): Move definition.
More information about the Midnightbsd-cvs
mailing list