From owner-svn-src-vendor@freebsd.org Sun Feb 7 01:38:53 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A14AA0A87; Sun, 7 Feb 2016 01:38:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4D851CA7; Sun, 7 Feb 2016 01:38:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u171cp0r061966; Sun, 7 Feb 2016 01:38:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u171coMp061951; Sun, 7 Feb 2016 01:38:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070138.u171coMp061951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 01:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295360 - in vendor/NetBSD/libedit/dist: . readline X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:38:53 -0000 Author: pfg Date: Sun Feb 7 01:38:50 2016 New Revision: 295360 URL: https://svnweb.freebsd.org/changeset/base/295360 Log: Import libedit 2016-01-16 Obtained from: NetBSD Modified: vendor/NetBSD/libedit/dist/Makefile vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/dist/chartype.h vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/dist/hist.h vendor/NetBSD/libedit/dist/keymacro.h vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/dist/tokenizer.c vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/dist/vi.c Modified: vendor/NetBSD/libedit/dist/Makefile ============================================================================== --- vendor/NetBSD/libedit/dist/Makefile Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/Makefile Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.52 2014/06/14 20:49:37 mrg Exp $ +# $NetBSD: Makefile,v 1.53 2015/01/29 20:30:02 joerg Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 USE_SHLIBDIR= yes @@ -13,6 +13,7 @@ LIBDPLIBS+= terminfo ${.CURDIR}/../l COPTS+= -Wunused-parameter CWARNFLAGS.gcc+= -Wconversion +CWARNFLAGS.clang+= -Wno-cast-qual OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ Modified: vendor/NetBSD/libedit/dist/chartype.c ============================================================================== --- vendor/NetBSD/libedit/dist/chartype.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/chartype.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); #endif /* not lint && not SCCSID */ #include "el.h" #include @@ -46,31 +46,46 @@ __RCSID("$NetBSD: chartype.c,v 1.10 2011 #define CT_BUFSIZ ((size_t)1024) #ifdef WIDECHAR -protected void -ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize) +protected int +ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize) { void *p; - if (mincsize > conv->csize) { - conv->csize = mincsize; - p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); - if (p == NULL) { - conv->csize = 0; - el_free(conv->cbuff); - conv->cbuff = NULL; - } else - conv->cbuff = p; + + if (csize <= conv->csize) + return 0; + + conv->csize = csize; + + p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); + if (p == NULL) { + conv->csize = 0; + el_free(conv->cbuff); + conv->cbuff = NULL; + return -1; } + conv->cbuff = p; + return 0; +} - if (minwsize > conv->wsize) { - conv->wsize = minwsize; - p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); - if (p == NULL) { - conv->wsize = 0; - el_free(conv->wbuff); - conv->wbuff = NULL; - } else - conv->wbuff = p; +protected int +ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize) +{ + void *p; + + if (wsize <= conv->wsize) + return 0; + + conv->wsize = wsize; + + p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); + if (p == NULL) { + conv->wsize = 0; + el_free(conv->wbuff); + conv->wbuff = NULL; + return -1; } + conv->wbuff = p; + return 0; } @@ -78,26 +93,22 @@ public char * ct_encode_string(const Char *s, ct_buffer_t *conv) { char *dst; - ssize_t used = 0; + ssize_t used; if (!s) return NULL; - if (!conv->cbuff) - ct_conv_buff_resize(conv, CT_BUFSIZ, (size_t)0); - if (!conv->cbuff) - return NULL; dst = conv->cbuff; - while (*s) { - used = (ssize_t)(conv->csize - (size_t)(dst - conv->cbuff)); - if (used < 5) { - used = dst - conv->cbuff; - ct_conv_buff_resize(conv, conv->csize + CT_BUFSIZ, - (size_t)0); - if (!conv->cbuff) + for (;;) { + used = (ssize_t)(dst - conv->cbuff); + if ((conv->csize - (size_t)used) < 5) { + if (ct_conv_cbuff_resize(conv, + conv->csize + CT_BUFSIZ) == -1) return NULL; dst = conv->cbuff + used; } + if (!*s) + break; used = ct_encode_char(dst, (size_t)5, *s); if (used == -1) /* failed to encode, need more buffer space */ abort(); @@ -111,22 +122,19 @@ ct_encode_string(const Char *s, ct_buffe public Char * ct_decode_string(const char *s, ct_buffer_t *conv) { - size_t len = 0; + size_t len; if (!s) return NULL; - if (!conv->wbuff) - ct_conv_buff_resize(conv, (size_t)0, CT_BUFSIZ); - if (!conv->wbuff) - return NULL; len = ct_mbstowcs(NULL, s, (size_t)0); if (len == (size_t)-1) return NULL; - if (len > conv->wsize) - ct_conv_buff_resize(conv, (size_t)0, len + 1); - if (!conv->wbuff) - return NULL; + + if (conv->wsize < ++len) + if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1) + return NULL; + ct_mbstowcs(conv->wbuff, s, conv->wsize); return conv->wbuff; } @@ -145,9 +153,9 @@ ct_decode_argv(int argc, const char *arg * the argv strings. */ for (i = 0, bufspace = 0; i < argc; ++i) bufspace += argv[i] ? strlen(argv[i]) + 1 : 0; - ct_conv_buff_resize(conv, (size_t)0, bufspace); - if (!conv->wsize) - return NULL; + if (conv->wsize < ++bufspace) + if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) + return NULL; wargv = el_malloc((size_t)argc * sizeof(*wargv)); Modified: vendor/NetBSD/libedit/dist/chartype.h ============================================================================== --- vendor/NetBSD/libedit/dist/chartype.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/chartype.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.10 2011/11/16 01:45:10 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ * supports non-BMP code points without requiring UTF-16, but nothing * seems to actually advertise this properly, despite Unicode 3.1 having * been around since 2001... */ -#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) +#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII * compatible, so ensure wchar_t indeed does ISO 10646 and not some other @@ -72,6 +72,7 @@ #define FUN(prefix,rest) prefix ## _w ## rest #define FUNW(type) type ## _w #define TYPE(type) type ## W +#define FCHAR "%lc" #define FSTR "%ls" #define STR(x) L ## x #define UC(c) c @@ -126,6 +127,7 @@ Width(wchar_t c) #define FUN(prefix,rest) prefix ## _ ## rest #define FUNW(type) type #define TYPE(type) type +#define FCHAR "%c" #define FSTR "%s" #define STR(x) x #define UC(c) (unsigned char)(c) @@ -189,7 +191,8 @@ public Char *ct_decode_string(const char protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *); /* Resizes the conversion buffer(s) if needed. */ -protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t); +protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t); +protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t); protected ssize_t ct_encode_char(char *, size_t, Char); protected size_t ct_enc_width(Char); @@ -199,7 +202,8 @@ protected size_t ct_enc_width(Char); #define ct_encode_string(s, b) (s) #define ct_decode_string(s, b) (s) #define ct_decode_argv(l, s, b) (s) -#define ct_conv_buff_resize(b, os, ns) +#define ct_conv_cbuff_resize(b, s) ((s) == (0)) +#define ct_conv_wbuff_resize(b, s) ((s) == (0)) #define ct_encode_char(d, l, s) (*d = s, 1) #define ct_free_argv(s) #endif Modified: vendor/NetBSD/libedit/dist/editline.3 ============================================================================== --- vendor/NetBSD/libedit/dist/editline.3 Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/editline.3 Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.84 2014/12/25 13:39:41 wiz Exp $ +.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 25, 2014 +.Dd November 3, 2015 .Dt EDITLINE 3 .Os .Sh NAME @@ -189,7 +189,7 @@ counterparts. The following functions are available: .Bl -tag -width 4n .It Fn el_init -Initialise the line editor, and return a data structure +Initialize the line editor, and return a data structure to be used by all other line editing functions, or .Dv NULL on failure. @@ -519,61 +519,68 @@ are supported, along with actual type of .Fa result : .Bl -tag -width 4n .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. +set it to the start/stop literal prompt character. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" -Return a pointer to the function that displays the prompt in +Set .Fa f . +to a pointer to the function that displays the prompt. If .Fa c is not .Dv NULL , -return the start/stop literal prompt character in it. -.It Dv EL_EDITOR , Fa "const char **" -Return the name of the editor, which will be one of +set it to the start/stop literal prompt character. +.It Dv EL_EDITOR , Fa "const char **n" +Set the name of the editor in +.Fa n , +which will be one of .Dq emacs or .Dq vi . .It Dv EL_GETTC , Fa "const char *name" , Fa "void *value" -Return non-zero if +If .Fa name is a valid .Xr termcap 5 -capability -and set +capability set .Fa value to the current value of that capability. -.It Dv EL_SIGNAL , Fa "int *" -Return non-zero if +.It Dv EL_SIGNAL , Fa "int *s" +Set +.Fa s +to non zero if .Nm has installed private signal handlers (see .Fn el_get above). -.It Dv EL_EDITMODE , Fa "int *" -Return non-zero if editing is enabled. +.It Dv EL_EDITMODE , Fa "int *c" +Set +.Fa c +to non-zero if editing is enabled. .It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)" Return a pointer to the function that read characters, which is equal to .Dq Dv EL_BUILTIN_GETCFN in the case of the default builtin function. .It Dv EL_CLIENTDATA , Fa "void **data" -Retrieve +Set .Fa data -previously registered with the corresponding +to the previously registered client data set by an .Fn el_set call. -.It Dv EL_UNBUFFERED , Fa "int" -Return non-zero if unbuffered mode is enabled. -.It Dv EL_PREP_TERM , Fa "int" -Sets or clears terminal editing mode. +.It Dv EL_UNBUFFERED , Fa "int *c" +Set +.Fa c +to non-zero if unbuffered mode is enabled. .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp" -Return in +Set .Fa fp -the current +to the current .Nm editline file pointer for .Dq input @@ -591,7 +598,7 @@ or .Dv 2 . .El .It Fn el_source -Initialise +Initialize .Nm by reading the contents of .Fa file . @@ -669,7 +676,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn history_init -Initialise the history list, and return a data structure +Initialize the history list, and return a data structure to be used by all other history list functions, or .Dv NULL on failure. @@ -808,7 +815,7 @@ and freed by The following functions are available: .Bl -tag -width 4n .It Fn tok_init -Initialise the tokenizer, and return a data structure +Initialize the tokenizer, and return a data structure to be used by all other tokenizer functions. .Fa IFS contains the Input Field Separators, which defaults to Modified: vendor/NetBSD/libedit/dist/el.c ============================================================================== --- vendor/NetBSD/libedit/dist/el.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/el.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -__RCSID("$NetBSD: el.c,v 1.73 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: el.c,v 1.74 2015/12/08 12:56:55 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -135,7 +135,8 @@ el_end(EditLine *el) terminal_end(el); keymacro_end(el); map_end(el); - tty_end(el); + if (!(el->el_flags & NO_TTY)) + tty_end(el); ch_end(el); search_end(el); hist_end(el); Modified: vendor/NetBSD/libedit/dist/eln.c ============================================================================== --- vendor/NetBSD/libedit/dist/eln.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/eln.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.19 2015/05/18 15:07:04 christos Exp $"); #endif /* not lint && not SCCSID */ #include "histedit.h" @@ -76,9 +76,17 @@ el_gets(EditLine *el, int *nread) { const wchar_t *tmp; - el->el_flags |= IGNORE_EXTCHARS; + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags |= IGNORE_EXTCHARS; tmp = el_wgets(el, nread); - el->el_flags &= ~IGNORE_EXTCHARS; + if (tmp != NULL) { + size_t nwread = 0; + for (int i = 0; i < *nread; i++) + nwread += ct_enc_width(tmp[i]); + *nread = (int)nwread; + } + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags &= ~IGNORE_EXTCHARS; return ct_encode_string(tmp, &el->el_lgcyconv); } Modified: vendor/NetBSD/libedit/dist/hist.h ============================================================================== --- vendor/NetBSD/libedit/dist/hist.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/hist.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: hist.h,v 1.14 2014/05/11 01:05:17 christos Exp $ */ +/* $NetBSD: hist.h,v 1.15 2016/01/30 15:05:27 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -46,10 +46,10 @@ typedef int (*hist_fun_t)(void *, TYPE(H typedef struct el_history_t { Char *buf; /* The history buffer */ - size_t sz; /* Size of history buffer */ + size_t sz; /* Size of history buffer */ Char *last; /* The last character */ int eventno; /* Event we are looking for */ - void * ref; /* Argument for history fcns */ + void *ref; /* Argument for history fcns */ hist_fun_t fun; /* Event access */ TYPE(HistEvent) ev; /* Event cookie */ } el_history_t; Modified: vendor/NetBSD/libedit/dist/keymacro.h ============================================================================== --- vendor/NetBSD/libedit/dist/keymacro.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/keymacro.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: keymacro.h,v 1.2 2011/07/28 03:44:36 christos Exp $ */ +/* $NetBSD: keymacro.h,v 1.3 2016/01/29 19:59:11 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -47,7 +47,7 @@ typedef union keymacro_value_t { typedef struct keymacro_node_t keymacro_node_t; -typedef struct el_keymacromacro_t { +typedef struct el_keymacro_t { Char *buf; /* Key print buffer */ keymacro_node_t *map; /* Key map */ keymacro_value_t val; /* Local conversion buffer */ Modified: vendor/NetBSD/libedit/dist/map.c ============================================================================== --- vendor/NetBSD/libedit/dist/map.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/map.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $ */ +/* $NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: map.c,v 1.34 2014/07/06 18:15:34 christos Exp $"); +__RCSID("$NetBSD: map.c,v 1.35 2015/05/14 10:44:15 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -1300,8 +1300,8 @@ map_bind(EditLine *el, int argc, const C return 0; default: (void) fprintf(el->el_errfile, - "" FSTR ": Invalid switch `%c'.\n", - argv[0], p[1]); + "" FSTR ": Invalid switch `" FCHAR "'.\n", + argv[0], (Int)p[1]); } else break; Modified: vendor/NetBSD/libedit/dist/readline.c ============================================================================== --- vendor/NetBSD/libedit/dist/readline.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/readline.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $ */ +/* $NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.113 2014/10/18 08:33:23 snj Exp $"); +__RCSID("$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -78,7 +78,7 @@ FILE *rl_outstream = NULL; int rl_point = 0; int rl_end = 0; char *rl_line_buffer = NULL; -VCPFunction *rl_linefunc = NULL; +rl_vcpfunc_t *rl_linefunc = NULL; int rl_done = 0; VFunction *rl_event_hook = NULL; KEYMAP_ENTRY_ARRAY emacs_standard_keymap, @@ -107,9 +107,9 @@ int rl_attempted_completion_over = 0; char *rl_basic_word_break_characters = break_chars; char *rl_completer_word_break_characters = NULL; char *rl_completer_quote_characters = NULL; -Function *rl_completion_entry_function = NULL; +rl_compentry_func_t *rl_completion_entry_function = NULL; char *(*rl_completion_word_break_hook)(void) = NULL; -CPPFunction *rl_attempted_completion_function = NULL; +rl_completion_func_t *rl_attempted_completion_function = NULL; Function *rl_pre_input_hook = NULL; Function *rl_startup1_hook = NULL; int (*rl_getc_function)(FILE *) = NULL; @@ -160,7 +160,7 @@ int rl_completion_append_character = ' ' static History *h = NULL; static EditLine *e = NULL; -static Function *map[256]; +static rl_command_func_t *map[256]; static jmp_buf topbuf; /* internal functions */ @@ -362,6 +362,37 @@ rl_initialize(void) _el_rl_tstp); el_set(e, EL_BIND, "^Z", "rl_tstp", NULL); + /* + * Set some readline compatible key-bindings. + */ + el_set(e, EL_BIND, "^R", "em-inc-search-prev", NULL); + + /* + * Allow the use of Home/End keys. + */ + el_set(e, EL_BIND, "\\e[1~", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[4~", "ed-move-to-end", NULL); + el_set(e, EL_BIND, "\\e[7~", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[8~", "ed-move-to-end", NULL); + el_set(e, EL_BIND, "\\e[H", "ed-move-to-beg", NULL); + el_set(e, EL_BIND, "\\e[F", "ed-move-to-end", NULL); + + /* + * Allow the use of the Delete/Insert keys. + */ + el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL); + el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL); + + /* + * Ctrl-left-arrow and Ctrl-right-arrow for word moving. + */ + el_set(e, EL_BIND, "\\e[1;5C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL); + el_set(e, EL_BIND, "\\e[5C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e[5D", "ed-prev-word", NULL); + el_set(e, EL_BIND, "\\e\\e[C", "em-next-word", NULL); + el_set(e, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL); + /* read settings from configuration file */ el_source(e, NULL); @@ -948,7 +979,8 @@ loop: for (; str[j]; j++) { if (str[j] == '\\' && str[j + 1] == history_expansion_char) { - (void)strcpy(&str[j], &str[j + 1]); + len = strlen(&str[j + 1]) + 1; + memmove(&str[j], &str[j + 1], len); continue; } if (!loop_again) { @@ -1795,9 +1827,11 @@ rl_complete(int ignore __attribute__((__ else breakchars = rl_basic_word_break_characters; + _rl_update_pos(); + /* Just look at how many global variables modify this operation! */ return fn_complete(e, - (CPFunction *)rl_completion_entry_function, + (rl_compentry_func_t *)rl_completion_entry_function, rl_attempted_completion_function, ct_decode_string(rl_basic_word_break_characters, &wbreak_conv), ct_decode_string(breakchars, &sprefix_conv), @@ -1926,7 +1960,7 @@ rl_bind_wrapper(EditLine *el __attribute _rl_update_pos(); - (*map[c])(NULL, c); + (*map[c])(1, c); /* If rl_done was set by the above call, deal with it here */ if (rl_done) @@ -1936,7 +1970,7 @@ rl_bind_wrapper(EditLine *el __attribute } int -rl_add_defun(const char *name, Function *fun, int c) +rl_add_defun(const char *name, rl_command_func_t *fun, int c) { char dest[8]; if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0) @@ -1975,7 +2009,7 @@ rl_callback_read_char(void) } void -rl_callback_handler_install(const char *prompt, VCPFunction *linefunc) +rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc) { if (e == NULL) { rl_initialize(); Modified: vendor/NetBSD/libedit/dist/readline/readline.h ============================================================================== --- vendor/NetBSD/libedit/dist/readline/readline.h Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/readline/readline.h Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $ */ +/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -39,9 +39,8 @@ /* typedefs */ typedef int Function(const char *, int); typedef void VFunction(void); -typedef void VCPFunction(char *); -typedef char *CPFunction(const char *, int); -typedef char **CPPFunction(const char *, int, int); +typedef void rl_vcpfunc_t(char *); +typedef char **rl_completion_func_t(const char *, int, int); typedef char *rl_compentry_func_t(const char *, int); typedef int rl_command_func_t(int, int); @@ -108,9 +107,9 @@ extern int max_input_history; extern char *rl_basic_word_break_characters; extern char *rl_completer_word_break_characters; extern char *rl_completer_quote_characters; -extern Function *rl_completion_entry_function; +extern rl_compentry_func_t *rl_completion_entry_function; extern char *(*rl_completion_word_break_hook)(void); -extern CPPFunction *rl_attempted_completion_function; +extern rl_completion_func_t *rl_attempted_completion_function; extern int rl_attempted_completion_over; extern int rl_completion_type; extern int rl_completion_query_items; @@ -175,7 +174,7 @@ char *filename_completion_function(cons char *username_completion_function(const char *, int); int rl_complete(int, int); int rl_read_key(void); -char **completion_matches(const char *, CPFunction *); +char **completion_matches(const char *, rl_compentry_func_t *); void rl_display_match_list(char **, int, int); int rl_insert(int, int); @@ -184,7 +183,7 @@ void rl_reset_terminal(const char *); int rl_bind_key(int, rl_command_func_t *); int rl_newline(int, int); void rl_callback_read_char(void); -void rl_callback_handler_install(const char *, VCPFunction *); +void rl_callback_handler_install(const char *, rl_vcpfunc_t *); void rl_callback_handler_remove(void); void rl_redisplay(void); int rl_get_previous_history(int, int); @@ -194,7 +193,7 @@ int rl_read_init_file(const char *); int rl_parse_and_bind(const char *); int rl_variable_bind(const char *, const char *); void rl_stuff_char(int); -int rl_add_defun(const char *, Function *, int); +int rl_add_defun(const char *, rl_command_func_t *, int); HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); Modified: vendor/NetBSD/libedit/dist/search.c ============================================================================== --- vendor/NetBSD/libedit/dist/search.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/search.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $ */ +/* $NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: search.c,v 1.30 2011/10/04 15:27:04 christos Exp $"); +__RCSID("$NetBSD: search.c,v 1.31 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -147,7 +147,7 @@ el_match(const Char *str, const Char *pa if (re_comp(ct_encode_string(pat, &conv)) != NULL) return 0; else - return re_exec(ct_encode_string(str, &conv) == 1); + return re_exec(ct_encode_string(str, &conv)) == 1; #endif } Modified: vendor/NetBSD/libedit/dist/tokenizer.c ============================================================================== --- vendor/NetBSD/libedit/dist/tokenizer.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/tokenizer.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $ */ +/* $NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tokenizer.c,v 1.21 2011/08/16 16:25:15 christos Exp $"); +__RCSID("$NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -446,5 +446,5 @@ FUN(tok,str)(TYPE(Tokenizer) *tok, const memset(&li, 0, sizeof(li)); li.buffer = line; li.cursor = li.lastchar = Strchr(line, '\0'); - return FUN(tok,line(tok, &li, argc, argv, NULL, NULL)); + return FUN(tok,line)(tok, &li, argc, argv, NULL, NULL); } Modified: vendor/NetBSD/libedit/dist/tty.c ============================================================================== --- vendor/NetBSD/libedit/dist/tty.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/tty.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.46 2014/06/18 18:52:49 christos Exp $ */ +/* $NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tty.c,v 1.46 2014/06/18 18:52:49 christos Exp $"); +__RCSID("$NetBSD: tty.c,v 1.49 2015/12/08 16:53:27 gson Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -580,6 +580,9 @@ protected void /*ARGSUSED*/ tty_end(EditLine *el) { + if (el->el_flags & EDIT_DISABLED) + return; + if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, @@ -1171,8 +1174,8 @@ tty_stty(EditLine *el, int argc __attrib break; default: (void) fprintf(el->el_errfile, - "%s: Unknown switch `%c'.\n", - name, argv[0][1]); + "%s: Unknown switch `" FCHAR "'.\n", + name, (Int)argv[0][1]); return -1; } Modified: vendor/NetBSD/libedit/dist/vi.c ============================================================================== --- vendor/NetBSD/libedit/dist/vi.c Sun Feb 7 01:09:38 2016 (r295359) +++ vendor/NetBSD/libedit/dist/vi.c Sun Feb 7 01:38:50 2016 (r295360) @@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -1038,12 +1038,12 @@ vi_histedit(EditLine *el, Int c __attrib while (waitpid(pid, &status, 0) != pid) continue; lseek(fd, (off_t)0, SEEK_SET); - st = read(fd, cp, TMP_BUFSIZ); + st = read(fd, cp, TMP_BUFSIZ - 1); if (st > 0) { - len = (size_t)(el->el_line.lastchar - - el->el_line.buffer); + cp[st] = '\0'; + len = (size_t)(el->el_line.limit - el->el_line.buffer); len = ct_mbstowcs(el->el_line.buffer, cp, len); - if (len > 0 && el->el_line.buffer[len -1] == '\n') + if (len > 0 && el->el_line.buffer[len - 1] == '\n') --len; } else From owner-svn-src-vendor@freebsd.org Sun Feb 7 01:45:26 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29950AA0D40; Sun, 7 Feb 2016 01:45:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43DC1002; Sun, 7 Feb 2016 01:45:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u171jP87064802; Sun, 7 Feb 2016 01:45:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u171jOAV064797; Sun, 7 Feb 2016 01:45:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602070145.u171jOAV064797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 7 Feb 2016 01:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295361 - in vendor/NetBSD/libedit/2016-01-16: . readline X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 01:45:26 -0000 Author: pfg Date: Sun Feb 7 01:45:24 2016 New Revision: 295361 URL: https://svnweb.freebsd.org/changeset/base/295361 Log: Tag import of libedit 2016-01-16. Added: vendor/NetBSD/libedit/2016-01-16/ - copied from r295359, vendor/NetBSD/libedit/dist/ Replaced: vendor/NetBSD/libedit/2016-01-16/Makefile - copied unchanged from r295360, vendor/NetBSD/libedit/dist/Makefile vendor/NetBSD/libedit/2016-01-16/chartype.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/chartype.c vendor/NetBSD/libedit/2016-01-16/chartype.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/chartype.h vendor/NetBSD/libedit/2016-01-16/editline.3 - copied unchanged from r295360, vendor/NetBSD/libedit/dist/editline.3 vendor/NetBSD/libedit/2016-01-16/el.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/el.c vendor/NetBSD/libedit/2016-01-16/eln.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/eln.c vendor/NetBSD/libedit/2016-01-16/hist.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/hist.h vendor/NetBSD/libedit/2016-01-16/keymacro.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/keymacro.h vendor/NetBSD/libedit/2016-01-16/map.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/map.c vendor/NetBSD/libedit/2016-01-16/readline.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/readline.c vendor/NetBSD/libedit/2016-01-16/readline/readline.h - copied unchanged from r295360, vendor/NetBSD/libedit/dist/readline/readline.h vendor/NetBSD/libedit/2016-01-16/search.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/search.c vendor/NetBSD/libedit/2016-01-16/tokenizer.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/tokenizer.c vendor/NetBSD/libedit/2016-01-16/tty.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/tty.c vendor/NetBSD/libedit/2016-01-16/vi.c - copied unchanged from r295360, vendor/NetBSD/libedit/dist/vi.c Copied: vendor/NetBSD/libedit/2016-01-16/Makefile (from r295360, vendor/NetBSD/libedit/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/Makefile Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/Makefile) @@ -0,0 +1,135 @@ +# $NetBSD: Makefile,v 1.53 2015/01/29 20:30:02 joerg Exp $ +# @(#)Makefile 8.1 (Berkeley) 6/4/93 + +USE_SHLIBDIR= yes + +WIDECHAR ?= yes +WARNS?= 5 +LIB= edit + +LIBDPLIBS+= terminfo ${.CURDIR}/../libterminfo + +.include "bsd.own.mk" + +COPTS+= -Wunused-parameter +CWARNFLAGS.gcc+= -Wconversion +CWARNFLAGS.clang+= -Wno-cast-qual + +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c keymacro.c map.c chartype.c \ + parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c + +MAN= editline.3 editrc.5 + +MLINKS= editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \ + editline.3 el_gets.3 editline.3 el_getc.3 editline.3 el_push.3 \ + editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_get.3 \ + editline.3 el_source.3 editline.3 el_resize.3 editline.3 el_line.3 \ + editline.3 el_insertstr.3 editline.3 el_deletestr.3 \ + editline.3 history_init.3 editline.3 history_end.3 \ + editline.3 history.3 \ + editline.3 tok_init.3 editline.3 tok_end.3 editline.3 tok_reset.3 \ + editline.3 tok_line.3 editline.3 tok_str.3 + +# For speed and debugging +#SRCS= ${OSRCS} readline.c tokenizer.c history.c +# For protection +SRCS= editline.c readline.c tokenizer.c history.c + +.if ${WIDECHAR} == "yes" +OSRCS += eln.c +SRCS += tokenizern.c historyn.c +CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c +CPPFLAGS+=-DWIDECHAR +.endif + +LIBEDITDIR?=${.CURDIR} + +INCS= histedit.h +INCSDIR=/usr/include + +CLEANFILES+=editline.c +CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp +CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1 +CLEANFILES+=tokenizern.c.tmp tokenizern.c tokenizerw.c.tmp tokenizerw.c +CPPFLAGS+=-I. -I${LIBEDITDIR} +CPPFLAGS+=-I. -I${.CURDIR} +CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH +CPPFLAGS+=#-DDEBUG_PASTE -DDEBUG_EDIT + +AHDR=vi.h emacs.h common.h +ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c + +DPSRCS+= ${AHDR} fcns.h help.h fcns.c help.c +CLEANFILES+= ${AHDR} fcns.h help.h fcns.c help.c + +SUBDIR= readline + +vi.h: vi.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +emacs.h: emacs.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +common.h: common.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +fcns.h: ${AHDR} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +fcns.c: ${AHDR} fcns.h help.h makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +help.c: ${ASRC} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bc ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +help.h: ${ASRC} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +editline.c: ${OSRCS} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -e ${OSRCS:T} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +tokenizern.c: makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -n tokenizer.c > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +historyn.c: makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -n history.c > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +tc1.o: ${LIBEDITDIR}/TEST/tc1.c + +tc1: libedit.a tc1.o + ${_MKTARGET_LINK} + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermlib + +.include +.include + +# XXX +.if defined(HAVE_GCC) +COPTS.editline.c+= -Wno-cast-qual +COPTS.tokenizer.c+= -Wno-cast-qual +COPTS.tokenizern.c+= -Wno-cast-qual +.endif Copied: vendor/NetBSD/libedit/2016-01-16/chartype.c (from r295360, vendor/NetBSD/libedit/dist/chartype.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/chartype.c Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/chartype.c) @@ -0,0 +1,364 @@ +/* $NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * chartype.c: character classification and meta information + */ +#include "config.h" +#if !defined(lint) && !defined(SCCSID) +__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $"); +#endif /* not lint && not SCCSID */ +#include "el.h" +#include + +#define CT_BUFSIZ ((size_t)1024) + +#ifdef WIDECHAR +protected int +ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize) +{ + void *p; + + if (csize <= conv->csize) + return 0; + + conv->csize = csize; + + p = el_realloc(conv->cbuff, conv->csize * sizeof(*conv->cbuff)); + if (p == NULL) { + conv->csize = 0; + el_free(conv->cbuff); + conv->cbuff = NULL; + return -1; + } + conv->cbuff = p; + return 0; +} + +protected int +ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize) +{ + void *p; + + if (wsize <= conv->wsize) + return 0; + + conv->wsize = wsize; + + p = el_realloc(conv->wbuff, conv->wsize * sizeof(*conv->wbuff)); + if (p == NULL) { + conv->wsize = 0; + el_free(conv->wbuff); + conv->wbuff = NULL; + return -1; + } + conv->wbuff = p; + return 0; +} + + +public char * +ct_encode_string(const Char *s, ct_buffer_t *conv) +{ + char *dst; + ssize_t used; + + if (!s) + return NULL; + + dst = conv->cbuff; + for (;;) { + used = (ssize_t)(dst - conv->cbuff); + if ((conv->csize - (size_t)used) < 5) { + if (ct_conv_cbuff_resize(conv, + conv->csize + CT_BUFSIZ) == -1) + return NULL; + dst = conv->cbuff + used; + } + if (!*s) + break; + used = ct_encode_char(dst, (size_t)5, *s); + if (used == -1) /* failed to encode, need more buffer space */ + abort(); + ++s; + dst += used; + } + *dst = '\0'; + return conv->cbuff; +} + +public Char * +ct_decode_string(const char *s, ct_buffer_t *conv) +{ + size_t len; + + if (!s) + return NULL; + + len = ct_mbstowcs(NULL, s, (size_t)0); + if (len == (size_t)-1) + return NULL; + + if (conv->wsize < ++len) + if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1) + return NULL; + + ct_mbstowcs(conv->wbuff, s, conv->wsize); + return conv->wbuff; +} + + +protected Char ** +ct_decode_argv(int argc, const char *argv[], ct_buffer_t *conv) +{ + size_t bufspace; + int i; + Char *p; + Char **wargv; + ssize_t bytes; + + /* Make sure we have enough space in the conversion buffer to store all + * the argv strings. */ + for (i = 0, bufspace = 0; i < argc; ++i) + bufspace += argv[i] ? strlen(argv[i]) + 1 : 0; + if (conv->wsize < ++bufspace) + if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) + return NULL; + + wargv = el_malloc((size_t)argc * sizeof(*wargv)); + + for (i = 0, p = conv->wbuff; i < argc; ++i) { + if (!argv[i]) { /* don't pass null pointers to mbstowcs */ + wargv[i] = NULL; + continue; + } else { + wargv[i] = p; + bytes = (ssize_t)mbstowcs(p, argv[i], bufspace); + } + if (bytes == -1) { + el_free(wargv); + return NULL; + } else + bytes++; /* include '\0' in the count */ + bufspace -= (size_t)bytes; + p += bytes; + } + + return wargv; +} + + +protected size_t +ct_enc_width(Char c) +{ + /* UTF-8 encoding specific values */ + if (c < 0x80) + return 1; + else if (c < 0x0800) + return 2; + else if (c < 0x10000) + return 3; + else if (c < 0x110000) + return 4; + else + return 0; /* not a valid codepoint */ +} + +protected ssize_t +ct_encode_char(char *dst, size_t len, Char c) +{ + ssize_t l = 0; + if (len < ct_enc_width(c)) + return -1; + l = ct_wctomb(dst, c); + + if (l < 0) { + ct_wctomb_reset; + l = 0; + } + return l; +} +#endif + +protected const Char * +ct_visual_string(const Char *s) +{ + static Char *buff = NULL; + static size_t buffsize = 0; + void *p; + Char *dst; + ssize_t used = 0; + + if (!s) + return NULL; + if (!buff) { + buffsize = CT_BUFSIZ; + buff = el_malloc(buffsize * sizeof(*buff)); + } + dst = buff; + while (*s) { + used = ct_visual_char(dst, buffsize - (size_t)(dst - buff), *s); + if (used == -1) { /* failed to encode, need more buffer space */ + used = dst - buff; + buffsize += CT_BUFSIZ; + p = el_realloc(buff, buffsize * sizeof(*buff)); + if (p == NULL) + goto out; + buff = p; + dst = buff + used; + /* don't increment s here - we want to retry it! */ + } + else + ++s; + dst += used; + } + if (dst >= (buff + buffsize)) { /* sigh */ + buffsize += 1; + p = el_realloc(buff, buffsize * sizeof(*buff)); + if (p == NULL) + goto out; + buff = p; + dst = buff + buffsize - 1; + } + *dst = 0; + return buff; +out: + el_free(buff); + buffsize = 0; + return NULL; +} + + + +protected int +ct_visual_width(Char c) +{ + int t = ct_chr_class(c); + switch (t) { + case CHTYPE_ASCIICTL: + return 2; /* ^@ ^? etc. */ + case CHTYPE_TAB: + return 1; /* Hmm, this really need to be handled outside! */ + case CHTYPE_NL: + return 0; /* Should this be 1 instead? */ +#ifdef WIDECHAR + case CHTYPE_PRINT: + return wcwidth(c); + case CHTYPE_NONPRINT: + if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */ + return 8; /* \U+12345 */ + else + return 7; /* \U+1234 */ +#else + case CHTYPE_PRINT: + return 1; + case CHTYPE_NONPRINT: + return 4; /* \123 */ +#endif + default: + return 0; /* should not happen */ + } +} + + +protected ssize_t +ct_visual_char(Char *dst, size_t len, Char c) +{ + int t = ct_chr_class(c); + switch (t) { + case CHTYPE_TAB: + case CHTYPE_NL: + case CHTYPE_ASCIICTL: + if (len < 2) + return -1; /* insufficient space */ + *dst++ = '^'; + if (c == '\177') + *dst = '?'; /* DEL -> ^? */ + else + *dst = c | 0100; /* uncontrolify it */ + return 2; + case CHTYPE_PRINT: + if (len < 1) + return -1; /* insufficient space */ + *dst = c; + return 1; + case CHTYPE_NONPRINT: + /* we only use single-width glyphs for display, + * so this is right */ + if ((ssize_t)len < ct_visual_width(c)) + return -1; /* insufficient space */ +#ifdef WIDECHAR + *dst++ = '\\'; + *dst++ = 'U'; + *dst++ = '+'; +#define tohexdigit(v) "0123456789ABCDEF"[v] + if (c > 0xffff) /* prefer standard 4-byte display over 5-byte */ + *dst++ = tohexdigit(((unsigned int) c >> 16) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 12) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 8) & 0xf); + *dst++ = tohexdigit(((unsigned int) c >> 4) & 0xf); + *dst = tohexdigit(((unsigned int) c ) & 0xf); + return c > 0xffff ? 8 : 7; +#else + *dst++ = '\\'; +#define tooctaldigit(v) ((v) + '0') + *dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7); + *dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7); + *dst++ = tooctaldigit(((unsigned int) c ) & 0x7); +#endif + /*FALLTHROUGH*/ + /* these two should be handled outside this function */ + default: /* we should never hit the default */ + return 0; + } +} + + + + +protected int +ct_chr_class(Char c) +{ + if (c == '\t') + return CHTYPE_TAB; + else if (c == '\n') + return CHTYPE_NL; + else if (IsASCII(c) && Iscntrl(c)) + return CHTYPE_ASCIICTL; + else if (Isprint(c)) + return CHTYPE_PRINT; + else + return CHTYPE_NONPRINT; +} Copied: vendor/NetBSD/libedit/2016-01-16/chartype.h (from r295360, vendor/NetBSD/libedit/dist/chartype.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/chartype.h Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/chartype.h) @@ -0,0 +1,254 @@ +/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _h_chartype_f +#define _h_chartype_f + + + +#ifdef WIDECHAR + +/* Ideally we should also test the value of the define to see if it + * supports non-BMP code points without requiring UTF-16, but nothing + * seems to actually advertise this properly, despite Unicode 3.1 having + * been around since 2001... */ +#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) +#ifndef __STDC_ISO_10646__ +/* In many places it is assumed that the first 127 code points are ASCII + * compatible, so ensure wchar_t indeed does ISO 10646 and not some other + * funky encoding that could break us in weird and wonderful ways. */ + #error wchar_t must store ISO 10646 characters +#endif +#endif + +/* Oh for a with char32_t and __STDC_UTF_32__ in it... + * ref: ISO/IEC DTR 19769 + */ +#if WCHAR_MAX < INT32_MAX +#warning Build environment does not support non-BMP characters +#endif + +#define ct_mbtowc mbtowc +#define ct_mbtowc_reset mbtowc(0,0,(size_t)0) +#define ct_wctomb wctomb +#define ct_wctomb_reset wctomb(0,0) +#define ct_wcstombs wcstombs +#define ct_mbstowcs mbstowcs + +#define Char wchar_t +#define Int wint_t +#define FUN(prefix,rest) prefix ## _w ## rest +#define FUNW(type) type ## _w +#define TYPE(type) type ## W +#define FCHAR "%lc" +#define FSTR "%ls" +#define STR(x) L ## x +#define UC(c) c +#define Isalpha(x) iswalpha(x) +#define Isalnum(x) iswalnum(x) +#define Isgraph(x) iswgraph(x) +#define Isspace(x) iswspace(x) +#define Isdigit(x) iswdigit(x) +#define Iscntrl(x) iswcntrl(x) +#define Isprint(x) iswprint(x) + +#define Isupper(x) iswupper(x) +#define Islower(x) iswlower(x) +#define Toupper(x) towupper(x) +#define Tolower(x) towlower(x) + +#define IsASCII(x) (x < 0x100) + +#define Strlen(x) wcslen(x) +#define Strchr(s,c) wcschr(s,c) +#define Strrchr(s,c) wcsrchr(s,c) +#define Strstr(s,v) wcsstr(s,v) +#define Strdup(x) wcsdup(x) +#define Strcpy(d,s) wcscpy(d,s) +#define Strncpy(d,s,n) wcsncpy(d,s,n) +#define Strncat(d,s,n) wcsncat(d,s,n) + +#define Strcmp(s,v) wcscmp(s,v) +#define Strncmp(s,v,n) wcsncmp(s,v,n) +#define Strcspn(s,r) wcscspn(s,r) + +#define Strtol(p,e,b) wcstol(p,e,b) + +static inline int +Width(wchar_t c) +{ + int w = wcwidth(c); + return w < 0 ? 0 : w; +} + +#else /* NARROW */ + +#define ct_mbtowc error +#define ct_mbtowc_reset +#define ct_wctomb error +#define ct_wctomb_reset +#define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a)) +#define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a)) + +#define Char char +#define Int int +#define FUN(prefix,rest) prefix ## _ ## rest +#define FUNW(type) type +#define TYPE(type) type +#define FCHAR "%c" +#define FSTR "%s" +#define STR(x) x +#define UC(c) (unsigned char)(c) + +#define Isalpha(x) isalpha((unsigned char)x) +#define Isalnum(x) isalnum((unsigned char)x) +#define Isgraph(x) isgraph((unsigned char)x) +#define Isspace(x) isspace((unsigned char)x) +#define Isdigit(x) isdigit((unsigned char)x) +#define Iscntrl(x) iscntrl((unsigned char)x) +#define Isprint(x) isprint((unsigned char)x) + +#define Isupper(x) isupper((unsigned char)x) +#define Islower(x) islower((unsigned char)x) +#define Toupper(x) toupper((unsigned char)x) +#define Tolower(x) tolower((unsigned char)x) + +#define IsASCII(x) isascii((unsigned char)x) + +#define Strlen(x) strlen(x) +#define Strchr(s,c) strchr(s,c) +#define Strrchr(s,c) strrchr(s,c) +#define Strstr(s,v) strstr(s,v) +#define Strdup(x) strdup(x) +#define Strcpy(d,s) strcpy(d,s) +#define Strncpy(d,s,n) strncpy(d,s,n) +#define Strncat(d,s,n) strncat(d,s,n) + +#define Strcmp(s,v) strcmp(s,v) +#define Strncmp(s,v,n) strncmp(s,v,n) +#define Strcspn(s,r) strcspn(s,r) + +#define Strtol(p,e,b) strtol(p,e,b) + +#define Width(c) 1 + +#endif + + +#ifdef WIDECHAR +/* + * Conversion buffer + */ +typedef struct ct_buffer_t { + char *cbuff; + size_t csize; + Char *wbuff; + size_t wsize; +} ct_buffer_t; + +#define ct_encode_string __ct_encode_string +/* Encode a wide-character string and return the UTF-8 encoded result. */ +public char *ct_encode_string(const Char *, ct_buffer_t *); + +#define ct_decode_string __ct_decode_string +/* Decode a (multi)?byte string and return the wide-character string result. */ +public Char *ct_decode_string(const char *, ct_buffer_t *); + +/* Decode a (multi)?byte argv string array. + * The pointer returned must be free()d when done. */ +protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *); + +/* Resizes the conversion buffer(s) if needed. */ +protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t); +protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t); +protected ssize_t ct_encode_char(char *, size_t, Char); +protected size_t ct_enc_width(Char); + +#define ct_free_argv(s) el_free(s) + +#else +#define ct_encode_string(s, b) (s) +#define ct_decode_string(s, b) (s) +#define ct_decode_argv(l, s, b) (s) +#define ct_conv_cbuff_resize(b, s) ((s) == (0)) +#define ct_conv_wbuff_resize(b, s) ((s) == (0)) +#define ct_encode_char(d, l, s) (*d = s, 1) +#define ct_free_argv(s) +#endif + +#ifndef NARROWCHAR +/* Encode a characted into the destination buffer, provided there is sufficent + * buffer space available. Returns the number of bytes used up (zero if the + * character cannot be encoded, -1 if there was not enough space available). */ + +/* The maximum buffer size to hold the most unwieldly visual representation, + * in this case \U+nnnnn. */ +#define VISUAL_WIDTH_MAX ((size_t)8) + +/* The terminal is thought of in terms of X columns by Y lines. In the cases + * where a wide character takes up more than one column, the adjacent + * occupied column entries will contain this faux character. */ +#define MB_FILL_CHAR ((Char)-1) + +/* Visual width of character c, taking into account ^? , \0177 and \U+nnnnn + * style visual expansions. */ +protected int ct_visual_width(Char); + +/* Turn the given character into the appropriate visual format, matching + * the width given by ct_visual_width(). Returns the number of characters used + * up, or -1 if insufficient space. Buffer length is in count of Char's. */ +protected ssize_t ct_visual_char(Char *, size_t, Char); + +/* Convert the given string into visual format, using the ct_visual_char() + * function. Uses a static buffer, so not threadsafe. */ +protected const Char *ct_visual_string(const Char *); + + +/* printable character, use ct_visual_width() to find out display width */ +#define CHTYPE_PRINT ( 0) +/* control character found inside the ASCII portion of the charset */ +#define CHTYPE_ASCIICTL (-1) +/* a \t */ +#define CHTYPE_TAB (-2) +/* a \n */ +#define CHTYPE_NL (-3) +/* non-printable character */ +#define CHTYPE_NONPRINT (-4) +/* classification of character c, as one of the above defines */ +protected int ct_chr_class(Char c); +#endif + + +#endif /* _chartype_f */ Copied: vendor/NetBSD/libedit/2016-01-16/editline.3 (from r295360, vendor/NetBSD/libedit/dist/editline.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libedit/2016-01-16/editline.3 Sun Feb 7 01:45:24 2016 (r295361, copy of r295360, vendor/NetBSD/libedit/dist/editline.3) @@ -0,0 +1,937 @@ +.\" $NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $ +.\" +.\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This file was contributed to The NetBSD Foundation by Luke Mewburn. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 3, 2015 +.Dt EDITLINE 3 +.Os +.Sh NAME +.Nm editline , +.Nm el_init , +.Nm el_init_fd , +.Nm el_end , +.Nm el_reset , +.Nm el_gets , +.Nm el_wgets , +.Nm el_getc , +.Nm el_wgetc , +.Nm el_push , +.Nm el_wpush , +.Nm el_parse , +.Nm el_wparse , +.Nm el_set , +.Nm el_wset , +.Nm el_get , +.Nm el_wget , +.Nm el_source , +.Nm el_resize , +.Nm el_cursor , +.Nm el_line , +.Nm el_wline , +.Nm el_insertstr , +.Nm el_winsertstr , +.Nm el_deletestr , +.Nm el_wdeletestr , +.Nm history_init , +.Nm history_winit , +.Nm history_end , +.Nm history_wend , +.Nm history , +.Nm history_w , +.Nm tok_init , +.Nm tok_winit , +.Nm tok_end , +.Nm tok_wend , +.Nm tok_reset , +.Nm tok_wreset , +.Nm tok_line , +.Nm tok_wline , +.Nm tok_str +.Nm tok_wstr +.Nd line editor, history and tokenization functions +.Sh LIBRARY +.Lb libedit +.Sh SYNOPSIS +.In histedit.h +.Ft EditLine * +.Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr" +.Ft EditLine * +.Fn el_init_fd "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr" "int fdin" "int fdout" "int fderr" +.Ft void +.Fn el_end "EditLine *e" +.Ft void +.Fn el_reset "EditLine *e" +.Ft const char * +.Fn el_gets "EditLine *e" "int *count" +.Ft const wchar_t * +.Fn el_wgets "EditLine *e" "int *count" +.Ft int +.Fn el_getc "EditLine *e" "char *ch" +.Ft int +.Fn el_wgetc "EditLine *e" "wchar_t *ch" +.Ft void +.Fn el_push "EditLine *e" "const char *str" +.Ft void +.Fn el_wpush "EditLine *e" "const wchar_t *str" +.Ft int +.Fn el_parse "EditLine *e" "int argc" "const char *argv[]" +.Ft int +.Fn el_wparse "EditLine *e" "int argc" "const wchar_t *argv[]" +.Ft int +.Fn el_set "EditLine *e" "int op" "..." +.Ft int +.Fn el_wset "EditLine *e" "int op" "..." +.Ft int +.Fn el_get "EditLine *e" "int op" "..." +.Ft int +.Fn el_wget "EditLine *e" "int op" "..." +.Ft int +.Fn el_source "EditLine *e" "const char *file" +.Ft void +.Fn el_resize "EditLine *e" +.Fn int +.Fn el_cursor "EditLine *e" "int count" +.Ft const LineInfo * +.Fn el_line "EditLine *e" +.Ft const LineInfoW * +.Fn el_wline "EditLine *e" +.Ft int +.Fn el_insertstr "EditLine *e" "const char *str" +.Ft int +.Fn el_winsertstr "EditLine *e" "const wchar_t *str" +.Ft void +.Fn el_deletestr "EditLine *e" "int count" +.Ft void +.Fn el_wdeletestr "EditLine *e" "int count" +.Ft History * +.Fn history_init +.Ft HistoryW * +.Fn history_winit +.Ft void +.Fn history_end "History *h" +.Ft void +.Fn history_wend "HistoryW *h" +.Ft int +.Fn history "History *h" "HistEvent *ev" "int op" "..." +.Ft int +.Fn history_w "HistoryW *h" "HistEventW *ev" "int op" "..." +.Ft Tokenizer * +.Fn tok_init "const char *IFS" +.Ft TokenizerW * +.Fn tok_winit "const wchar_t *IFS" +.Ft void +.Fn tok_end "Tokenizer *t" +.Ft void +.Fn tok_wend "TokenizerW *t" +.Ft void +.Fn tok_reset "Tokenizer *t" +.Ft void +.Fn tok_wreset "TokenizerW *t" +.Ft int +.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro" +.Ft int +.Fn tok_wline "TokenizerW *t" "const LineInfoW *li" "int *argc" "const wchar_t **argv[]" "int *cursorc" "int *cursoro" +.Ft int +.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]" +.Ft int +.Fn tok_wstr "TokenizerW *t" "const wchar_t *str" "int *argc" "const wchar_t **argv[]" +.Sh DESCRIPTION +The +.Nm +library provides generic line editing, history and tokenization functions, +similar to those found in +.Xr sh 1 . +.Pp +These functions are available in the +.Nm libedit +library (which needs the +.Nm libtermcap +library). +Programs should be linked with +.Fl ledit ltermcap . +.Sh LINE EDITING FUNCTIONS +The line editing functions use a common data structure, +.Fa EditLine , +which is created by +.Fn el_init +or +.Fn el_init_fd +and freed by +.Fn el_end . +.Pp +The wide-character functions behave the same way as their narrow +counterparts. +.Pp +The following functions are available: +.Bl -tag -width 4n +.It Fn el_init +Initialize the line editor, and return a data structure +to be used by all other line editing functions, or +.Dv NULL +on failure. +.Fa prog +is the name of the invoking program, used when reading the +.Xr editrc 5 +file to determine which settings to use. +.Fa fin , +.Fa fout +and +.Fa ferr +are the input, output, and error streams (respectively) to use. +In this documentation, references to +.Dq the tty +are actually to this input/output stream combination. +.It Fn el_init_fd +Like +.Fn el_init +but allows specifying file descriptors for the +.Xr stdio 3 +corresponding streams, in case those were created with +.Xr funopen 3 . +.It Fn el_end +Clean up and finish with +.Fa e , +assumed to have been created with +.Fn el_init +or +.Fn el_init_fd . +.It Fn el_reset +Reset the tty and the parser. +This should be called after an error which may have upset the tty's +state. +.It Fn el_gets +Read a line from the tty. +.Fa count +is modified to contain the number of characters read. +Returns the line read if successful, or +.Dv NULL +if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Feb 10 19:39:39 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85480AA43F3; Wed, 10 Feb 2016 19:39:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40DB41217; Wed, 10 Feb 2016 19:39:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJdct5063458; Wed, 10 Feb 2016 19:39:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AJdaR7063441; Wed, 10 Feb 2016 19:39:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602101939.u1AJdaR7063441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Feb 2016 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295484 - in vendor/elftoolchain/dist: . addr2line ar brandelf common cxxfilt elfcopy elfdump findtextrel ld libdwarf libelftc libpe mk nm readelf size strings test/ar/plugin test/ar/tc... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:39:39 -0000 Author: emaste Date: Wed Feb 10 19:39:36 2016 New Revision: 295484 URL: https://svnweb.freebsd.org/changeset/base/295484 Log: Import ELF Tool Chain snapshot revision 3395 This is close to the upcoming 0.7.1 release. From http://svn.code.sf.net/p/elftoolchain/code Added: vendor/elftoolchain/dist/addr2line/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/elfcopy/pe.c (contents, props changed) vendor/elftoolchain/dist/elfdump/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/ld/bigmips_script.ld vendor/elftoolchain/dist/ld/littlemips_script.ld vendor/elftoolchain/dist/ld/mips.c (contents, props changed) vendor/elftoolchain/dist/ld/mips.h (contents, props changed) vendor/elftoolchain/dist/libdwarf/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libelftc/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libpe/ vendor/elftoolchain/dist/libpe/Makefile (contents, props changed) vendor/elftoolchain/dist/libpe/_libpe.h (contents, props changed) vendor/elftoolchain/dist/libpe/libpe.h (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_buffer.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_coff.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_dos.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_init.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_rich.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_section.c (contents, props changed) vendor/elftoolchain/dist/libpe/libpe_utils.c (contents, props changed) vendor/elftoolchain/dist/libpe/os.Linux.mk (contents, props changed) vendor/elftoolchain/dist/libpe/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/libpe/pe.h (contents, props changed) vendor/elftoolchain/dist/libpe/pe_buffer.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_cntl.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_coff.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_dos.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_flag.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_init.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_rich.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_section.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_symtab.c (contents, props changed) vendor/elftoolchain/dist/libpe/pe_update.c (contents, props changed) vendor/elftoolchain/dist/mk/elftoolchain.components.mk (contents, props changed) vendor/elftoolchain/dist/nm/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/readelf/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/size/os.NetBSD.mk (contents, props changed) vendor/elftoolchain/dist/strings/os.NetBSD.mk (contents, props changed) Deleted: vendor/elftoolchain/dist/libelftc/elftc_symbol_table_create.3 Modified: vendor/elftoolchain/dist/INSTALL vendor/elftoolchain/dist/Makefile vendor/elftoolchain/dist/RELEASE-NOTES vendor/elftoolchain/dist/addr2line/addr2line.c vendor/elftoolchain/dist/ar/ar.c vendor/elftoolchain/dist/brandelf/brandelf.c vendor/elftoolchain/dist/common/elfdefinitions.h vendor/elftoolchain/dist/common/native-elf-format vendor/elftoolchain/dist/cxxfilt/cxxfilt.c vendor/elftoolchain/dist/elfcopy/Makefile vendor/elftoolchain/dist/elfcopy/archive.c vendor/elftoolchain/dist/elfcopy/elfcopy.1 vendor/elftoolchain/dist/elfcopy/elfcopy.h vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/sections.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/elfcopy/symbols.c vendor/elftoolchain/dist/elfdump/elfdump.c vendor/elftoolchain/dist/findtextrel/findtextrel.c vendor/elftoolchain/dist/ld/Makefile vendor/elftoolchain/dist/ld/amd64.c vendor/elftoolchain/dist/ld/i386.c vendor/elftoolchain/dist/ld/ld_arch.c vendor/elftoolchain/dist/ld/ld_arch.h vendor/elftoolchain/dist/ld/ld_dynamic.c vendor/elftoolchain/dist/ld/ld_exp.c vendor/elftoolchain/dist/ld/ld_file.c vendor/elftoolchain/dist/ld/ld_layout.c vendor/elftoolchain/dist/ld/ld_output.c vendor/elftoolchain/dist/ld/ld_script.c vendor/elftoolchain/dist/ld/ld_script.h vendor/elftoolchain/dist/ld/ld_script_lexer.l vendor/elftoolchain/dist/ld/ld_script_parser.y vendor/elftoolchain/dist/ld/ld_strtab.c vendor/elftoolchain/dist/ld/ld_symbols.c vendor/elftoolchain/dist/libdwarf/_libdwarf.h vendor/elftoolchain/dist/libdwarf/dwarf.3 vendor/elftoolchain/dist/libdwarf/dwarf_str.c vendor/elftoolchain/dist/libdwarf/libdwarf.h vendor/elftoolchain/dist/libdwarf/libdwarf_rw.c vendor/elftoolchain/dist/libelftc/Makefile vendor/elftoolchain/dist/libelftc/elftc_bfd_find_target.3 vendor/elftoolchain/dist/libelftc/elftc_copyfile.c vendor/elftoolchain/dist/libelftc/elftc_demangle.c vendor/elftoolchain/dist/libelftc/libelftc.h vendor/elftoolchain/dist/libelftc/libelftc_bfdtarget.c vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu3.c vendor/elftoolchain/dist/libelftc/make-toolchain-version vendor/elftoolchain/dist/mk/elftoolchain.prog.mk vendor/elftoolchain/dist/readelf/readelf.c vendor/elftoolchain/dist/strings/strings.1 vendor/elftoolchain/dist/strings/strings.c vendor/elftoolchain/dist/test/ar/plugin/Makefile vendor/elftoolchain/dist/test/ar/plugin/ardiff.c vendor/elftoolchain/dist/test/ar/plugin/teraser.c vendor/elftoolchain/dist/test/ar/tc/usage-bi/usage-bi.err vendor/elftoolchain/dist/test/elfcopy/plugin/Makefile vendor/elftoolchain/dist/test/elfcopy/plugin/ardiff.c vendor/elftoolchain/dist/test/elfcopy/plugin/teraser.c vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-L-1/out/elfcopy-L-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-L-2/out/elfcopy-L-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-N-1/out/elfcopy-N-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-N-2/out/elfcopy-N-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-1/out/elfcopy-noops-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-2/out/elfcopy-noops-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-3/out/elfcopy-noops-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-4/out/elfcopy-noops-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-5/out/elfcopy-noops-5.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-6/out/elfcopy-noops-6.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-7/out/elfcopy-noops-7.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-archive-1/out/elfcopy-noops-archive-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-noops-archive-2/out/elfcopy-noops-archive-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/elfcopy-rename-1/out/elfcopy-rename-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-K-2/out/strip-K-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-1/out/strip-all-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-10/out/strip-all-10.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-2/out/strip-all-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-3/out/strip-all-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-4/out/strip-all-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-5/out/strip-all-5.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-6/out/strip-all-6.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-7/out/strip-all-7.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-8/out/strip-all-8.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-9/out/strip-all-9.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-archive-1/out/strip-all-archive-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-all-archive-2/out/strip-all-archive-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-1/out/strip-debug-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-2/out/strip-debug-2.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-3/out/strip-debug-3.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-debug-4/out/strip-debug-4.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-onlydebug-1/out/strip-onlydebug-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-unneeded-1/out/strip-unneeded-1.out.shar vendor/elftoolchain/dist/test/elfcopy/tc/strip-unneeded-2/out/strip-unneeded-2.out.shar vendor/elftoolchain/dist/test/elfdump/ts/dso1/@G%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@G%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@r%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@G%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@G%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@r%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@i%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@p@c%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@G%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@G@e%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@G%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@r%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@r@N%.rela.dyn@N%.rela.plt%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@G%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@G@e%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@G%cp.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@r%cp.out vendor/elftoolchain/dist/test/libdwarf/ts/Makefile.tset Modified: vendor/elftoolchain/dist/INSTALL ============================================================================== --- vendor/elftoolchain/dist/INSTALL Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/INSTALL Wed Feb 10 19:39:36 2016 (r295484) @@ -14,13 +14,11 @@ operating systems. Operating System Version Supported Architectures ----------------- -------- ----------------------- `DragonFly BSD`_ 2.10.1 i386 - FreeBSD_ v8.2 amd64 & i386 - FreeBSD_ v10.1 i386 + FreeBSD_ 10.2 amd64 & i386 Minix_ 3.0.2 i386 - NetBSD_ v5.0.2 i386 + NetBSD_ 7.0 i386 OpenBSD_ v5.0 i386 - Ubuntu_ GNU/Linux 10.04LTS i386 & x86_64 - Ubuntu_ GNU/Linux 12.04LTS i386 & x86_64 + Ubuntu_ GNU/Linux 14.04LTS x86_64 ================= ======== ======================= .. _DragonFly BSD: http://www.dragonflybsd.org/ @@ -35,9 +33,9 @@ Building the Source Tree The core libraries and utilities that make up the software release are always built by default. Builds of the project's test suites (in the -``test/`` subdirectory), and of additional documentation (in the -directory ``documentation/``) are optional and will only be attempted -if these directories are present. +``test/`` subdirectory), and of additional documentation (in the directory +``documentation/``) are optional, and will only be attempted if these +directories are present. Prerequisites ------------- @@ -58,39 +56,24 @@ Prerequisites - Building additional documentation is not currently supported under DragonFly BSD. -:FreeBSD 8.2: +:FreeBSD 10.2: - The core libraries and utilities should build out of the box on a stock install of FreeBSD. - To build and run the test suite: #. The current release of the `Test Execution Toolkit`_ needs to - be downloaded and unpacked into the ``test/tet/`` directory. - - #. The ``py-yaml`` package needs to be installed:: + be downloaded and unpacked into the ``test/tet/`` directory:: - % sudo pkg_add -r py-yaml - - - To build additional documentation, the ``latex-pgf`` package is - needed:: - - % sudo pkg_add -r latex-pgf - -:FreeBSD 10.1: - - The core libraries and utilities should build out of the box on - a stock install of FreeBSD. - - - To build and run the test suite: - - #. The current release of the `Test Execution Toolkit`_ needs to - be downloaded and unpacked into the ``test/tet/`` directory. + % cd /test/tet + % tar -xf /PATH/TO/DOWNLOADED/TET-3.8-SOURCES #. The ``python`` and ``py27-yaml`` packages need to be installed:: % sudo pkg install python py27-yaml - Building additional documentation is not currently supported under - FreeBSD 10.1. + FreeBSD 10.2. :Minix 3.2.0: - The following packages are pre-requisites for building the @@ -152,9 +135,20 @@ Prerequisites - Building additional documentation is not currently supported under OpenBSD. -:NetBSD 5.0.2: - - The core libraries and utilities should build out of the box - on a stock install of NetBSD. +:NetBSD 7.0: + - The following packages are pre-requisites for building the + sources on NetBSD 7.0: + + =================== ===================================== + **Package** **Description** + =================== ===================================== + ``libarchive`` An archive access library. + =================== ===================================== + + The following command line may be used to install the necessary + pre-requisites:: + + # pkg_add libarchive - To build and run the test suite: @@ -165,7 +159,7 @@ Prerequisites #. The following additional package needs to be installed, as listed in the example command line below :: - % sudo pkg_add py26-yaml + % sudo pkg_add py27-yaml - Building additional documentation is not currently supported under NetBSD. @@ -213,9 +207,9 @@ Prerequisites % sudo apt-get install pgf -:Ubuntu GNU/Linux 12.04: +:Ubuntu GNU/Linux 14.04: - The following packages are pre-requisites for building the - sources on Ubuntu GNU/Linux 12.04: + sources on Ubuntu GNU/Linux 14.04: =================== ===================================== **Package** **Description** @@ -226,7 +220,7 @@ Prerequisites ``libarchive-dev`` Archive access library. ``libexpat1-dev`` An XML processing library. ``m4`` Macro processor. - ``pmake`` A ``make`` that uses BSD-make syntax. + ``bmake`` NetBSD ``make``. ``python-yaml`` A YAML library for Python. ``sharutils`` For ``uudecode``. ``zlib1g-dev`` Compression library. @@ -236,7 +230,7 @@ Prerequisites pre-requisites:: % sudo apt-get install bison build-essential flex libarchive-dev \ - m4 pmake zlib1g-dev + m4 bmake zlib1g-dev - To build and run the test suite: @@ -250,7 +244,7 @@ Prerequisites % sudo apt-get install libexpat1-dev python-yaml sharutils - Builds of additional documentation are not currently supported - under Ubuntu GNU/Linux 12.04. + under Ubuntu GNU/Linux 14.04. .. _Test Execution Toolkit: http://tetworks.opengroup.org/ .. _OpenGroup: http://www.opengroup.org/ @@ -316,7 +310,7 @@ website`_. .. _project website: http://elftoolchain.sourceforge.net/ -.. $Id: INSTALL 3193 2015-05-04 17:47:14Z jkoshy $ +.. $Id: INSTALL 3353 2016-01-18 21:50:13Z jkoshy $ .. Local Variables: .. mode: rst Modified: vendor/elftoolchain/dist/Makefile ============================================================================== --- vendor/elftoolchain/dist/Makefile Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/Makefile Wed Feb 10 19:39:36 2016 (r295484) @@ -1,7 +1,8 @@ -# $Id: Makefile 3016 2014-04-10 16:01:42Z jkoshy $ +# $Id: Makefile 3382 2016-01-31 12:31:08Z jkoshy $ TOP= . +.include "${TOP}/mk/elftoolchain.components.mk" .include "${TOP}/mk/elftoolchain.os.mk" # Build configuration information first. @@ -13,10 +14,14 @@ SUBDIR += libdwarf # Build additional APIs. SUBDIR += libelftc +.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +SUBDIR += libpe +.endif -# Build the tools needed for the rest of the build. - -# SUBDIR += isa # ('isa' does not build on all platforms yet). +# The instruction set analyser. +.if defined(WITH_ISA) && ${WITH_ISA:tl} == "yes" +SUBDIR += isa # ('isa' does not build on all platforms yet). +.endif # Build tools after the libraries. SUBDIR += addr2line @@ -26,6 +31,7 @@ SUBDIR += cxxfilt SUBDIR += elfcopy SUBDIR += elfdump SUBDIR += findtextrel +SUBDIR += ld SUBDIR += nm SUBDIR += readelf SUBDIR += size @@ -33,12 +39,18 @@ SUBDIR += strings SUBDIR += tools # Build the test suites. -.if exists(${.CURDIR}/test) && defined(MKTESTS) && ${MKTESTS} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" SUBDIR += test .endif +# Build additional build tooling. +.if defined(WITH_BUILD_TOOLS) && ${WITH_BUILD_TOOLS:tl} == "yes" +SUBDIR += tools +.endif + # Build documentation at the end. -.if exists(${.CURDIR}/documentation) && defined(MKDOC) && ${MKDOC} == "yes" +.if exists(${.CURDIR}/documentation) && defined(WITH_DOCUMENTATION) && \ + ${WITH_DOCUMENTATION:tl} == "yes" SUBDIR += documentation .endif @@ -49,7 +61,7 @@ SUBDIR += documentation # # Run the test suites. -.if exists(${.CURDIR}/test) && defined(MKTESTS) && ${MKTESTS} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" run-tests: all .PHONY (cd ${.CURDIR}/test; ${MAKE} test) .endif Modified: vendor/elftoolchain/dist/RELEASE-NOTES ============================================================================== --- vendor/elftoolchain/dist/RELEASE-NOTES Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/RELEASE-NOTES Wed Feb 10 19:39:36 2016 (r295484) @@ -1,4 +1,4 @@ -.. $Id: RELEASE-NOTES 2599 2012-09-25 06:25:51Z jkoshy $ +.. $Id: RELEASE-NOTES 3353 2016-01-18 21:50:13Z jkoshy $ .. This file contains a template for use when writing release notes. .. It needs to be updated with release-specific content prior to @@ -96,11 +96,11 @@ systems: **Operating System** **Version** **Supported Architectures** -------------------- ----------- --------------------------- `DragonFly BSD`_ 2.10.1 i386 - FreeBSD_ v8.2 amd64 & i386 + FreeBSD_ 10.2 amd64 & i386 Minix_ 3.2.0 i386 - NetBSD_ v5.0.2 i386 + NetBSD_ 7.0 i386 OpenBSD_ v5.0 i386 - Ubuntu_ GNU/Linux 10.04LTS i386 & x86_64 + Ubuntu_ GNU/Linux 14.04LTS x86_64 ==================== =========== =========================== Modified: vendor/elftoolchain/dist/addr2line/addr2line.c ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/addr2line/addr2line.c Wed Feb 10 19:39:36 2016 (r295484) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $"); struct Func { char *name; @@ -368,7 +368,8 @@ print_inlines(struct CU *cu, struct Func printf("%s\n", f->name); } } - (void) printf("%s:%ju\n", base ? basename(file) : file, call_line); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) call_line); if (f->inlined_caller != NULL) print_inlines(cu, f->inlined_caller, f->call_file, @@ -562,7 +563,8 @@ out: } } - (void) printf("%s:%ju\n", base ? basename(file) : file, lineno); + (void) printf("%s:%ju\n", base ? basename(file) : file, + (uintmax_t) lineno); if (ret == DW_DLV_OK && inlines && cu != NULL && cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) Added: vendor/elftoolchain/dist/addr2line/os.NetBSD.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/elftoolchain/dist/addr2line/os.NetBSD.mk Wed Feb 10 19:39:36 2016 (r295484) @@ -0,0 +1,2 @@ +# TODO(#511): Revert after the source tree is -Wconversion clean. +WARNS=5 Modified: vendor/elftoolchain/dist/ar/ar.c ============================================================================== --- vendor/elftoolchain/dist/ar/ar.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/ar/ar.c Wed Feb 10 19:39:36 2016 (r295484) @@ -72,7 +72,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: ar.c 3243 2015-08-31 19:28:45Z emaste $"); +ELFTC_VCSID("$Id: ar.c 3319 2016-01-13 21:37:53Z jkoshy $"); enum options { @@ -407,7 +407,7 @@ Usage: %s [options] archive fi -F FORMAT | --flavor=FORMAT\n\ Create archives with the specified format.\n\ -S Do not generate an archive symbol table.\n\ - -U Use original metadata, for unique archive checksums.\n" + -U Use original metadata for archive members.\n" static void bsdar_usage(void) Modified: vendor/elftoolchain/dist/brandelf/brandelf.c ============================================================================== --- vendor/elftoolchain/dist/brandelf/brandelf.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/brandelf/brandelf.c Wed Feb 10 19:39:36 2016 (r295484) @@ -44,7 +44,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: brandelf.c 3234 2015-07-31 12:35:09Z emaste $"); +ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $"); static int elftype(const char *); static const char *iselftype(int); @@ -212,7 +212,7 @@ main(int argc, char **argv) /* * Update the ABI type. */ - ehdr.e_ident[EI_OSABI] = type; + ehdr.e_ident[EI_OSABI] = (unsigned char) type; if (gelf_update_ehdr(elf, &ehdr) == 0) { warnx("gelf_update_ehdr error: %s", elf_errmsg(-1)); Modified: vendor/elftoolchain/dist/common/elfdefinitions.h ============================================================================== --- vendor/elftoolchain/dist/common/elfdefinitions.h Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/common/elfdefinitions.h Wed Feb 10 19:39:36 2016 (r295484) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $ + * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $ */ /* @@ -1228,6 +1228,7 @@ _ELF_DEFINE_STB(STB_GLOBAL, 1, _ELF_DEFINE_STB(STB_WEAK, 2, \ "visible across all object files but with low precedence") \ _ELF_DEFINE_STB(STB_LOOS, 10, "start of OS-specific range") \ +_ELF_DEFINE_STB(STB_GNU_UNIQUE, 10, "unique symbol (GNU)") \ _ELF_DEFINE_STB(STB_HIOS, 12, "end of OS-specific range") \ _ELF_DEFINE_STB(STB_LOPROC, 13, \ "start of processor-specific range") \ @@ -1259,6 +1260,7 @@ _ELF_DEFINE_STT(STT_LOPROC, 13, "start of processor-specific types") \ _ELF_DEFINE_STT(STT_ARM_TFUNC, 13, "Thumb function (GNU)") \ _ELF_DEFINE_STT(STT_ARM_16BIT, 15, "Thumb label (GNU)") \ +_ELF_DEFINE_STT(STT_SPARC_REGISTER, 13, "SPARC register information") \ _ELF_DEFINE_STT(STT_HIPROC, 15, \ "end of processor-specific types") @@ -1395,7 +1397,7 @@ _ELF_DEFINE_RELOC(R_386_GOT32, 3) \ _ELF_DEFINE_RELOC(R_386_PLT32, 4) \ _ELF_DEFINE_RELOC(R_386_COPY, 5) \ _ELF_DEFINE_RELOC(R_386_GLOB_DAT, 6) \ -_ELF_DEFINE_RELOC(R_386_JMP_SLOT, 7) \ +_ELF_DEFINE_RELOC(R_386_JUMP_SLOT, 7) \ _ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \ _ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \ _ELF_DEFINE_RELOC(R_386_GOTPC, 10) \ @@ -1407,9 +1409,129 @@ _ELF_DEFINE_RELOC(R_386_PC8, 23) /* */ -#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ -_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_AARCH64_NONE, 0) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS16, 259) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL64, 260) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL32, 261) \ +_ELF_DEFINE_RELOC(R_AARCH64_PREL16, 262) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0, 263) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 264) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1, 265) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1_NC, 266) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2, 267) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2_NC, 268) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G3, 269) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G0, 270) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G1, 271) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G2, 272) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD_PREL_LO19, 273) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_LO21, 274) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21, 275) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21_NC, 276) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADD_ABS_LO12_NC, 277) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST8_ABS_LO12_NC, 278) \ +_ELF_DEFINE_RELOC(R_AARCH64_TSTBR14, 279) \ +_ELF_DEFINE_RELOC(R_AARCH64_CONDBR19, 280) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP26, 282) \ +_ELF_DEFINE_RELOC(R_AARCH64_CALL26, 283) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST16_ABS_LO12_NC, 284) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST32_ABS_LO12_NC, 285) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST64_ABS_LO12_NC, 286) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0, 287) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0_NC, 288) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1, 289) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1_NC, 290) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2, 291) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2_NC, 292) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G3, 293) \ +_ELF_DEFINE_RELOC(R_AARCH64_LDST128_ABS_LO12_NC, 299) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0, 300) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0_NC, 301) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1, 302) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1_NC, 303) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2, 304) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2_NC, 305) \ +_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G3, 306) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL64, 307) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOTREL32, 308) \ +_ELF_DEFINE_RELOC(R_AARCH64_GOT_LD_PREL19, 309) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTOFF_LO15, 310) \ +_ELF_DEFINE_RELOC(R_AARCH64_ADR_GOT_PAGE, 311) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 312) \ +_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 313) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 512) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 513) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 514) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G1, 515) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 516) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 517) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 518) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 519) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G1, 520) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G0_NC, 521) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LD_PREL19, 522) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G2, 523) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1, 524) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 525) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0, 526) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 527) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_HI12, 529) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 530) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 531) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 532) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 533) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 534) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 535) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 536) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 537) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 538) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 540) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 541) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 542) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 543) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 544) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 545) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 546) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0, 547) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12, 552) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 553) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12, 554) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 555) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 556) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 557) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 558) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 559) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 560) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 561) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 562) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD64_LO12, 563) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD_LO12, 564) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G1, 565) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G0_NC, 566) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LDR, 567) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD, 568) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_CALL, 569) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 570) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 571) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 572) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 573) \ +_ELF_DEFINE_RELOC(R_AARCH64_COPY, 1024) \ +_ELF_DEFINE_RELOC(R_AARCH64_GLOB_DAT, 1025) \ +_ELF_DEFINE_RELOC(R_AARCH64_JUMP_SLOT, 1026) \ +_ELF_DEFINE_RELOC(R_AARCH64_RELATIVE, 1027) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPREL64, 1028) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPMOD64, 1029) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLS_TPREL64, 1030) \ +_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC, 1031) \ +_ELF_DEFINE_RELOC(R_AARCH64_IRELATIVE, 1032) /* * These are the symbols used in the Sun ``Linkers and Loaders @@ -1633,7 +1755,7 @@ _ELF_DEFINE_RELOC(R_IA_64_LTV32MSB, 0x7 _ELF_DEFINE_RELOC(R_IA_64_LTV32LSB, 0x75) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64MSB, 0x76) \ _ELF_DEFINE_RELOC(R_IA_64_LTV64LSB, 0x77) \ -_ELF_DEFINE_RELOC(R_IA_64_PCREL21BIa, 0x79) \ +_ELF_DEFINE_RELOC(R_IA_64_PCREL21BI, 0x79) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL22, 0x7A) \ _ELF_DEFINE_RELOC(R_IA_64_PCREL64I, 0x7B) \ _ELF_DEFINE_RELOC(R_IA_64_IPLTMSB, 0x80) \ @@ -1723,7 +1845,7 @@ _ELF_DEFINE_RELOC(R_PPC_REL32, 26) \ _ELF_DEFINE_RELOC(R_PPC_PLT32, 27) \ _ELF_DEFINE_RELOC(R_PPC_PLTREL32, 28) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_LO, 29) \ -_ELF_DEFINE_RELOC(R_PPL_PLT16_HI, 30) \ +_ELF_DEFINE_RELOC(R_PPC_PLT16_HI, 30) \ _ELF_DEFINE_RELOC(R_PPC_PLT16_HA, 31) \ _ELF_DEFINE_RELOC(R_PPC_SDAREL16, 32) \ _ELF_DEFINE_RELOC(R_PPC_SECTOFF, 33) \ @@ -1926,7 +2048,7 @@ _ELF_DEFINE_RELOC(R_RISCV_SUB32, 39) \ _ELF_DEFINE_RELOC(R_RISCV_SUB64, 40) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, 41) \ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ -_ELF_DEFINE_RELOC(R_RISCV_ALIGN 43) \ +_ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) @@ -2042,6 +2164,7 @@ _ELF_DEFINE_IA64_RELOCATIONS() \ _ELF_DEFINE_MIPS_RELOCATIONS() \ _ELF_DEFINE_PPC32_RELOCATIONS() \ _ELF_DEFINE_PPC64_RELOCATIONS() \ +_ELF_DEFINE_RISCV_RELOCATIONS() \ _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_X86_64_RELOCATIONS() Modified: vendor/elftoolchain/dist/common/native-elf-format ============================================================================== --- vendor/elftoolchain/dist/common/native-elf-format Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/common/native-elf-format Wed Feb 10 19:39:36 2016 (r295484) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $ +# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -33,6 +33,8 @@ $1 ~ "Data:" { $1 ~ "Machine:" { if (match($0, "Intel.*386")) { elfarch = "EM_386"; + } else if (match($0, "MIPS")) { + elfarch = "EM_MIPS"; } else if (match($0, ".*[xX]86-64")) { elfarch = "EM_X86_64"; } else { Modified: vendor/elftoolchain/dist/cxxfilt/cxxfilt.c ============================================================================== --- vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Wed Feb 10 19:39:36 2016 (r295484) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $"); #define STRBUFSZ 8192 @@ -112,11 +112,11 @@ find_format(const char *fstr) } static char * -demangle(char *name, int strict, int *pos) +demangle(char *name, int strict, size_t *pos) { static char dem[STRBUFSZ]; char nb[STRBUFSZ]; - int p, t; + size_t p, t; if (stripus && *name == '_') { strncpy(nb, name + 1, sizeof(nb) - 1); @@ -128,10 +128,10 @@ demangle(char *name, int strict, int *po nb[sizeof(nb) - 1] = '\0'; p = strlen(nb); - if (p <= 0) + if (p == 0) return NULL; - while (elftc_demangle(nb, dem, sizeof(dem), format) < 0) { + while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) { if (!strict && p > 1) { nb[--p] = '\0'; continue; @@ -149,7 +149,8 @@ int main(int argc, char **argv) { char *dem, buf[STRBUFSZ]; - int c, i, p, s, opt; + size_t i, p, s; + int c, n, opt; while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) != -1) { @@ -182,9 +183,9 @@ main(int argc, char **argv) argc -= optind; if (*argv != NULL) { - for (i = 0; i < argc; i++) { - if ((dem = demangle(argv[i], 1, NULL)) == NULL) - fprintf(stderr, "Failed: %s\n", argv[i]); + for (n = 0; n < argc; n++) { + if ((dem = demangle(argv[n], 1, NULL)) == NULL) + fprintf(stderr, "Failed: %s\n", argv[n]); else printf("%s\n", dem); } @@ -213,7 +214,7 @@ main(int argc, char **argv) if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); else - buf[p++] = c; + buf[p++] = (char) c; } } Modified: vendor/elftoolchain/dist/elfcopy/Makefile ============================================================================== --- vendor/elftoolchain/dist/elfcopy/Makefile Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/Makefile Wed Feb 10 19:39:36 2016 (r295484) @@ -1,10 +1,13 @@ -# $Id: Makefile 2290 2011-12-04 07:20:46Z jkoshy $ +# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $ TOP= .. +.include "${TOP}/mk/elftoolchain.components.mk" + PROG= elfcopy -SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c +SRCS= archive.c ascii.c binary.c main.c sections.c segments.c \ + symbols.c WARNS?= 5 @@ -15,14 +18,24 @@ LDADD= -lelf -lelftc LDADD+= -larchive .endif +.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +SRCS+= pe.c +CFLAGS+= -DWITH_PE=1 + +DPADD+= ${LIBPE} +LDADD+= -lpe +.endif + MAN= elfcopy.1 mcs.1 strip.1 +MLINKS= elfcopy.1 objcopy.1 NO_SHARED?= yes -LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip \ - ${BINDIR}/elfcopy ${BINDIR}/mcs +LINKS= ${BINDIR}/elfcopy ${BINDIR}/mcs \ + ${BINDIR}/elfcopy ${BINDIR}/objcopy \ + ${BINDIR}/elfcopy ${BINDIR}/strip -EXTRA_TARGETS= strip mcs +EXTRA_TARGETS= mcs strip objcopy CLEANFILES+= ${EXTRA_TARGETS} Modified: vendor/elftoolchain/dist/elfcopy/archive.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/archive.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/archive.c Wed Feb 10 19:39:36 2016 (r295484) @@ -38,7 +38,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: archive.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ @@ -382,7 +382,7 @@ ac_read_objs(struct elfcopy *ecp, int if if (lseek(ifd, 0, SEEK_SET) == -1) err(EXIT_FAILURE, "lseek failed"); if ((a = archive_read_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_read_new failed"); archive_read_support_format_ar(a); AC(archive_read_open_fd(a, ifd, 10240)); for(;;) { @@ -443,7 +443,7 @@ ac_write_objs(struct elfcopy *ecp, int o int nr; if ((a = archive_write_new()) == NULL) - errx(EXIT_FAILURE, "%s", archive_error_string(a)); + errx(EXIT_FAILURE, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); AC(archive_write_open_fd(a, ofd)); Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.1 ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.1 Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.1 Wed Feb 10 19:39:36 2016 (r295484) @@ -21,13 +21,14 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $ +.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $ .\" -.Dd December 7, 2015 +.Dd January 29, 2016 .Os .Dt ELFCOPY 1 .Sh NAME -.Nm elfcopy +.Nm elfcopy , +.Nm objcopy .Nd copy and translate object files .Sh SYNOPSIS .Nm @@ -85,7 +86,7 @@ .Sh DESCRIPTION The .Nm -utility copies the content of the ELF object named by argument +utility copies the content of the binary object named by argument .Ar infile to that named by argument .Ar outfile , @@ -121,6 +122,10 @@ to the output. .It Fl O Ar objformat | Fl -output-target= Ns Ar objformat Write the output file using the object format specified in argument .Ar objformat . +The argument +.Ar objformat +should be one of the target names recognized by +.Xr elftc_bfd_find_target 3 . .It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname Remove any section with name .Ar sectionname @@ -330,8 +335,14 @@ Do not copy symbols that are not needed .Xr mcs 1 , .Xr strip 1 , .Xr elf 3 , +.Xr elftc_bfd_find_target 3 , .Xr ar 5 , .Xr elf 5 +.Sh COMPATIBILITY +The +.Nm +utility is expected to be option compatible with GNU +.Nm objcopy . .Sh HISTORY .Nm has been implemented by Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.h ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.h Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.h Wed Feb 10 19:39:36 2016 (r295484) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3221 2015-05-24 23:42:43Z kaiwang27 $ + * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $ */ #include @@ -287,6 +287,7 @@ struct section *create_external_section( int _loadable); void create_external_symtab(struct elfcopy *_ecp); void create_ihex(int _ifd, int _ofd); +void create_pe(struct elfcopy *_ecp, int _ifd, int _ofd); void create_scn(struct elfcopy *_ecp); void create_srec(struct elfcopy *_ecp, int _ifd, int _ofd, const char *_ofn); void create_symtab(struct elfcopy *_ecp); Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Wed Feb 10 19:01:26 2016 (r295483) +++ vendor/elftoolchain/dist/elfcopy/main.c Wed Feb 10 19:39:36 2016 (r295484) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $"); +ELFTC_VCSID("$Id: main.c 3381 2016-01-30 19:39:47Z jkoshy $"); enum options { @@ -722,6 +722,15 @@ create_file(struct elfcopy *ecp, const c create_srec(ecp, ofd, ofd0, dst != NULL ? dst : src); break; + case ETF_PE: + case ETF_EFI: +#if WITH_PE + create_pe(ecp, ofd, ofd0); +#else + errx(EXIT_FAILURE, "PE/EFI support not enabled" + " at compile time"); +#endif + break; default: errx(EXIT_FAILURE, "Internal: unsupported" " output flavour %d", ecp->oec); @@ -1345,6 +1354,9 @@ set_output_target(struct elfcopy *ecp, c ecp->oed = elftc_bfd_target_byteorder(tgt); ecp->oem = elftc_bfd_target_machine(tgt); } + if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE) + ecp->oem = elftc_bfd_target_machine(tgt); + ecp->otgt = target_name; } @@ -1366,7 +1378,7 @@ set_osabi(struct elfcopy *ecp, const cha #define ELFCOPY_USAGE_MESSAGE "\ Usage: %s [options] infile [outfile]\n\ - Transform an ELF object.\n\n\ + Transform object files.\n\n\ Options:\n\ -d | -g | --strip-debug Remove debugging information from the output.\n\ -j SECTION | --only-section=SECTION\n\ @@ -1382,6 +1394,8 @@ Usage: %s [options] infile [outfile]\n\ -N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\ -O FORMAT | --output-target=FORMAT\n\ Specify object format for the output file.\n\ + FORMAT should be a target name understood by\n\ + elftc_bfd_find_target(3).\n\ -R NAME | --remove-section=NAME\n\ Remove the named section.\n\ -S | --strip-all Remove all symbol and relocation information\n\ Added: vendor/elftoolchain/dist/elfcopy/pe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/elftoolchain/dist/elfcopy/pe.c Wed Feb 10 19:39:36 2016 (r295484) @@ -0,0 +1,233 @@ +/*- + * Copyright (c) 2016 Kai Wang + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "elfcopy.h" + +ELFTC_VCSID("$Id: pe.c 3312 2016-01-10 09:23:51Z kaiwang27 $"); + +/* Convert ELF object to Portable Executable (PE). */ +void +create_pe(struct elfcopy *ecp, int ifd, int ofd) +{ + Elf *e; + Elf_Scn *scn; + Elf_Data *d; + GElf_Ehdr eh; + GElf_Shdr sh; + PE *pe; + PE_Scn *ps; + PE_SecHdr psh; + PE_CoffHdr pch; + PE_OptHdr poh; + PE_Object po; + PE_Buffer *pb; + const char *name; + size_t indx; + int elferr, i; + + if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) + po = PE_O_PE32P; + else + po = PE_O_PE32; + + if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) + errx(EXIT_FAILURE, "elf_begin() failed: %s", + elf_errmsg(-1)); + + if (gelf_getehdr(e, &eh) == NULL) + errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", + elf_errmsg(-1)); + + if (elf_getshstrndx(ecp->ein, &indx) == 0) + errx(EXIT_FAILURE, "elf_getshstrndx() failed: %s", + elf_errmsg(-1)); + + if ((pe = pe_init(ofd, PE_C_WRITE, po)) == NULL) + err(EXIT_FAILURE, "pe_init() failed"); + + /* Setup PE COFF header. */ + memset(&pch, 0, sizeof(pch)); + switch (ecp->oem) { + case EM_386: + pch.ch_machine = IMAGE_FILE_MACHINE_I386; + break; + case EM_X86_64: + pch.ch_machine = IMAGE_FILE_MACHINE_AMD64; + break; + default: + pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; + break; + } + pch.ch_timestamp = (uint32_t) time(NULL); + if (pe_update_coff_header(pe, &pch) < 0) + err(EXIT_FAILURE, "pe_update_coff_header() failed"); + + /* Setup PE optional header. */ + memset(&poh, 0, sizeof(poh)); + if (ecp->otf == ETF_EFI) + poh.oh_subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION; + poh.oh_entry = (uint32_t) eh.e_entry; + + /* + * Default section alignment and file alignment. (Here the + * section alignment is set to the default page size of the + * archs supported. We should use different section alignment + * for some arch. (e.g. IA64) + */ + poh.oh_secalign = 0x1000; + poh.oh_filealign = 0x200; + + /* Copy sections. */ + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + + /* + * Read in ELF section. + */ + + if (gelf_getshdr(scn, &sh) == NULL) { + warnx("gelf_getshdr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) == + NULL) { + warnx("elf_strptr() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + /* Skip sections unneeded. */ + if (strcmp(name, ".shstrtab") == 0 || + strcmp(name, ".symtab") == 0 || + strcmp(name, ".strtab") == 0) + continue; + + if ((d = elf_getdata(scn, NULL)) == NULL) { + warnx("elf_getdata() failed: %s", elf_errmsg(-1)); + (void) elf_errno(); + continue; + } + + if (strcmp(name, ".text") == 0) { + poh.oh_textbase = (uint32_t) sh.sh_addr; + poh.oh_textsize = (uint32_t) roundup(sh.sh_size, + poh.oh_filealign); + } else { + if (po == PE_O_PE32 && strcmp(name, ".data") == 0) + poh.oh_database = sh.sh_addr; + if (sh.sh_type == SHT_NOBITS) + poh.oh_bsssize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + else if (sh.sh_flags & SHF_ALLOC) + poh.oh_datasize += (uint32_t) + roundup(sh.sh_size, poh.oh_filealign); + } + + /* + * Create PE/COFF section. + */ + + if ((ps = pe_newscn(pe)) == NULL) { + warn("pe_newscn() failed"); + continue; + } + + /* + * Setup PE/COFF section header. The section name is not + * NUL-terminated if its length happens to be 8. Long + * section name should be truncated for PE image according + * to the PE/COFF specification. + */ + memset(&psh, 0, sizeof(psh)); + strncpy(psh.sh_name, name, sizeof(psh.sh_name)); + psh.sh_addr = sh.sh_addr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Feb 10 19:40:30 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E11AA4485; Wed, 10 Feb 2016 19:40:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C113A1392; Wed, 10 Feb 2016 19:40:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJeSXi063543; Wed, 10 Feb 2016 19:40:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AJeSap063542; Wed, 10 Feb 2016 19:40:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602101940.u1AJeSap063542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Feb 2016 19:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295485 - vendor/elftoolchain/elftoolchain-r3395 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:40:30 -0000 Author: emaste Date: Wed Feb 10 19:40:28 2016 New Revision: 295485 URL: https://svnweb.freebsd.org/changeset/base/295485 Log: Tag elftoolchain-r3395 Added: vendor/elftoolchain/elftoolchain-r3395/ - copied from r295484, vendor/elftoolchain/dist/ From owner-svn-src-vendor@freebsd.org Thu Feb 11 17:25:14 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55BD3AA5B73; Thu, 11 Feb 2016 17:25:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2364B1154; Thu, 11 Feb 2016 17:25:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHPD3M046911; Thu, 11 Feb 2016 17:25:13 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHPCTZ046900; Thu, 11 Feb 2016 17:25:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602111725.u1BHPCTZ046900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 11 Feb 2016 17:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295530 - in vendor/unbound/dist: . doc services util validator X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:25:14 -0000 Author: des Date: Thu Feb 11 17:25:12 2016 New Revision: 295530 URL: https://svnweb.freebsd.org/changeset/base/295530 Log: Apply upstream r3619, r3620, r3621: add insecure-lan-zone option Added: vendor/unbound/dist/util/as112.c vendor/unbound/dist/util/as112.h Modified: vendor/unbound/dist/Makefile.in vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/services/localzone.c vendor/unbound/dist/util/config_file.c vendor/unbound/dist/util/config_file.h vendor/unbound/dist/util/configlexer.lex vendor/unbound/dist/util/configparser.y vendor/unbound/dist/validator/val_anchor.c Modified: vendor/unbound/dist/Makefile.in ============================================================================== --- vendor/unbound/dist/Makefile.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/Makefile.in Thu Feb 11 17:25:12 2016 (r295530) @@ -95,7 +95,7 @@ PYUNBOUND_SRC= # libunbound_wrap.lo if python libunbound wrapper enabled. PYUNBOUND_OBJ=@PYUNBOUND_OBJ@ COMMON_SRC=services/cache/dns.c services/cache/infra.c services/cache/rrset.c \ -util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ +util/as112.c util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ util/data/msgreply.c util/data/packed_rrset.c iterator/iterator.c \ iterator/iter_delegpt.c iterator/iter_donotq.c iterator/iter_fwd.c \ iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ @@ -113,7 +113,7 @@ validator/val_neg.c validator/val_nsec3. validator/val_secalgo.c validator/val_sigcrypt.c \ validator/val_utils.c dns64/dns64.c $(CHECKLOCK_SRC) $(DNSTAP_SRC) COMMON_OBJ_WITHOUT_NETCALL=dns.lo infra.lo rrset.lo dname.lo msgencode.lo \ -msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ +as112.lo msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ iter_donotq.lo iter_fwd.lo iter_hints.lo iter_priv.lo iter_resptype.lo \ iter_scrub.lo iter_utils.lo localzone.lo mesh.lo modstack.lo \ outbound_list.lo alloc.lo config_file.lo configlexer.lo configparser.lo \ @@ -595,6 +595,7 @@ depend: rm -f $(DEPEND_TMP) $(DEPEND_TMP2) # Dependencies +as112.lo as112.o: $(srcdir)/util/as112.c $(srcdir)/util/as112.h dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/services/cache/dns.h $(srcdir)/util/data/msgreply.h \ @@ -702,7 +703,7 @@ localzone.lo localzone.o: $(srcdir)/serv $(srcdir)/sldns/sbuffer.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ @@ -821,7 +822,7 @@ val_anchor.lo val_anchor.o: $(srcdir)/va $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/as112.h validator.lo validator.o: $(srcdir)/validator/validator.c config.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ Modified: vendor/unbound/dist/doc/example.conf.in ============================================================================== --- vendor/unbound/dist/doc/example.conf.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/doc/example.conf.in Thu Feb 11 17:25:12 2016 (r295530) @@ -508,13 +508,17 @@ server: # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. - # if unbound is running service for the local host then it is useful + # If unbound is running service for the local host then it is useful # to perform lan-wide lookups to the upstream, and unblock the # long list of local-zones above. If this unbound is a dns server # for a network of computers, disabled is better and stops information # leakage of local lan information. # unblock-lan-zones: no + # The insecure-lan-zones option disables validation for + # these zones, as if they were all listed as domain-insecure. + # insecure-lan-zones: no + # a number of locally served zones can be configured. # local-zone: # local-data: "" Modified: vendor/unbound/dist/doc/unbound.conf.5.in ============================================================================== --- vendor/unbound/dist/doc/unbound.conf.5.in Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/doc/unbound.conf.5.in Thu Feb 11 17:25:12 2016 (r295530) @@ -841,6 +841,11 @@ as a (DHCP-) DNS network resolver for a lookups should be filtered (RFC compliance), this also stops potential data leakage about the local network to the upstream DNS servers. .TP +.B insecure\-lan\-zones: \fI +Default is disabled. If enabled, then reverse lookups in private +address space are not validated. This is usually required whenever +\fIunblock\-lan\-zones\fR is used. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: vendor/unbound/dist/services/localzone.c ============================================================================== --- vendor/unbound/dist/services/localzone.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/services/localzone.c Thu Feb 11 17:25:12 2016 (r295530) @@ -51,6 +51,7 @@ #include "util/netevent.h" #include "util/data/msgreply.h" #include "util/data/msgparse.h" +#include "util/as112.h" struct local_zones* local_zones_create(void) @@ -592,6 +593,7 @@ static int lz_enter_defaults(struct local_zones* zones, struct config_file* cfg) { struct local_zone* z; + const char** zstr; /* this list of zones is from RFC 6303 */ @@ -654,110 +656,14 @@ lz_enter_defaults(struct local_zones* zo lock_rw_unlock(&z->lock); } - /* if unblock lan-zones, then do not add the zones below. - * we do add the zones above, about 127.0.0.1, because localhost is - * not on the lan. */ - if(cfg->unblock_lan_zones) - return 1; - - /* block LAN level zones */ - if ( !add_as112_default(zones, cfg, "10.in-addr.arpa.") || - !add_as112_default(zones, cfg, "16.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "17.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "18.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "19.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "20.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "21.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "22.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "23.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "24.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "25.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "26.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "27.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "28.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "29.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "30.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "31.172.in-addr.arpa.") || - !add_as112_default(zones, cfg, "168.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.in-addr.arpa.") || - !add_as112_default(zones, cfg, "64.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "65.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "66.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "67.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "68.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "69.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "70.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "71.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "72.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "73.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "74.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "75.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "76.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "77.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "78.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "79.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "80.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "81.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "82.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "83.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "84.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "85.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "86.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "87.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "88.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "89.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "90.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "91.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "92.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "93.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "94.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "95.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "96.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "97.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "98.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "99.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "101.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "102.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "103.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "104.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "105.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "106.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "107.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "108.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "109.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "110.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "111.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "112.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "114.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "115.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "116.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "117.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "118.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "119.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "120.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "121.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "122.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "123.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "124.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "125.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "126.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "127.100.in-addr.arpa.") || - !add_as112_default(zones, cfg, "254.169.in-addr.arpa.") || - !add_as112_default(zones, cfg, "2.0.192.in-addr.arpa.") || - !add_as112_default(zones, cfg, "100.51.198.in-addr.arpa.") || - !add_as112_default(zones, cfg, "113.0.203.in-addr.arpa.") || - !add_as112_default(zones, cfg, "255.255.255.255.in-addr.arpa.") || - !add_as112_default(zones, cfg, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.") || - !add_as112_default(zones, cfg, "d.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "9.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "a.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "b.e.f.ip6.arpa.") || - !add_as112_default(zones, cfg, "8.b.d.0.1.0.0.2.ip6.arpa.")) { - log_err("out of memory adding default zone"); - return 0; + /* block AS112 zones, unless asked not to */ + if(!cfg->unblock_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!add_as112_default(zones, cfg, *zstr)) { + log_err("out of memory adding default zone"); + return 0; + } + } } return 1; } Added: vendor/unbound/dist/util/as112.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/util/as112.c Thu Feb 11 17:25:12 2016 (r295530) @@ -0,0 +1,143 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones. + */ + +#include "util/as112.h" + +static const char* as112_zone_array[] = { + "10.in-addr.arpa.", + "16.172.in-addr.arpa.", + "17.172.in-addr.arpa.", + "18.172.in-addr.arpa.", + "19.172.in-addr.arpa.", + "20.172.in-addr.arpa.", + "21.172.in-addr.arpa.", + "22.172.in-addr.arpa.", + "23.172.in-addr.arpa.", + "24.172.in-addr.arpa.", + "25.172.in-addr.arpa.", + "26.172.in-addr.arpa.", + "27.172.in-addr.arpa.", + "28.172.in-addr.arpa.", + "29.172.in-addr.arpa.", + "30.172.in-addr.arpa.", + "31.172.in-addr.arpa.", + "168.192.in-addr.arpa.", + "0.in-addr.arpa.", + "64.100.in-addr.arpa.", + "65.100.in-addr.arpa.", + "66.100.in-addr.arpa.", + "67.100.in-addr.arpa.", + "68.100.in-addr.arpa.", + "69.100.in-addr.arpa.", + "70.100.in-addr.arpa.", + "71.100.in-addr.arpa.", + "72.100.in-addr.arpa.", + "73.100.in-addr.arpa.", + "74.100.in-addr.arpa.", + "75.100.in-addr.arpa.", + "76.100.in-addr.arpa.", + "77.100.in-addr.arpa.", + "78.100.in-addr.arpa.", + "79.100.in-addr.arpa.", + "80.100.in-addr.arpa.", + "81.100.in-addr.arpa.", + "82.100.in-addr.arpa.", + "83.100.in-addr.arpa.", + "84.100.in-addr.arpa.", + "85.100.in-addr.arpa.", + "86.100.in-addr.arpa.", + "87.100.in-addr.arpa.", + "88.100.in-addr.arpa.", + "89.100.in-addr.arpa.", + "90.100.in-addr.arpa.", + "91.100.in-addr.arpa.", + "92.100.in-addr.arpa.", + "93.100.in-addr.arpa.", + "94.100.in-addr.arpa.", + "95.100.in-addr.arpa.", + "96.100.in-addr.arpa.", + "97.100.in-addr.arpa.", + "98.100.in-addr.arpa.", + "99.100.in-addr.arpa.", + "100.100.in-addr.arpa.", + "101.100.in-addr.arpa.", + "102.100.in-addr.arpa.", + "103.100.in-addr.arpa.", + "104.100.in-addr.arpa.", + "105.100.in-addr.arpa.", + "106.100.in-addr.arpa.", + "107.100.in-addr.arpa.", + "108.100.in-addr.arpa.", + "109.100.in-addr.arpa.", + "110.100.in-addr.arpa.", + "111.100.in-addr.arpa.", + "112.100.in-addr.arpa.", + "113.100.in-addr.arpa.", + "114.100.in-addr.arpa.", + "115.100.in-addr.arpa.", + "116.100.in-addr.arpa.", + "117.100.in-addr.arpa.", + "118.100.in-addr.arpa.", + "119.100.in-addr.arpa.", + "120.100.in-addr.arpa.", + "121.100.in-addr.arpa.", + "122.100.in-addr.arpa.", + "123.100.in-addr.arpa.", + "124.100.in-addr.arpa.", + "125.100.in-addr.arpa.", + "126.100.in-addr.arpa.", + "127.100.in-addr.arpa.", + "254.169.in-addr.arpa.", + "2.0.192.in-addr.arpa.", + "100.51.198.in-addr.arpa.", + "113.0.203.in-addr.arpa.", + "255.255.255.255.in-addr.arpa.", + "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.", + "d.f.ip6.arpa.", + "8.e.f.ip6.arpa.", + "9.e.f.ip6.arpa.", + "a.e.f.ip6.arpa.", + "b.e.f.ip6.arpa.", + "8.b.d.0.1.0.0.2.ip6.arpa.", + 0 +}; + +const char** as112_zones = as112_zone_array; Added: vendor/unbound/dist/util/as112.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/util/as112.h Thu Feb 11 17:25:12 2016 (r295530) @@ -0,0 +1,57 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones + */ + +#ifndef UTIL_AS112_H +#define UTIL_AS112_H + +/** + * Array of text-format domain names of the AS112 zones. + * The array ends with NULL. "AS112" is a service on the internet that + * that this array is named after. The names in this list (or some of them) + * are null-routed by this service to avoid load on central servers caused by + * mistaken lookups for local content on the global internet. + * + * This is the list of names that unbound should not normally be sending + * on towards the internet, because they are local-use. + */ +extern const char** as112_zones; + +#endif Modified: vendor/unbound/dist/util/config_file.c ============================================================================== --- vendor/unbound/dist/util/config_file.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/config_file.c Thu Feb 11 17:25:12 2016 (r295530) @@ -210,6 +210,7 @@ config_create(void) cfg->local_zones_nodefault = NULL; cfg->local_data = NULL; cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; cfg->python_script = NULL; cfg->remote_control_enable = 0; cfg->control_ifs = NULL; @@ -458,6 +459,7 @@ int config_set_option(struct config_file else S_YNO("rrset-roundrobin:", rrset_roundrobin) else S_STRLIST("local-data:", local_data) else S_YNO("unblock-lan-zones:", unblock_lan_zones) + else S_YNO("insecure-lan-zones:", insecure_lan_zones) else S_YNO("control-enable:", remote_control_enable) else S_STRLIST("control-interface:", control_ifs) else S_NUMBER_NONZERO("control-port:", control_port) @@ -739,6 +741,7 @@ config_get_option(struct config_file* cf else O_YNO(opt, "minimal-responses", minimal_responses) else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) + else O_YNO(opt, "insecure-lan-zones", insecure_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) else O_STR(opt, "python-script", python_script) else O_DEC(opt, "ratelimit", ratelimit) Modified: vendor/unbound/dist/util/config_file.h ============================================================================== --- vendor/unbound/dist/util/config_file.h Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/config_file.h Thu Feb 11 17:25:12 2016 (r295530) @@ -285,8 +285,10 @@ struct config_file { struct config_strlist* local_zones_nodefault; /** local data RRs configured */ struct config_strlist* local_data; - /** unblock lan zones (reverse lookups for 10/8 and so on) */ + /** unblock lan zones (reverse lookups for AS112 zones) */ int unblock_lan_zones; + /** insecure lan zones (don't validate AS112 zones) */ + int insecure_lan_zones; /** remote control section. enable toggle. */ int remote_control_enable; Modified: vendor/unbound/dist/util/configlexer.lex ============================================================================== --- vendor/unbound/dist/util/configlexer.lex Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/configlexer.lex Thu Feb 11 17:25:12 2016 (r295530) @@ -319,6 +319,7 @@ local-zone{COLON} { YDVAR(2, VAR_LOCAL_ local-data{COLON} { YDVAR(1, VAR_LOCAL_DATA) } local-data-ptr{COLON} { YDVAR(1, VAR_LOCAL_DATA_PTR) } unblock-lan-zones{COLON} { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) } +insecure-lan-zones{COLON} { YDVAR(1, VAR_INSECURE_LAN_ZONES) } statistics-interval{COLON} { YDVAR(1, VAR_STATISTICS_INTERVAL) } statistics-cumulative{COLON} { YDVAR(1, VAR_STATISTICS_CUMULATIVE) } extended-statistics{COLON} { YDVAR(1, VAR_EXTENDED_STATISTICS) } Modified: vendor/unbound/dist/util/configparser.y ============================================================================== --- vendor/unbound/dist/util/configparser.y Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/util/configparser.y Thu Feb 11 17:25:12 2016 (r295530) @@ -106,7 +106,8 @@ extern struct config_parser_state* cfg_p %token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN -%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UNBLOCK_LAN_ZONES +%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE +%token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES %token VAR_INFRA_CACHE_MIN_RTT %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH @@ -180,7 +181,8 @@ content_server: server_num_threads | ser server_log_queries | server_tcp_upstream | server_ssl_upstream | server_ssl_service_key | server_ssl_service_pem | server_ssl_port | server_minimal_responses | server_rrset_roundrobin | server_max_udp_size | - server_so_reuseport | server_delay_close | server_unblock_lan_zones | + server_so_reuseport | server_delay_close | + server_unblock_lan_zones | server_insecure_lan_zones | server_dns64_prefix | server_dns64_synthall | server_infra_cache_min_rtt | server_harden_algo_downgrade | server_ip_transparent | server_ratelimit | server_ratelimit_slabs | @@ -722,6 +724,16 @@ server_unblock_lan_zones: VAR_UNBLOCK_LA free($2); } ; +server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG + { + OUTYY(("P(server_insecure_lan_zones:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->insecure_lan_zones = + (strcmp($2, "yes")==0); + free($2); + } + ; server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG { OUTYY(("P(server_rrset_cache_size:%s)\n", $2)); Modified: vendor/unbound/dist/validator/val_anchor.c ============================================================================== --- vendor/unbound/dist/validator/val_anchor.c Thu Feb 11 17:07:19 2016 (r295529) +++ vendor/unbound/dist/validator/val_anchor.c Thu Feb 11 17:25:12 2016 (r295530) @@ -48,6 +48,7 @@ #include "util/log.h" #include "util/net_help.h" #include "util/config_file.h" +#include "util/as112.h" #include "sldns/sbuffer.h" #include "sldns/rrdef.h" #include "sldns/str2wire.h" @@ -1044,8 +1045,18 @@ int anchors_apply_cfg(struct val_anchors* anchors, struct config_file* cfg) { struct config_strlist* f; + const char** zstr; char* nm; sldns_buffer* parsebuf = sldns_buffer_new(65535); + if(cfg->insecure_lan_zones) { + for(zstr = as112_zones; *zstr; zstr++) { + if(!anchor_insert_insecure(anchors, *zstr)) { + log_err("error in insecure-lan-zones: %s", *zstr); + sldns_buffer_free(parsebuf); + return 0; + } + } + } for(f = cfg->domain_insecure; f; f = f->next) { if(!f->str || f->str[0] == 0) /* empty "" */ continue; From owner-svn-src-vendor@freebsd.org Fri Feb 12 18:18:51 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52780AA6A57; Fri, 12 Feb 2016 18:18:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E79A1095; Fri, 12 Feb 2016 18:18:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIIo2c081834; Fri, 12 Feb 2016 18:18:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIIorE081831; Fri, 12 Feb 2016 18:18:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602121818.u1CIIorE081831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 18:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295569 - in vendor/elftoolchain/dist: elfcopy libelf X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:18:51 -0000 Author: emaste Date: Fri Feb 12 18:18:49 2016 New Revision: 295569 URL: https://svnweb.freebsd.org/changeset/base/295569 Log: Import ELF Tool Chain snapshot revision 3399 From http://svn.code.sf.net/p/elftoolchain/code Modified: vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/libelf/_libelf_config.h Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/elfcopy/main.c Fri Feb 12 18:18:49 2016 (r295569) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3381 2016-01-30 19:39:47Z jkoshy $"); +ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); enum options { @@ -316,6 +316,7 @@ create_elf(struct elfcopy *ecp) oeh.e_entry = ieh.e_entry; oeh.e_version = ieh.e_version; + ecp->flags &= ~(EXECUTABLE | DYNAMIC | RELOCATABLE); if (ieh.e_type == ET_EXEC) ecp->flags |= EXECUTABLE; else if (ieh.e_type == ET_DYN) @@ -1485,6 +1486,7 @@ Usage: %s [options] file...\n\ Options:\n\ -d | -g | -S | --strip-debug Remove debugging symbols.\n\ -h | --help Print a help message.\n\ + -o FILE | --output-file FILE Write output to FILE.\n\ --only-keep-debug Keep debugging information only.\n\ -p | --preserve-dates Preserve access and modification times.\n\ -s | --strip-all Remove all symbols.\n\ Modified: vendor/elftoolchain/dist/elfcopy/segments.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/segments.c Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/elfcopy/segments.c Fri Feb 12 18:18:49 2016 (r295569) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3340 2016-01-17 15:00:56Z kaiwang27 $"); +ELFTC_VCSID("$Id: segments.c 3397 2016-02-12 14:35:19Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -489,7 +489,7 @@ copy_phdr(struct elfcopy *ecp) ophdr.p_filesz = seg->fsz; ophdr.p_memsz = seg->msz; if (!gelf_update_phdr(ecp->eout, i, &ophdr)) - err(EXIT_FAILURE, "gelf_update_phdr failed :%s", + errx(EXIT_FAILURE, "gelf_update_phdr failed: %s", elf_errmsg(-1)); i++; Modified: vendor/elftoolchain/dist/libelf/_libelf_config.h ============================================================================== --- vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Feb 12 17:55:06 2016 (r295568) +++ vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Feb 12 18:18:49 2016 (r295569) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 3168 2015-02-24 19:17:47Z emaste $ + * $Id: _libelf_config.h 3396 2016-02-10 21:50:05Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) @@ -97,6 +97,12 @@ #define LIBELF_BYTEORDER ELFDATA2MSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(__riscv64) + +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__sparc__) #define LIBELF_ARCH EM_SPARCV9 From owner-svn-src-vendor@freebsd.org Fri Feb 12 18:19:33 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CF3AA6AB8; Fri, 12 Feb 2016 18:19:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60262120C; Fri, 12 Feb 2016 18:19:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIJWkl081902; Fri, 12 Feb 2016 18:19:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIJWWB081901; Fri, 12 Feb 2016 18:19:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602121819.u1CIJWWB081901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Feb 2016 18:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295570 - vendor/elftoolchain/elftoolchain-r3399 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:19:33 -0000 Author: emaste Date: Fri Feb 12 18:19:32 2016 New Revision: 295570 URL: https://svnweb.freebsd.org/changeset/base/295570 Log: Tag elftoolchain-r3399 Added: vendor/elftoolchain/elftoolchain-r3399/ - copied from r295569, vendor/elftoolchain/dist/ From owner-svn-src-vendor@freebsd.org Fri Feb 12 18:53:32 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7389AAA77F9; Fri, 12 Feb 2016 18:53:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA5413D8; Fri, 12 Feb 2016 18:53:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIrV1H094753; Fri, 12 Feb 2016 18:53:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIrTB4094733; Fri, 12 Feb 2016 18:53:29 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602121853.u1CIrTB4094733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 12 Feb 2016 18:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295571 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/com... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:53:32 -0000 Author: jkim Date: Fri Feb 12 18:53:29 2016 New Revision: 295571 URL: https://svnweb.freebsd.org/changeset/base/295571 Log: Import ACPICA 20160212. Added: vendor-sys/acpica/dist/source/compiler/asldebug.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslexternal.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslxrefout.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtables.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/asllength.c vendor-sys/acpica/dist/source/compiler/asllisting.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/aslmapoutput.c vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslprune.c vendor-sys/acpica/dist/source/compiler/aslrestype2s.c vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/aslstubs.c vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/events/evgpeblk.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utnonansi.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/examples/examples.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/changes.txt Fri Feb 12 18:53:29 2016 (r295571) @@ -1,4 +1,66 @@ ---------------------------------------- +12 February 2016. Summary of changes for version 20160212: + +This release is available at https://acpica.org/downloads + +1) ACPICA kernel-resident subsystem: + +Implemented full support for the ACPI 6.1 specification (released in +January). This version of the specification is available at: +http://www.uefi.org/specifications + +Only a relatively small number of changes were required in ACPICA to +support ACPI 6.1, in these areas: +- New predefined names +- New _HID values +- A new subtable for HEST +- A few other header changes for new values + +Ensure \_SB_._INI is executed before any _REG methods are executed. There +appears to be existing BIOS code that relies on this behavior. Lv Zheng. + +Reverted a change made in version 20151218 which enabled method +invocations to be targets of various ASL operators (SuperName and Target +grammar elements). While the new behavior is supported by the ACPI +specification, other AML interpreters do not support this behavior and +never will. The ACPI specification will be updated for ACPI 6.2 to remove +this support. Therefore, the change was reverted to the original ACPICA +behavior. + +ACPICA now supports the GCC 6 compiler. + +Current Release: (Note: build changes increased sizes) + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total +Previous Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Completed full support for the ACPI 6.0 External() AML opcode. The +compiler emits an external AML opcode for each ASL External statement. +This opcode is used by the disassembler to assist with the disassembly of +external control methods by specifying the required number of arguments +for the method. AML interpreters do not use this opcode. To ensure that +interpreters do not even see the opcode, a block of one or more external +opcodes is surrounded by an "If(0)" construct. As this feature becomes +commonly deployed in BIOS code, the ability of disassemblers to correctly +disassemble AML code will be greatly improved. David Box. + +iASL: Implemented support for an optional cross-reference output file. +The -lx option will create a the cross-reference file with the suffix +"xrf". Three different types of cross-reference are created in this file: +- List of object references made from within each control method +- Invocation (caller) list for each user-defined control method +- List of references to each non-method object in the namespace + +iASL: Method invocations as ASL Target operands are now disallowed and +flagged as errors in preparation for ACPI 6.2 (see the description of the +problem above). + +---------------------------------------- 8 January 2016. Summary of changes for version 20160108: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 12 18:53:29 2016 (r295571) @@ -56,7 +56,9 @@ OBJECTS = \ $(OBJDIR)/aslbtypes.o\ $(OBJDIR)/aslcodegen.o\ $(OBJDIR)/aslcompile.o\ + $(OBJDIR)/asldebug.o\ $(OBJDIR)/aslerror.o\ + $(OBJDIR)/aslexternal.o\ $(OBJDIR)/aslfiles.o\ $(OBJDIR)/aslfileio.o\ $(OBJDIR)/aslfold.o\ @@ -100,6 +102,7 @@ OBJECTS = \ $(OBJDIR)/asluuid.o\ $(OBJDIR)/aslwalks.o\ $(OBJDIR)/aslxref.o\ + $(OBJDIR)/aslxrefout.o\ $(OBJDIR)/cmfsize.o\ $(OBJDIR)/dbfileio.o\ $(OBJDIR)/dmbuffer.o\ Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/adwalk.c Fri Feb 12 18:53:29 2016 (r295571) @@ -760,6 +760,7 @@ AcpiDmXrefDescendingOp ( ACPI_OPERAND_OBJECT *Object; UINT32 ParamCount = 0; char *Pathname; + UINT16 Flags = 0; WalkState = Info->WalkState; @@ -774,7 +775,24 @@ AcpiDmXrefDescendingOp ( { goto Exit; } + else if (Op->Common.Parent && + Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) + { + /* External() NamePath */ + + Path = Op->Common.Value.String; + ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; + if (ObjectType == ACPI_TYPE_METHOD) + { + ParamCount = (UINT32) + Op->Common.Next->Common.Next->Common.Value.Integer; + } + + AcpiDmAddOpToExternalList (Op, Path, + (UINT8) ObjectType, ParamCount, Flags); + goto Exit; + } /* Get the NamePath from the appropriate place */ @@ -842,6 +860,7 @@ AcpiDmXrefDescendingOp ( /* Node was created by an External() statement */ Status = AE_NOT_FOUND; + Flags = ACPI_EXT_RESOLVED_REFERENCE; } if (ACPI_FAILURE (Status)) @@ -861,12 +880,12 @@ AcpiDmXrefDescendingOp ( if (Node) { AcpiDmAddNodeToExternalList (Node, - (UINT8) ObjectType, 0, 0); + (UINT8) ObjectType, 0, Flags); } else { AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, 0, 0); + (UINT8) ObjectType, 0, Flags); } } } Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/ahids.c Fri Feb 12 18:53:29 2016 (r295571) @@ -75,6 +75,10 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI000D", "Power Meter Device"}, {"ACPI000E", "Time and Alarm Device"}, {"ACPI000F", "User Presence Detection Device"}, + {"ACPI0010", "Processor Container Device"}, + {"ACPI0011", "Generic Buttons Device"}, + {"ACPI0012", "NVDIMM Root Device"}, + {"ACPI0013", "Generic Event Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, @@ -185,6 +189,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"PNP0C12", "Device Bay Controller"}, {"PNP0C14", "Windows Management Instrumentation Device"}, {"PNP0C15", "Docking Station"}, + {"PNP0C33", "Error Device"}, {"PNP0C40", "Standard Button Controller"}, {"PNP0C50", "HID Protocol Device (I2C bus)"}, {"PNP0C60", "Display Sensor Device"}, Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Fri Feb 12 18:53:29 2016 (r295571) @@ -140,6 +140,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_FDI", "Floppy Drive Information", "Returns a floppy drive information block"), AH_PREDEF ("_FDM", "Floppy Drive Mode", "Sets a floppy drive speed"), AH_PREDEF ("_FIF", "Fan Information", "Returns fan device information"), + AH_PREDEF ("_FIT", "Firmware Interface Table", "Returns a list of NFIT structures"), AH_PREDEF ("_FIX", "Fixed Register Resource Provider", "Returns a list of devices that implement FADT register blocks"), AH_PREDEF ("_FLC", "Flow Control", "Flow control, Resource Descriptor field"), AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), @@ -332,8 +333,10 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), - AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), + AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), + AH_PREDEF ("_WPC", "Wireless Power Calibration", "Calibrate power and notify wireless device"), + AH_PREDEF ("_WPP", "Wireless Power Polling", "Get recommended polling interval"), AH_PREDEF (NULL, NULL, NULL) }; Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmextern.c Fri Feb 12 18:53:29 2016 (r295571) @@ -754,6 +754,46 @@ AcpiDmAddPathToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmEternalIsMatch + * + * PARAMETERS: NamePath - Path to match to External Name + * ExternalPath - External NamePath to be matched + * + * RETURN: BOOLEAN + * + * DESCRIPTION: Returns TRUE if NamePath matches the last NamePath-length + * characters of ExternalPath. + * + * External (_SB_.DEV0.ABCD) will match: + * _SB_.DEV0.ABCD + * DEV0.ABCD + * ABCD + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmExternalIsMatch ( + const char * NamePath, + const char * ListNamePath) +{ + BOOLEAN Match = FALSE; + + + if (strlen (ListNamePath) >= strlen (NamePath)) + { + if (!strcmp (ListNamePath + + (strlen (ListNamePath) - strlen (NamePath)), NamePath)) + { + return (TRUE); + } + } + + return (Match); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmCreateNewExternal * * PARAMETERS: ExternalPath - External path to the object @@ -808,11 +848,14 @@ AcpiDmCreateNewExternal ( NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!strcmp (ExternalPath, NextExternal->Path)) + /* Check for duplicates */ + + if (AcpiDmExternalIsMatch (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (NextExternal->Flags & ANOBJ_IS_EXTERNAL) && (NextExternal->Value != Value) && (Value > 0)) { @@ -830,6 +873,11 @@ AcpiDmCreateNewExternal ( NextExternal->Value = Value; } + /* Update flags. */ + + NextExternal->Flags |= Flags; + NextExternal->Flags &= ~ACPI_EXT_INTERNAL_PATH_ALLOCATED; + return_ACPI_STATUS (AE_ALREADY_EXISTS); } @@ -1266,76 +1314,85 @@ appearing in an SSDT, the disassembler d the owning SSDT has been loaded via the -e option. #endif +static char ExternalWarningPart1[600]; +static char ExternalWarningPart2[400]; +static char ExternalWarningPart3[400]; +static char ExternalWarningPart4[200]; + void AcpiDmUnresolvedWarning ( UINT8 Type) { + char *Format; + char Pad[] = " *"; + char NoPad[] = ""; + if (!AcpiGbl_NumExternalMethods) { return; } + if (AcpiGbl_NumExternalMethods == AcpiGbl_ResolvedExternalMethods) + { + return; + } + + Format = Type ? Pad : NoPad; + + sprintf (ExternalWarningPart1, + "%s iASL Warning: There were %u external control methods found during\n" + "%s disassembly, but only %u %s resolved (%u unresolved). Additional\n" + "%s ACPI tables may be required to properly disassemble the code. This\n" + "%s resulting disassembler output file may not compile because the\n" + "%s disassembler did not know how many arguments to assign to the\n" + "%s unresolved methods. Note: SSDTs can be dynamically loaded at\n" + "%s runtime and may or may not be available via the host OS.\n", + Format, AcpiGbl_NumExternalMethods, Format, AcpiGbl_ResolvedExternalMethods, + (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), + (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods), + Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart2, + "%s To specify the tables needed to resolve external control method\n" + "%s references, the -e option can be used to specify the filenames.\n" + "%s Example iASL invocations:\n" + "%s iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + "%s iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + "%s iasl -e ssdt*.aml -d dsdt.aml\n", + Format, Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart3, + "%s In addition, the -fe option can be used to specify a file containing\n" + "%s control method external declarations with the associated method\n" + "%s argument counts. Each line of the file must be of the form:\n" + "%s External (, MethodObj, )\n" + "%s Invocation:\n" + "%s iasl -fe refs.txt -d dsdt.aml\n", + Format, Format, Format, Format, Format, Format); + + sprintf (ExternalWarningPart4, + "%s The following methods were unresolved and many not compile properly\n" + "%s because the disassembler had to guess at the number of arguments\n" + "%s required for each:\n", + Format, Format, Format); + if (Type) { if (!AcpiGbl_ExternalFileList) { /* The -e option was not specified */ - AcpiOsPrintf (" /*\n" - " * iASL Warning: There were %u external control methods found during\n" - " * disassembly, but additional ACPI tables to resolve these externals\n" - " * were not specified. This resulting disassembler output file may not\n" - " * compile because the disassembler did not know how many arguments\n" - " * to assign to these methods. To specify the tables needed to resolve\n" - " * external control method references, the -e option can be used to\n" - " * specify the filenames. Note: SSDTs can be dynamically loaded at\n" - " * runtime and may or may not be available via the host OS.\n" - " * Example iASL invocations:\n" - " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" - " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" - " * iasl -e ssdt*.aml -d dsdt.aml\n" - " *\n" - " * In addition, the -fe option can be used to specify a file containing\n" - " * control method external declarations with the associated method\n" - " * argument counts. Each line of the file must be of the form:\n" - " * External (, MethodObj, )\n" - " * Invocation:\n" - " * iasl -fe refs.txt -d dsdt.aml\n" - " *\n" - " * The following methods were unresolved and many not compile properly\n" - " * because the disassembler had to guess at the number of arguments\n" - " * required for each:\n" - " */\n", - AcpiGbl_NumExternalMethods); + AcpiOsPrintf (" /*\n%s *\n%s *\n%s *\n%s */\n", + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3, + ExternalWarningPart4); } - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) + else { /* The -e option was specified, but there are still some unresolved externals */ - AcpiOsPrintf (" /*\n" - " * iASL Warning: There were %u external control methods found during\n" - " * disassembly, but only %u %s resolved (%u unresolved). Additional\n" - " * ACPI tables may be required to properly disassemble the code. This\n" - " * resulting disassembler output file may not compile because the\n" - " * disassembler did not know how many arguments to assign to the\n" - " * unresolved methods. Note: SSDTs can be dynamically loaded at\n" - " * runtime and may or may not be available via the host OS.\n" - " *\n" - " * If necessary, the -fe option can be used to specify a file containing\n" - " * control method external declarations with the associated method\n" - " * argument counts. Each line of the file must be of the form:\n" - " * External (, MethodObj, )\n" - " * Invocation:\n" - " * iasl -fe refs.txt -d dsdt.aml\n" - " *\n" - " * The following methods were unresolved and many not compile properly\n" - " * because the disassembler had to guess at the number of arguments\n" - " * required for each:\n" - " */\n", - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); + AcpiOsPrintf (" /*\n%s *\n *\n */\n", + ExternalWarningPart1, ExternalWarningPart3, ExternalWarningPart4); } } else @@ -1344,50 +1401,15 @@ AcpiDmUnresolvedWarning ( { /* The -e option was not specified */ - fprintf (stderr, "\n" - "iASL Warning: There were %u external control methods found during\n" - "disassembly, but additional ACPI tables to resolve these externals\n" - "were not specified. The resulting disassembler output file may not\n" - "compile because the disassembler did not know how many arguments\n" - "to assign to these methods. To specify the tables needed to resolve\n" - "external control method references, the -e option can be used to\n" - "specify the filenames. Note: SSDTs can be dynamically loaded at\n" - "runtime and may or may not be available via the host OS.\n" - "Example iASL invocations:\n" - " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" - " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" - " iasl -e ssdt*.aml -d dsdt.aml\n" - "\n" - "In addition, the -fe option can be used to specify a file containing\n" - "control method external declarations with the associated method\n" - "argument counts. Each line of the file must be of the form:\n" - " External (, MethodObj, )\n" - "Invocation:\n" - " iasl -fe refs.txt -d dsdt.aml\n", - AcpiGbl_NumExternalMethods); + fprintf (stderr, "\n%s\n%s\n%s\n", + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3); } - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) + else { /* The -e option was specified, but there are still some unresolved externals */ - fprintf (stderr, "\n" - "iASL Warning: There were %u external control methods found during\n" - "disassembly, but only %u %s resolved (%u unresolved). Additional\n" - "ACPI tables may be required to properly disassemble the code. The\n" - "resulting disassembler output file may not compile because the\n" - "disassembler did not know how many arguments to assign to the\n" - "unresolved methods. Note: SSDTs can be dynamically loaded at\n" - "runtime and may or may not be available via the host OS.\n" - "\n" - "If necessary, the -fe option can be used to specify a file containing\n" - "control method external declarations with the associated method\n" - "argument counts. Each line of the file must be of the form:\n" - " External (, MethodObj, )\n" - "Invocation:\n" - " iasl -fe refs.txt -d dsdt.aml\n", - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); + fprintf (stderr, "\n%s\n%s\n", + ExternalWarningPart1, ExternalWarningPart3); } } } Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtable.c Fri Feb 12 18:53:29 2016 (r295571) @@ -196,6 +196,7 @@ static const char *AcpiDmHestS "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", "Generic Hardware Error Source", + "Generic Hardware Error Source V2", "Unknown Subtable Type" /* Reserved */ }; Modified: vendor-sys/acpica/dist/source/common/dmtables.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtables.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtables.c Fri Feb 12 18:53:29 2016 (r295571) @@ -145,6 +145,11 @@ AdCreateTableHeader ( UINT8 Checksum; + /* Reset globals for External statements */ + + AcpiGbl_NumExternalMethods = 0; + AcpiGbl_ResolvedExternalMethods = 0; + /* * Print file header and dump original table header */ Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 12 18:53:29 2016 (r295571) @@ -1616,6 +1616,12 @@ AcpiDmDumpHest ( SubTableLength = sizeof (ACPI_HEST_GENERIC); break; + case ACPI_HEST_TYPE_GENERIC_ERROR_V2: + + InfoTable = AcpiDmTableInfoHest10; + SubTableLength = sizeof (ACPI_HEST_GENERIC_V2); + break; + default: /* Cannot continue on unknown type - no length */ Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Feb 12 18:53:29 2016 (r295571) @@ -163,6 +163,7 @@ #define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) +#define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f) #define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) #define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) #define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f) @@ -1342,6 +1343,26 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMT_TERMINATOR }; +/* 10: Generic Hardware Error Source - Version 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] = +{ + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST10_OFFSET (RelatedSourceId), "Related Source Id", 0}, + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Enabled), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0}, + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ErrorStatusAddress), "Error Status Address", 0}, + {ACPI_DMT_HESTNTFY, ACPI_HEST10_OFFSET (Notify), "Notify", 0}, + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (ErrorBlockLength), "Error Status Block Length", 0}, + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ReadAckRegister), "Read Ack Register", 0}, + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckPreserve), "Read Ack Preserve", 0}, + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckWrite), "Read Ack Write", 0}, + ACPI_DMT_TERMINATOR +}; + ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] = { {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0}, @@ -2141,6 +2162,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG3, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Device not armed", 0}, {ACPI_DMT_FLAG4, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events observed", 0}, {ACPI_DMT_FLAG5, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events enabled", 0}, + {ACPI_DMT_FLAG6, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Mapping failed", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/source/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslanalyze.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslanalyze.c Fri Feb 12 18:53:29 2016 (r295571) @@ -308,6 +308,12 @@ AnCheckMethodReturnValue ( Node = ArgOp->Asl.Node; + if (!Node) + { + /* No error message, this can happen and is OK */ + + return; + } /* Examine the parent op of this method */ Modified: vendor-sys/acpica/dist/source/compiler/aslbtypes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslbtypes.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslbtypes.c Fri Feb 12 18:53:29 2016 (r295571) @@ -408,12 +408,25 @@ AnGetBtype ( Node = Op->Asl.Node; if (!Node) { + /* These are not expected to have a node at this time */ + + if ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEDWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEQWORDFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBYTEFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBITFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEFIELD) || + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) + { + return (ACPI_UINT32_MAX - 1); + } + DbgPrint (ASL_DEBUG_OUTPUT, "No attached Nsnode: [%s] at line %u name [%s], " - "ignoring typecheck\n", + "ignoring typecheck. Parent [%s]\n", Op->Asl.ParseOpName, Op->Asl.LineNumber, - Op->Asl.ExternalName); - return (ACPI_UINT32_MAX); + Op->Asl.ExternalName, Op->Asl.Parent->Asl.ParseOpName); + return (ACPI_UINT32_MAX - 1); } ThisNodeBtype = AnMapEtypeToBtype (Node->Type); Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Fri Feb 12 18:53:29 2016 (r295571) @@ -97,22 +97,16 @@ CgGenerateAmlOutput ( void) { - DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n"); - /* Generate the AML output file */ FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0); Gbl_SourceLine = 0; Gbl_NextError = Gbl_ErrorLog; - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, CgAmlWriteWalk, NULL, NULL); - DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", - 76, " "); - + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); CgCloseTable (); } @@ -136,40 +130,43 @@ CgAmlWriteWalk ( void *Context) { - /* - * Print header at level 0. Alignment assumes 32-bit pointers - */ - if (!Level) + /* Generate the AML for this node */ + + CgWriteNode (Op); + + if (!Gbl_DebugFlag) { - DbgPrint (ASL_TREE_OUTPUT, - "Final parse tree used for AML output:\n"); - DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", - 76, " "); + return (AE_OK); } - /* Debug output */ - - DbgPrint (ASL_TREE_OUTPUT, - "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level); - UtPrintFormattedName (Op->Asl.ParseOpcode, Level); + /* Print header at level 0. Alignment assumes 32-bit pointers */ - if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG || - Op->Asl.ParseOpcode == PARSEOP_NAMESTRING || - Op->Asl.ParseOpcode == PARSEOP_METHODCALL) + if (!Level) { DbgPrint (ASL_TREE_OUTPUT, - "%10.32s ", Op->Asl.ExternalName); + "\nFinal parse tree used for AML output:\n"); + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); } - else + + /* Dump ParseOp name and possible value */ + + switch (Op->Asl.ParseOpcode) { - DbgPrint (ASL_TREE_OUTPUT, " "); + case PARSEOP_NAMESEG: + case PARSEOP_NAMESTRING: + case PARSEOP_METHODCALL: + case PARSEOP_STRING_LITERAL: + + UtDumpStringOp (Op, Level); + break; + + default: + + UtDumpBasicOp (Op, Level); + break; } - DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG2, /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -191,9 +188,6 @@ CgAmlWriteWalk ( /* 19 */ Op->Asl.LogicalLineNumber, /* 20 */ Op->Asl.EndLogicalLine); - /* Generate the AML for this node */ - - CgWriteNode (Op); return (AE_OK); } @@ -558,7 +552,7 @@ CgCloseTable ( /* Process all definition blocks */ - Op = RootNode->Asl.Child; + Op = Gbl_ParseTreeRoot->Asl.Child; while (Op) { CgUpdateHeader (Op); @@ -590,7 +584,6 @@ CgWriteNode ( /* TBD: this may not be the best place for this check */ if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END)) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Feb 12 18:53:29 2016 (r295571) @@ -138,7 +138,7 @@ CmDoCompile ( /* Did the parse tree get successfully constructed? */ - if (!RootNode) + if (!Gbl_ParseTreeRoot) { /* * If there are no errors, then we have some sort of @@ -166,22 +166,22 @@ CmDoCompile ( LsDumpParseTree (); - OpcGetIntegerWidth (RootNode->Asl.Child); + OpcGetIntegerWidth (Gbl_ParseTreeRoot->Asl.Child); UtEndEvent (Event); /* Pre-process parse tree for any operator transforms */ Event = UtBeginEvent ("Parse tree transforms"); DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, - TrAmlTransformWalk, NULL, NULL); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); UtEndEvent (Event); /* Generate AML opcodes corresponding to the parse tokens */ Event = UtBeginEvent ("Generate AML opcodes"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeWalk, NULL); UtEndEvent (Event); @@ -203,11 +203,11 @@ CmDoCompile ( Event = UtBeginEvent ("Constant folding via AML interpreter"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nInterpreting compile-time constant expressions\n\n"); + "Interpreting compile-time constant expressions\n\n"); if (Gbl_FoldConstants) { - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, OpcAmlConstantWalk, NULL, NULL); } else @@ -220,16 +220,16 @@ CmDoCompile ( Event = UtBeginEvent ("Updating AML opcodes after constant folding"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nUpdating AML opcodes after constant folding\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + "Updating AML opcodes after constant folding\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeUpdateWalk, NULL); UtEndEvent (Event); /* Calculate all AML package lengths */ Event = UtBeginEvent ("Generate AML package lengths"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); @@ -255,7 +255,8 @@ CmDoCompile ( /* Namespace loading */ Event = UtBeginEvent ("Create ACPI Namespace"); - Status = LdLoadNamespace (RootNode); + DbgPrint (ASL_DEBUG_OUTPUT, "Creating ACPI Namespace\n\n"); + Status = LdLoadNamespace (Gbl_ParseTreeRoot); UtEndEvent (Event); if (ACPI_FAILURE (Status)) { @@ -266,6 +267,7 @@ CmDoCompile ( AslGbl_NamespaceEvent = UtBeginEvent ( "Cross reference parse tree and Namespace"); + DbgPrint (ASL_DEBUG_OUTPUT, "Cross referencing namespace\n\n"); Status = XfCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { @@ -277,6 +279,14 @@ CmDoCompile ( LkFindUnreferencedObjects (); UtEndEvent (AslGbl_NamespaceEvent); + /* Resolve External Declarations */ + + Event = UtBeginEvent ("Resolve all Externals"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); + UtEndEvent (Event); + /* * Semantic analysis. This can happen only after the * namespace has been loaded and cross-referenced. @@ -286,17 +296,30 @@ CmDoCompile ( Event = UtBeginEvent ("Analyze control method return types"); AnalysisWalkInfo.MethodStack = NULL; - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method analysis\n\n"); + + if (Gbl_CrossReferenceOutput) + { + OtPrintHeaders ("Part 1: Object Reference Map " + "(Object references from within each control method)"); + } + + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, MtMethodAnalysisWalkBegin, MtMethodAnalysisWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); + /* Generate the object cross-reference file if requested */ + + Event = UtBeginEvent ("Generate cross-reference file"); + OtCreateXrefFile (); + UtEndEvent (Event); + /* Semantic error checking part two - typing of method returns */ Event = UtBeginEvent ("Determine object types returned by methods"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method typing\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnMethodTypingWalkEnd, NULL); UtEndEvent (Event); @@ -304,10 +327,10 @@ CmDoCompile ( Event = UtBeginEvent ("Analyze AML operand types"); DbgPrint (ASL_DEBUG_OUTPUT, - "\nSemantic analysis - Operand type checking\n\n"); + "Semantic analysis - Operand type checking\n\n"); if (Gbl_DoTypechecking) { - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); } UtEndEvent (Event); @@ -315,8 +338,8 @@ CmDoCompile ( /* Semantic error checking part four - other miscellaneous checks */ Event = UtBeginEvent ("Miscellaneous analysis"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - miscellaneous\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, AnOtherSemanticAnalysisWalkBegin, NULL, &AnalysisWalkInfo); UtEndEvent (Event); @@ -324,16 +347,17 @@ CmDoCompile ( /* Calculate all AML package lengths */ Event = UtBeginEvent ("Finish AML package length generation"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnInitLengthsWalk, NULL); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); /* Code generation - emit the AML */ Event = UtBeginEvent ("Generate AML code and write output files"); + DbgPrint (ASL_DEBUG_OUTPUT, "Writing AML byte code\n\n"); CgGenerateAmlOutput (); UtEndEvent (Event); @@ -816,7 +840,7 @@ CmDeleteCaches ( Gbl_ParseOpCount = 0; Gbl_ParseOpCacheNext = NULL; Gbl_ParseOpCacheLast = NULL; - RootNode = NULL; + Gbl_ParseTreeRoot = NULL; /* Generic string cache */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Feb 12 18:19:32 2016 (r295570) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Feb 12 18:53:29 2016 (r295571) @@ -652,7 +652,13 @@ ApCheckPackage ( * asltransform - parse tree transformations */ ACPI_STATUS -TrAmlTransformWalk ( +TrAmlTransformWalkBegin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +ACPI_STATUS +TrAmlTransformWalkEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); @@ -669,6 +675,25 @@ TrWalkParseTree ( ASL_WALK_CALLBACK AscendingCallback, void *Context); +/* + * aslexternal - External opcode support + */ +ACPI_STATUS +ExAmlExternalWalkBegin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +ACPI_STATUS +ExAmlExternalWalkEnd ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +void +ExDoExternal ( + ACPI_PARSE_OBJECT *Op); + /* Values for "Visitation" parameter above */ #define ASL_WALK_VISIT_DOWNWARD 0x01 @@ -909,6 +934,24 @@ XfCrossReferenceNamespace ( /* + * aslxrefout + */ +void +OtPrintHeaders ( + char *Message); + +void +OtCreateXrefFile ( + void); + +void +OtXrefWalkPart1 ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + ASL_METHOD_INFO *MethodInfo); + + +/* * aslutils - common compiler utilites */ void @@ -923,11 +966,31 @@ DbgPrint ( #define ASL_PARSE_OUTPUT 1 #define ASL_TREE_OUTPUT 2 +UINT8 +UtIsBigEndianMachine ( + void); + BOOLEAN UtQueryForOverwrite ( char *Pathname); void +UtDumpStringOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level); + +void +UtDumpIntegerOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + UINT32 IntegerLength); + +void +UtDumpBasicOp ( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Feb 12 18:54:22 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA3EAA785F; Fri, 12 Feb 2016 18:54:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 346AD15F5; Fri, 12 Feb 2016 18:54:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1CIsLxM094945; Fri, 12 Feb 2016 18:54:21 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1CIsLCo094944; Fri, 12 Feb 2016 18:54:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602121854.u1CIsLCo094944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 12 Feb 2016 18:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295572 - vendor-sys/acpica/20160212 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:54:22 -0000 Author: jkim Date: Fri Feb 12 18:54:21 2016 New Revision: 295572 URL: https://svnweb.freebsd.org/changeset/base/295572 Log: Tag ACPICA 20160212. Added: vendor-sys/acpica/20160212/ - copied from r295571, vendor-sys/acpica/dist/ From owner-svn-src-vendor@freebsd.org Sat Feb 13 14:57:13 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0BDAA7E9A; Sat, 13 Feb 2016 14:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76F9A1BF8; Sat, 13 Feb 2016 14:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEvCkb050285; Sat, 13 Feb 2016 14:57:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEvAWO050264; Sat, 13 Feb 2016 14:57:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131457.u1DEvAWO050264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295590 - in vendor/llvm/dist: cmake/modules docs include/llvm/IR lib/Analysis lib/CodeGen/AsmPrinter lib/IR lib/Target/AArch64 lib/Target/AMDGPU lib/Target/AMDGPU/Utils lib/Target/ARM ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:57:13 -0000 Author: dim Date: Sat Feb 13 14:57:10 2016 New Revision: 295590 URL: https://svnweb.freebsd.org/changeset/base/295590 Log: Vendor import of llvm release_38 branch r260756: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260756 Added: vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td vendor/llvm/dist/test/CodeGen/AMDGPU/spill-scavenge-offset.ll vendor/llvm/dist/test/CodeGen/PowerPC/inline-asm-s-modifier.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26193.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26356.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr26381.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-cmp-53.ll vendor/llvm/dist/test/DebugInfo/X86/PR26148.ll Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/cmake/modules/LLVM-Config.cmake vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td vendor/llvm/dist/include/llvm/IR/Value.h vendor/llvm/dist/lib/Analysis/DemandedBits.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/IR/Value.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/Processors.td vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/test/Analysis/DemandedBits/basic.ll vendor/llvm/dist/test/CodeGen/AArch64/fp16-v4-instructions.ll vendor/llvm/dist/test/CodeGen/AArch64/fp16-v8-instructions.ll vendor/llvm/dist/test/CodeGen/AMDGPU/hsa-note-no-func.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.SI.fs.interp.ll vendor/llvm/dist/test/CodeGen/ARM/shifter_operand.ll vendor/llvm/dist/test/CodeGen/PowerPC/fast-isel-ret.ll vendor/llvm/dist/test/CodeGen/X86/avx512-gather-scatter-intrin.ll vendor/llvm/dist/test/CodeGen/X86/setcc-lowering.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp.ll vendor/llvm/dist/test/Transforms/InstCombine/insert-extract-shuffle.ll vendor/llvm/dist/test/Transforms/InstCombine/unpack-fca.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll vendor/llvm/dist/tools/CMakeLists.txt vendor/llvm/dist/utils/release/test-release.sh vendor/llvm/dist/utils/unittest/CMakeLists.txt vendor/llvm/dist/utils/unittest/UnitTestMain/CMakeLists.txt Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Sat Feb 13 14:57:10 2016 (r295590) @@ -468,20 +468,23 @@ function(llvm_add_library name) endif() endif() - # Add the explicit dependency information for this library. - # - # It would be nice to verify that we have the dependencies for this library - # name, but using get_property(... SET) doesn't suffice to determine if a - # property has been set to an empty value. - get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name}) - - if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_STATIC AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB) - set(llvm_libs LLVM) - else() - llvm_map_components_to_libnames(llvm_libs - ${ARG_LINK_COMPONENTS} - ${LLVM_LINK_COMPONENTS} - ) + if (DEFINED LLVM_LINK_COMPONENTS OR DEFINED ARG_LINK_COMPONENTS) + if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB) + set(llvm_libs LLVM) + else() + llvm_map_components_to_libnames(llvm_libs + ${ARG_LINK_COMPONENTS} + ${LLVM_LINK_COMPONENTS} + ) + endif() + else() + # Components have not been defined explicitly in CMake, so add the + # dependency information for this library as defined by LLVMBuild. + # + # It would be nice to verify that we have the dependencies for this library + # name, but using get_property(... SET) doesn't suffice to determine if a + # property has been set to an empty value. + get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name}) endif() if(CMAKE_VERSION VERSION_LESS 2.8.12) @@ -882,14 +885,11 @@ function(add_unittest test_suite test_na set(LLVM_REQUIRES_RTTI OFF) + list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN}) set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir}) - target_link_libraries(${test_name} - gtest - gtest_main - LLVMSupport # gtest needs it for raw_ostream. - ) + target_link_libraries(${test_name} gtest_main gtest) add_dependencies(${test_suite} ${test_name}) get_target_property(test_suite_folder ${test_suite} FOLDER) Modified: vendor/llvm/dist/cmake/modules/LLVM-Config.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/LLVM-Config.cmake Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/cmake/modules/LLVM-Config.cmake Sat Feb 13 14:57:10 2016 (r295590) @@ -40,10 +40,19 @@ macro(llvm_config executable) # done in case libLLVM does not contain all of the components # the target requires. # - # TODO strip LLVM_DYLIB_COMPONENTS out of link_components. + # Strip LLVM_DYLIB_COMPONENTS out of link_components. # To do this, we need special handling for "all", since that # may imply linking to libraries that are not included in # libLLVM. + + if (DEFINED link_components AND DEFINED LLVM_DYLIB_COMPONENTS) + if("${LLVM_DYLIB_COMPONENTS}" STREQUAL "all") + set(link_components "") + else() + list(REMOVE_ITEM link_components ${LLVM_DYLIB_COMPONENTS}) + endif() + endif() + target_link_libraries(${executable} LLVM) endif() Modified: vendor/llvm/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.rst Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/docs/ReleaseNotes.rst Sat Feb 13 14:57:10 2016 (r295590) @@ -5,11 +5,6 @@ LLVM 3.8 Release Notes .. contents:: :local: -.. warning:: - These are in-progress notes for the upcoming LLVM 3.8 release. You may - prefer the `LLVM 3.7 Release Notes `_. - Introduction ============ @@ -26,11 +21,6 @@ have questions or comments, the `LLVM De `_ is a good place to send them. -Note that if you are reading this file from a Subversion checkout or the main -LLVM web page, this document applies to the *next* release, not the current -one. To see the release notes for a specific release, please see the `releases -page `_. - Non-comprehensive list of changes in this release ================================================= * With this release, the minimum Windows version required for running LLVM is @@ -79,6 +69,26 @@ Non-comprehensive list of changes in thi * Support for dematerializing has been dropped. +* RegisterScheduler::setDefault was removed. Targets that used to call into the + command line parser to set the DAGScheduler, and that don't have enough + control with setSchedulingPreference, should look into overriding the + SubTargetHook "getDAGScheduler()". + +* ``ilist_iterator`` no longer has implicit conversions to and from ``T*``, + since ``ilist_iterator`` may be pointing at the sentinel (which is usually + not of type ``T`` at all). To convert from an iterator ``I`` to a pointer, + use ``&*I``; to convert from a pointer ``P`` to an iterator, use + ``P->getIterator()``. Alternatively, explicit conversions via + ``static_cast(U)`` are still available. + +* ``ilist_node::getNextNode()`` and ``ilist_node::getPrevNode()`` now + fail at compile time when the node cannot access its parent list. + Previously, when the sentinel was was an ``ilist_half_node``, this API + could return the sentinal instead of ``nullptr``. Frustrated callers should + be updated to use ``iplist::getNextNode(T*)`` instead. Alternatively, if + the node ``N`` is guaranteed not to be the last in the list, it is safe to + call ``&*++N->getIterator()`` directly. + .. NOTE For small 1-3 sentence descriptions, just add an entry at the end of this list. If your description won't fit comfortably in one bullet @@ -98,17 +108,97 @@ Non-comprehensive list of changes in thi Makes programs 10x faster by doing Special New Thing. -Changes to the ARM Backend --------------------------- - During this release ... +Changes to the ARM Backends +--------------------------- + +During this release the AArch64 target has: + +* Added support for more sanitizers (MSAN, TSAN) and made them compatible with + all VMA kernel configurations (kurrently tested on 39 and 42 bits). +* Gained initial LLD support in the new ELF back-end +* Extended the Load/Store optimiser and cleaned up some of the bad decisions + made earlier. +* Expanded LLDB support, including watchpoints, native building, Renderscript, + LLDB-server, debugging 32-bit applications. +* Added support for the ``Exynos M1`` chip. + +During this release the ARM target has: + +* Gained massive performance improvements on embedded benchmarks due to finally + running the stride vectorizer in full form, incrementing the performance gains + that we already had in the previous releases with limited stride vectorization. +* Expanded LLDB support, including watchpoints, unwind tables +* Extended the Load/Store optimiser and cleaned up some of the bad decisions + made earlier. +* Simplified code generation for global variable addresses in ELF, resulting in + a significant (4% in Chromium) reduction in code size. +* Gained some additional code size improvements, though there's still a long road + ahead, especially for older cores. +* Added some EABI floating point comparison functions to Compiler-RT +* Added support for Windows+GNU triple, +features in -mcpu/-march options. Changes to the MIPS Target -------------------------- - During this release ... +During this release the MIPS target has: + +* Significantly extended support for the Integrated Assembler. See below for + more information +* Added support for the ``P5600`` processor. +* Added support for the ``interrupt`` attribute for MIPS32R2 and later. This + attribute will generate a function which can be used as a interrupt handler + on bare metal MIPS targets using the static relocation model. +* Added support for the ``ERETNC`` instruction found in MIPS32R5 and later. +* Added support for OpenCL. See http://portablecl.org/. + + * Address spaces 1 to 255 are now reserved for software use and conversions + between them are no-op casts. + +* Removed the ``mips16`` value for the -mcpu option since it is an :abbr:`ASE + (Application Specific Extension)` and not a processor. If you were using this, + please specify another CPU and use ``-mips16`` to enable MIPS16. +* Removed ``copy_u.w`` from 32-bit MSA and ``copy_u.d`` from 64-bit MSA since + they have been removed from the MSA specification due to forward compatibility + issues. For example, 32-bit MSA code containing ``copy_u.w`` would behave + differently on a 64-bit processor supporting MSA. The corresponding intrinsics + are still available and may expand to ``copy_s.[wd]`` where this is + appropriate for forward compatibility purposes. +* Relaxed the ``-mnan`` option to allow ``-mnan=2008`` on MIPS32R2/MIPS64R2 for + compatibility with GCC. +* Made MIPS64R6 the default CPU for 64-bit Android triples. + +The MIPS target has also fixed various bugs including the following notable +fixes: + +* Fixed reversed operands on ``mthi``/``mtlo`` in the DSP :abbr:`ASE + (Application Specific Extension)`. +* The code generator no longer uses ``jal`` for calls to absolute immediate + addresses. +* Disabled fast instruction selection on MIPS32R6 and MIPS64R6 since this is not + yet supported. +* Corrected addend for ``R_MIPS_HI16`` and ``R_MIPS_PCHI16`` in MCJIT +* The code generator no longer crashes when handling subregisters of an 64-bit + FPU register with undefined value. +* The code generator no longer attempts to use ``$zero`` for operands that do + not permit ``$zero``. +* Corrected the opcode used for ``ll``/``sc`` when using MIPS32R6/MIPS64R6 and + the Integrated Assembler. +* Added support for atomic load and atomic store. +* Corrected debug info when dynamically re-aligning the stack. + +Integrated Assembler +^^^^^^^^^^^^^^^^^^^^ +We have made a large number of improvements to the integrated assembler for +MIPS. In this release, the integrated assembler isn't quite production-ready +since there are a few known issues related to bare-metal support, checking +immediates on instructions, and the N32/N64 ABI's. However, the current support +should be sufficient for many users of the O32 ABI, particularly those targeting +MIPS32 on Linux or bare-metal MIPS32. +If you would like to try the integrated assembler, please use +``-fintegrated-as``. Changes to the PowerPC Target ----------------------------- @@ -123,6 +213,20 @@ Changes to the X86 Target * TLS is enabled for Cygwin as emutls. +* Smaller code for materializing 32-bit 1 and -1 constants at ``-Os``. + +* More efficient code for wide integer compares. (E.g. 64-bit compares + on 32-bit targets.) + +* Tail call support for ``thiscall``, ``stdcall`, ``vectorcall``, and + ``fastcall`` functions. + +Changes to the AVR Target +------------------------- + +Slightly less than half of the AVR backend has been merged in at this point. It is still +missing a number large parts which cause it to be unusable, but is well on the +road to being completely merged and workable. Changes to the OCaml bindings ----------------------------- @@ -140,7 +244,19 @@ An exciting aspect of LLVM is that it is a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 3.8. -* A project +LDC - the LLVM-based D compiler +------------------------------- + +`D `_ is a language with C-like syntax and static typing. It +pragmatically combines efficiency, control, and modeling power, with safety and +programmer productivity. D supports powerful concepts like Compile-Time Function +Execution (CTFE) and Template Meta-Programming, provides an innovative approach +to concurrency and offers many classical paradigms. + +`LDC `_ uses the frontend from the reference compiler +combined with LLVM as backend to produce efficient native code. LDC targets +x86/x86_64 systems like Linux, OS X and Windows and also PowerPC (32/64 bit) +and ARM. Ports to other architectures like AArch64 and MIPS64 are underway. Additional Information Modified: vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td ============================================================================== --- vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td Sat Feb 13 14:57:10 2016 (r295590) @@ -484,7 +484,7 @@ let TargetPrefix = "ppc" in { // All PP Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; def int_ppc_altivec_vpkswss : GCCBuiltin<"__builtin_altivec_vpkswss">, - Intrinsic<[llvm_v16i8_ty], [llvm_v4i32_ty, llvm_v4i32_ty], + Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>; def int_ppc_altivec_vpkswus : GCCBuiltin<"__builtin_altivec_vpkswus">, Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], Modified: vendor/llvm/dist/include/llvm/IR/Value.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/Value.h Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/include/llvm/IR/Value.h Sat Feb 13 14:57:10 2016 (r295590) @@ -280,11 +280,7 @@ public: // when using them since you might not get all uses. // The methods that don't start with materialized_ assert that modules is // fully materialized. -#ifdef NDEBUG - void assertModuleIsMaterialized() const {} -#else void assertModuleIsMaterialized() const; -#endif bool use_empty() const { assertModuleIsMaterialized(); Modified: vendor/llvm/dist/lib/Analysis/DemandedBits.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -242,13 +242,6 @@ void DemandedBits::determineLiveOperandB if (OperandNo != 0) AB = AOut; break; - case Instruction::ICmp: - // Count the number of leading zeroes in each operand. - ComputeKnownBits(BitWidth, UserI->getOperand(0), UserI->getOperand(1)); - auto NumLeadingZeroes = std::min(KnownZero.countLeadingOnes(), - KnownZero2.countLeadingOnes()); - AB = ~APInt::getHighBitsSet(BitWidth, NumLeadingZeroes); - break; } } Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -555,6 +555,11 @@ bool AsmPrinter::PrintAsmOperand(const M return true; O << -MO.getImm(); return false; + case 's': // The GCC deprecated s modifier + if (MO.getType() != MachineOperand::MO_Immediate) + return true; + O << ((32 - MO.getImm()) & 31); + return false; } } return true; Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -793,16 +793,27 @@ static DebugLocEntry::Value getDebugLocV llvm_unreachable("Unexpected 4-operand DBG_VALUE instruction!"); } -/// Determine whether two variable pieces overlap. -static bool piecesOverlap(const DIExpression *P1, const DIExpression *P2) { - if (!P1->isBitPiece() || !P2->isBitPiece()) - return true; +// Determine the relative position of the pieces described by P1 and P2. +// Returns -1 if P1 is entirely before P2, 0 if P1 and P2 overlap, +// 1 if P1 is entirely after P2. +static int pieceCmp(const DIExpression *P1, const DIExpression *P2) { unsigned l1 = P1->getBitPieceOffset(); unsigned l2 = P2->getBitPieceOffset(); unsigned r1 = l1 + P1->getBitPieceSize(); unsigned r2 = l2 + P2->getBitPieceSize(); - // True where [l1,r1[ and [r1,r2[ overlap. - return (l1 < r2) && (l2 < r1); + if (r1 <= l2) + return -1; + else if (r2 <= l1) + return 1; + else + return 0; +} + +/// Determine whether two variable pieces overlap. +static bool piecesOverlap(const DIExpression *P1, const DIExpression *P2) { + if (!P1->isBitPiece() || !P2->isBitPiece()) + return true; + return pieceCmp(P1, P2) == 0; } /// \brief If this and Next are describing different pieces of the same @@ -811,14 +822,32 @@ static bool piecesOverlap(const DIExpres /// Return true if the merge was successful. bool DebugLocEntry::MergeValues(const DebugLocEntry &Next) { if (Begin == Next.Begin) { - auto *Expr = cast_or_null(Values[0].Expression); - auto *NextExpr = cast_or_null(Next.Values[0].Expression); - if (Expr->isBitPiece() && NextExpr->isBitPiece() && - !piecesOverlap(Expr, NextExpr)) { - addValues(Next.Values); - End = Next.End; - return true; + auto *FirstExpr = cast(Values[0].Expression); + auto *FirstNextExpr = cast(Next.Values[0].Expression); + if (!FirstExpr->isBitPiece() || !FirstNextExpr->isBitPiece()) + return false; + + // We can only merge entries if none of the pieces overlap any others. + // In doing so, we can take advantage of the fact that both lists are + // sorted. + for (unsigned i = 0, j = 0; i < Values.size(); ++i) { + for (; j < Next.Values.size(); ++j) { + int res = pieceCmp(cast(Values[i].Expression), + cast(Next.Values[j].Expression)); + if (res == 0) // The two expressions overlap, we can't merge. + return false; + // Values[i] is entirely before Next.Values[j], + // so go back to the next entry of Values. + else if (res == -1) + break; + // Next.Values[j] is entirely before Values[i], so go on to the + // next entry of Next.Values. + } } + + addValues(Next.Values); + End = Next.End; + return true; } return false; } Modified: vendor/llvm/dist/lib/IR/Value.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/Value.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/IR/Value.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -313,8 +313,8 @@ void Value::takeName(Value *V) { ST->reinsertValue(this); } -#ifndef NDEBUG void Value::assertModuleIsMaterialized() const { +#ifndef NDEBUG const GlobalValue *GV = dyn_cast(this); if (!GV) return; @@ -322,8 +322,10 @@ void Value::assertModuleIsMaterialized() if (!M) return; assert(M->isMaterialized()); +#endif } +#ifndef NDEBUG static bool contains(SmallPtrSetImpl &Cache, ConstantExpr *Expr, Constant *C) { if (!Cache.insert(Expr).second) Modified: vendor/llvm/dist/lib/Target/AArch64/AArch64.td ============================================================================== --- vendor/llvm/dist/lib/Target/AArch64/AArch64.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64.td Sat Feb 13 14:57:10 2016 (r295590) @@ -90,6 +90,7 @@ def AArch64InstrInfo : InstrInfo; include "AArch64SchedA53.td" include "AArch64SchedA57.td" include "AArch64SchedCyclone.td" +include "AArch64SchedM1.td" def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", "Cortex-A35 ARM processors", @@ -144,8 +145,7 @@ def : ProcessorModel<"cortex-a57", Corte // FIXME: Cortex-A72 is currently modelled as an Cortex-A57. def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>; def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>; -// FIXME: Exynos-M1 is currently modelled without a specific SchedModel. -def : ProcessorModel<"exynos-m1", NoSchedModel, [ProcExynosM1]>; +def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>; //===----------------------------------------------------------------------===// // Assembly parser Modified: vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -6689,6 +6689,9 @@ SDValue AArch64TargetLowering::LowerVSET return DAG.getSExtOrTrunc(Cmp, dl, Op.getValueType()); } + if (LHS.getValueType().getVectorElementType() == MVT::f16) + return SDValue(); + assert(LHS.getValueType().getVectorElementType() == MVT::f32 || LHS.getValueType().getVectorElementType() == MVT::f64); Added: vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td Sat Feb 13 14:57:10 2016 (r295590) @@ -0,0 +1,359 @@ +//=- AArch64SchedM1.td - Samsung Exynos-M1 Scheduling Defs ---*- tablegen -*-=// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the machine model for Samsung Exynos-M1 to support +// instruction scheduling and other instruction cost heuristics. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// The Exynos-M1 is a traditional superscalar microprocessor with a +// 4-wide in-order stage for decode and dispatch and a wider issue stage. +// The execution units and loads and stores are out-of-order. + +def ExynosM1Model : SchedMachineModel { + let IssueWidth = 4; // Up to 4 uops per cycle. + let MinLatency = 0; // OoO. + let MicroOpBufferSize = 96; // ROB size. + let LoopMicroOpBufferSize = 32; // Instruction queue size. + let LoadLatency = 4; // Optimistic load cases. + let MispredictPenalty = 14; // Minimum branch misprediction penalty. + let CompleteModel = 0; // Use the default model otherwise. +} + +//===----------------------------------------------------------------------===// +// Define each kind of processor resource and number available on the Exynos-M1, +// which has 9 pipelines, each with its own queue with out-of-order dispatch. + +def M1UnitA : ProcResource<2>; // Simple integer +def M1UnitC : ProcResource<1>; // Simple and complex integer +def M1UnitB : ProcResource<2>; // Branch +def M1UnitL : ProcResource<1>; // Load +def M1UnitS : ProcResource<1>; // Store +def M1PipeF0 : ProcResource<1>; // FP #0 +def M1PipeF1 : ProcResource<1>; // FP #1 + +let Super = M1PipeF0 in { + def M1UnitFMAC : ProcResource<1>; // FP multiplication + def M1UnitFCVT : ProcResource<1>; // FP conversion + def M1UnitNAL0 : ProcResource<1>; // Simple vector. + def M1UnitNMISC : ProcResource<1>; // Miscellanea + def M1UnitNCRYPT : ProcResource<1>; // Cryptographic +} + +let Super = M1PipeF1 in { + def M1UnitFADD : ProcResource<1>; // Simple FP + let BufferSize = 1 in + def M1UnitFVAR : ProcResource<1>; // FP division & square root (serialized) + def M1UnitNAL1 : ProcResource<1>; // Simple vector. + def M1UnitFST : ProcResource<1>; // FP store +} + +let SchedModel = ExynosM1Model in { + def M1UnitALU : ProcResGroup<[M1UnitA, + M1UnitC]>; // All simple integer. + def M1UnitNALU : ProcResGroup<[M1UnitNAL0, + M1UnitNAL1]>; // All simple vector. +} + +let SchedModel = ExynosM1Model in { + +//===----------------------------------------------------------------------===// +// Coarse scheduling model for the Exynos-M1. + +// Branch instructions. +// TODO: Non-conditional direct branches take zero cycles and units. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +// TODO: Branch and link is much different. + +// Arithmetic and logical integer instructions. +def : WriteRes { let Latency = 1; } +// TODO: Shift over 3 and some extensions take 2 cycles. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +// Move instructions. +def : WriteRes { let Latency = 1; } + +// Divide and multiply instructions. +// TODO: Division blocks the divider inside C. +def : WriteRes { let Latency = 13; } +def : WriteRes { let Latency = 21; } +// TODO: Long multiplication take 5 cycles and also the ALU. +// TODO: Multiplication with accumulation can be advanced. +def : WriteRes { let Latency = 3; } +// TODO: 64-bit multiplication has a throughput of 1/2. +def : WriteRes { let Latency = 4; } + +// Miscellaneous instructions. +def : WriteRes { let Latency = 2; } + +// TODO: The latency for the post or pre register is 1 cycle. +def : WriteRes { let Latency = 0; } + +// Load instructions. +def : WriteRes { let Latency = 4; } +// TODO: Extended address requires also the ALU. +def : WriteRes { let Latency = 5; } +def : WriteRes { let Latency = 4; } + +// Store instructions. +def : WriteRes { let Latency = 1; } +// TODO: Extended address requires also the ALU. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +// FP data instructions. +def : WriteRes { let Latency = 3; } +// TODO: FCCMP is much different. +def : WriteRes { let Latency = 4; } +// TODO: DP takes longer. +def : WriteRes { let Latency = 15; } +// TODO: MACC takes longer. +def : WriteRes { let Latency = 4; } + +// FP miscellaneous instructions. +// TODO: Conversion between register files is much different. +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 1; } +// TODO: Copy from FPR to GPR is much different. +def : WriteRes { let Latency = 4; } + +// FP load instructions. +// TODO: ASIMD loads are much different. +def : WriteRes { let Latency = 5; } + +// FP store instructions. +// TODO: ASIMD stores are much different. +def : WriteRes { let Latency = 1; } + +// ASIMD FP instructions. +// TODO: Other operations are much different. +def : WriteRes { let Latency = 3; } + +// Other miscellaneous instructions. +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 1; } + +//===----------------------------------------------------------------------===// +// Fast forwarding. + +// TODO: Add FP register forwarding rules. + +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +// Integer multiply-accumulate. +// TODO: The forwarding for WriteIM64 saves actually 3 cycles. +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; + +//===----------------------------------------------------------------------===// +// Finer scheduling model for the Exynos-M1. + +def M1WriteNEONA : SchedWriteRes<[M1UnitNALU, + M1UnitNALU, + M1UnitFADD]> { let Latency = 9; } +def M1WriteNEONB : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 5; } +def M1WriteNEONC : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 6; } +def M1WriteNEOND : SchedWriteRes<[M1UnitNALU, + M1UnitFST, + M1UnitL]> { let Latency = 10; } +def M1WriteNEONE : SchedWriteRes<[M1UnitFCVT, + M1UnitFST]> { let Latency = 8; } +def M1WriteNEONF : SchedWriteRes<[M1UnitFCVT, + M1UnitFST, + M1UnitL]> { let Latency = 13; } +def M1WriteNEONG : SchedWriteRes<[M1UnitNMISC, + M1UnitFST]> { let Latency = 6; } +def M1WriteNEONH : SchedWriteRes<[M1UnitNALU, + M1UnitFST]> { let Latency = 3; } +def M1WriteNEONI : SchedWriteRes<[M1UnitFST, + M1UnitL]> { let Latency = 9; } +def M1WriteALU1 : SchedWriteRes<[M1UnitALU]> { let Latency = 1; } +def M1WriteB : SchedWriteRes<[M1UnitB]> { let Latency = 1; } +// FIXME: This is the worst case, conditional branch and link. +def M1WriteBL : SchedWriteRes<[M1UnitB, + M1UnitALU]> { let Latency = 1; } +// FIXME: This is the worst case, when using LR. +def M1WriteBLR : SchedWriteRes<[M1UnitB, + M1UnitALU, + M1UnitALU]> { let Latency = 2; } +def M1WriteC1 : SchedWriteRes<[M1UnitC]> { let Latency = 1; } +def M1WriteC2 : SchedWriteRes<[M1UnitC]> { let Latency = 2; } +def M1WriteFADD3 : SchedWriteRes<[M1UnitFADD]> { let Latency = 3; } +def M1WriteFCVT3 : SchedWriteRes<[M1UnitFCVT]> { let Latency = 3; } +def M1WriteFCVT4 : SchedWriteRes<[M1UnitFCVT]> { let Latency = 4; } +def M1WriteFMAC4 : SchedWriteRes<[M1UnitFMAC]> { let Latency = 4; } +def M1WriteFMAC5 : SchedWriteRes<[M1UnitFMAC]> { let Latency = 5; } +def M1WriteFVAR15 : SchedWriteRes<[M1UnitFVAR]> { let Latency = 15; } +def M1WriteFVAR23 : SchedWriteRes<[M1UnitFVAR]> { let Latency = 23; } +def M1WriteNALU1 : SchedWriteRes<[M1UnitNALU]> { let Latency = 1; } +def M1WriteNALU2 : SchedWriteRes<[M1UnitNALU]> { let Latency = 2; } +def M1WriteNAL11 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 1; } +def M1WriteNAL12 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 2; } +def M1WriteNAL13 : SchedWriteRes<[M1UnitNAL1]> { let Latency = 3; } +def M1WriteNCRYPT1 : SchedWriteRes<[M1UnitNCRYPT]> { let Latency = 1; } +def M1WriteNCRYPT5 : SchedWriteRes<[M1UnitNCRYPT]> { let Latency = 5; } +def M1WriteNMISC1 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 1; } +def M1WriteNMISC2 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 2; } +def M1WriteNMISC3 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 3; } +def M1WriteNMISC4 : SchedWriteRes<[M1UnitNMISC]> { let Latency = 4; } +def M1WriteS4 : SchedWriteRes<[M1UnitS]> { let Latency = 4; } +def M1WriteTB : SchedWriteRes<[M1UnitC, + M1UnitALU]> { let Latency = 2; } + +// Branch instructions +def : InstRW<[M1WriteB ], (instrs Bcc)>; +def : InstRW<[M1WriteBL], (instrs BL)>; +def : InstRW<[M1WriteBLR], (instrs BLR)>; +def : InstRW<[M1WriteC1], (instregex "^CBN?Z[WX]")>; +def : InstRW<[M1WriteTB], (instregex "^TBN?Z[WX]")>; + +// Arithmetic and logical integer instructions. +def : InstRW<[M1WriteALU1], (instrs COPY)>; + +// Divide and multiply instructions. + +// Miscellaneous instructions. + +// Load instructions. + +// Store instructions. + +// FP data instructions. +def : InstRW<[M1WriteNALU1], (instregex "^F(ABS|NEG)[DS]r")>; +def : InstRW<[M1WriteFADD3], (instregex "^F(ADD|SUB)[DS]rr")>; +def : InstRW<[M1WriteNEONG], (instregex "^FCCMPE?[DS]rr")>; +def : InstRW<[M1WriteNMISC4], (instregex "^FCMPE?[DS]r")>; +def : InstRW<[M1WriteFVAR15], (instrs FDIVSrr)>; +def : InstRW<[M1WriteFVAR23], (instrs FDIVDrr)>; +def : InstRW<[M1WriteNMISC2], (instregex "^F(MAX|MIN).+rr")>; +def : InstRW<[M1WriteFMAC4], (instregex "^FN?MUL[DS]rr")>; +def : InstRW<[M1WriteFMAC5], (instregex "^FN?M(ADD|SUB)[DS]rrr")>; +def : InstRW<[M1WriteFCVT3], (instregex "^FRINT.+r")>; +def : InstRW<[M1WriteNEONH], (instregex "^FCSEL[DS]rrr")>; +def : InstRW<[M1WriteFVAR15], (instrs FSQRTSr)>; +def : InstRW<[M1WriteFVAR23], (instrs FSQRTDr)>; + +// FP miscellaneous instructions. +def : InstRW<[M1WriteFCVT3], (instregex "^FCVT[DS][DS]r")>; +def : InstRW<[M1WriteNEONF], (instregex "^[FSU]CVT[AMNPZ][SU](_Int)?[SU]?[XW]?[DS]?[rds]i?")>; +def : InstRW<[M1WriteNEONE], (instregex "^[SU]CVTF[SU]")>; +def : InstRW<[M1WriteNALU1], (instregex "^FMOV[DS][ir]")>; +def : InstRW<[M1WriteS4], (instregex "^FMOV[WX][DS](High)?r")>; +def : InstRW<[M1WriteNEONI], (instregex "^FMOV[DS][WX](High)?r")>; + +// FP load instructions. + +// FP store instructions. + +// ASIMD instructions. +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]ABAL?v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[SU]ABDL?v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^(SQ)?ABSv")>; +def : InstRW<[M1WriteNMISC1], (instregex "^SQNEGv")>; +def : InstRW<[M1WriteNALU1], (instregex "^(ADD|NEG|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?H(ADD|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?AD[AD](L|LP|P|W)V?2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]?SUB[LW]2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^R?(ADD|SUB)HN?2?v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]+Q(ADD|SUB)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU]RHADDv")>; +def : InstRW<[M1WriteNMISC1], (instregex "^CM(EQ|GE|GT|HI|HS|LE|LT)v")>; +def : InstRW<[M1WriteNALU1], (instregex "^CMTSTv")>; +def : InstRW<[M1WriteNALU1], (instregex "^(AND|BIC|EOR|MVNI|NOT|ORN|ORR)v")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[SU](MIN|MAX)v")>; +def : InstRW<[M1WriteNMISC2], (instregex "^[SU](MIN|MAX)Pv")>; +def : InstRW<[M1WriteNMISC3], (instregex "^[SU](MIN|MAX)Vv")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(MUL|SQR?DMULH)v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^ML[AS]v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(S|U|SQD|SQRD)ML[AS][HL]v")>; +def : InstRW<[M1WriteNMISC4], (instregex "^(S|U|SQD)MULLv")>; +def : InstRW<[M1WriteNAL13], (instregex "^(S|SR|U|UR)SRAv")>; +def : InstRW<[M1WriteNALU1], (instregex "^[SU]?SH(L|LL|R)2?v")>; +def : InstRW<[M1WriteNALU1], (instregex "^S[LR]Iv")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU]?(Q|QR|R)?SHR(N|U|UN)?2?v")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU](Q|QR|R)SHLU?v")>; + +// ASIMD FP instructions. +def : InstRW<[M1WriteNALU1], (instregex "^F(ABS|NEG)v")>; +def : InstRW<[M1WriteNMISC3], (instregex "^F(ABD|ADD|SUB)v")>; +def : InstRW<[M1WriteNEONA], (instregex "^FADDP")>; +def : InstRW<[M1WriteNMISC1], (instregex "^F(AC|CM)(EQ|GE|GT|LE|LT)v[^1]")>; +def : InstRW<[M1WriteFCVT3], (instregex "^[FVSU]CVTX?[AFLMNPZ][SU]?(_Int)?v")>; +def : InstRW<[M1WriteFVAR15], (instregex "FDIVv.f32")>; +def : InstRW<[M1WriteFVAR23], (instregex "FDIVv2f64")>; +def : InstRW<[M1WriteFVAR15], (instregex "FSQRTv.f32")>; +def : InstRW<[M1WriteFVAR23], (instregex "FSQRTv2f64")>; +def : InstRW<[M1WriteNMISC1], (instregex "^F(MAX|MIN)(NM)?V?v")>; +def : InstRW<[M1WriteNMISC2], (instregex "^F(MAX|MIN)(NM)?Pv")>; +def : InstRW<[M1WriteFMAC4], (instregex "^FMULX?v")>; +def : InstRW<[M1WriteFMAC5], (instregex "^FML[AS]v")>; +def : InstRW<[M1WriteFCVT3], (instregex "^FRINT[AIMNPXZ]v")>; + +// ASIMD miscellaneous instructions. +def : InstRW<[M1WriteNALU1], (instregex "^RBITv")>; +def : InstRW<[M1WriteNAL11], (instregex "^(BIF|BIT|BSL)v")>; +def : InstRW<[M1WriteNALU1], (instregex "^CPY")>; +def : InstRW<[M1WriteNEONB], (instregex "^DUPv.+gpr")>; +def : InstRW<[M1WriteNALU1], (instregex "^DUPv.+lane")>; +def : InstRW<[M1WriteNAL13], (instregex "^[SU]?Q?XTU?Nv")>; +def : InstRW<[M1WriteNEONC], (instregex "^INSv.+gpr")>; +def : InstRW<[M1WriteFCVT4], (instregex "^[FU](RECP|RSQRT)Ev")>; +def : InstRW<[M1WriteNMISC1], (instregex "^[FU](RECP|RSQRT)Xv")>; +def : InstRW<[M1WriteFMAC5], (instregex "^F(RECP|RSQRT)Sv")>; +def : InstRW<[M1WriteNALU1], (instregex "^REV(16|32|64)v")>; +def : InstRW<[M1WriteNAL11], (instregex "^TB[LX]v8i8One")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 2>], + (instregex "^TB[LX]v8i8Two")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 3>], + (instregex "^TB[LX]v8i8Three")>; +def : InstRW<[WriteSequence<[M1WriteNAL11], 4>], + (instregex "^TB[LX]v8i8Four")>; +def : InstRW<[M1WriteNAL12], (instregex "^TB[LX]v16i8One")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 2>], + (instregex "^TB[LX]v16i8Two")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 3>], + (instregex "^TB[LX]v16i8Three")>; +def : InstRW<[WriteSequence<[M1WriteNAL12], 4>], + (instregex "^TB[LX]v16i8Four")>; +def : InstRW<[M1WriteNEOND], (instregex "^[SU]MOVv")>; +def : InstRW<[M1WriteNALU1], (instregex "^INSv.+lane")>; +def : InstRW<[M1WriteNALU1], (instregex "^(TRN|UZP)(1|2)(v8i8|v4i16|v2i32)")>; +def : InstRW<[M1WriteNALU2], (instregex "^(TRN|UZP)(1|2)(v16i8|v8i16|v4i32|v2i64)")>; +def : InstRW<[M1WriteNALU1], (instregex "^ZIP(1|2)v")>; + +// ASIMD load instructions. + +// ASIMD store instructions. + +// Cryptography instructions. +def : InstRW<[M1WriteNCRYPT1], (instregex "^AES")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^PMUL")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^SHA1(H|SU)")>; +def : InstRW<[M1WriteNCRYPT5], (instregex "^SHA1[CMP]")>; +def : InstRW<[M1WriteNCRYPT1], (instregex "^SHA256SU0")>; +def : InstRW<[M1WriteNCRYPT5], (instregex "^SHA256(H|SU1)")>; + +// CRC instructions. +def : InstRW<[M1WriteC2], (instregex "^CRC32")>; + +} // SchedModel = ExynosM1Model Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td Sat Feb 13 14:57:10 2016 (r295590) @@ -183,6 +183,7 @@ def FeatureISAVersion7_0_0 : SubtargetFe def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1>; def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0>; def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1>; +def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3>; class SubtargetFeatureLocalMemorySize : SubtargetFeature< "localmemorysize"#Value, @@ -252,7 +253,7 @@ def FeatureSeaIslands : SubtargetFeature def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS", [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536, FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN, - FeatureGCN3Encoding, FeatureCIInsts, FeatureLDSBankCount32]>; + FeatureGCN3Encoding, FeatureCIInsts]>; //===----------------------------------------------------------------------===// Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h Sat Feb 13 14:57:10 2016 (r295590) @@ -53,7 +53,8 @@ public: ISAVersion7_0_0, ISAVersion7_0_1, ISAVersion8_0_0, - ISAVersion8_0_1 + ISAVersion8_0_1, + ISAVersion8_0_3 }; private: Modified: vendor/llvm/dist/lib/Target/AMDGPU/Processors.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/Processors.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/Processors.td Sat Feb 13 14:57:10 2016 (r295590) @@ -128,21 +128,23 @@ def : ProcessorModel<"mullins", SIQua //===----------------------------------------------------------------------===// def : ProcessorModel<"tonga", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0] + [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0, + FeatureLDSBankCount32] >; def : ProcessorModel<"iceland", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0] + [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0, + FeatureLDSBankCount32] >; def : ProcessorModel<"carrizo", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount32] >; def : ProcessorModel<"fiji", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32] >; def : ProcessorModel<"stoney", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1] + [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount16] >; Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -234,6 +234,7 @@ void SIRegisterInfo::buildScratchLoadSto bool IsLoad = TII->get(LoadStoreOp).mayLoad(); bool RanOutOfSGPRs = false; + bool Scavenged = false; unsigned SOffset = ScratchOffset; unsigned NumSubRegs = getNumSubRegsForSpillOp(MI->getOpcode()); @@ -244,6 +245,8 @@ void SIRegisterInfo::buildScratchLoadSto if (SOffset == AMDGPU::NoRegister) { RanOutOfSGPRs = true; SOffset = AMDGPU::SGPR0; + } else { + Scavenged = true; } BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_ADD_U32), SOffset) .addReg(ScratchOffset) @@ -259,10 +262,14 @@ void SIRegisterInfo::buildScratchLoadSto getPhysRegSubReg(Value, &AMDGPU::VGPR_32RegClass, i) : Value; + unsigned SOffsetRegState = 0; + if (i + 1 == e && Scavenged) + SOffsetRegState |= RegState::Kill; + BuildMI(*MBB, MI, DL, TII->get(LoadStoreOp)) .addReg(SubReg, getDefRegState(IsLoad)) .addReg(ScratchRsrcReg) - .addReg(SOffset) + .addReg(SOffset, SOffsetRegState) .addImm(Offset) .addImm(0) // glc .addImm(0) // slc Modified: vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -41,6 +41,9 @@ IsaVersion getIsaVersion(const FeatureBi if (Features.test(FeatureISAVersion8_0_1)) return {8, 0, 1}; + if (Features.test(FeatureISAVersion8_0_3)) + return {8, 0, 3}; + return {0, 0, 0}; } Modified: vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -747,7 +747,7 @@ bool ARMDAGToDAGISel::SelectLdStSOReg(SD // If Offset is a multiply-by-constant and it's profitable to extract a shift // and use it in a shifted operand do so. - if (Offset.getOpcode() == ISD::MUL) { + if (Offset.getOpcode() == ISD::MUL && N.hasOneUse()) { unsigned PowerOfTwo = 0; SDValue NewMulConst; if (canExtractShiftFromMul(Offset, 31, PowerOfTwo, NewMulConst)) { @@ -1422,7 +1422,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeSo // If OffReg is a multiply-by-constant and it's profitable to extract a shift // and use it in a shifted operand do so. - if (OffReg.getOpcode() == ISD::MUL) { + if (OffReg.getOpcode() == ISD::MUL && N.hasOneUse()) { unsigned PowerOfTwo = 0; SDValue NewMulConst; if (canExtractShiftFromMul(OffReg, 3, PowerOfTwo, NewMulConst)) { Modified: vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp Sat Feb 13 14:57:10 2016 (r295590) @@ -1615,7 +1615,7 @@ bool PPCFastISel::SelectRet(const Instru // extension rather than sign extension. Make sure we pass the return // value extension property to integer materialization. unsigned SrcReg = - PPCMaterializeInt(CI, MVT::i64, VA.getLocInfo() == CCValAssign::SExt); + PPCMaterializeInt(CI, MVT::i64, VA.getLocInfo() != CCValAssign::ZExt); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::COPY), RetReg).addReg(SrcReg); @@ -2091,25 +2091,21 @@ unsigned PPCFastISel::PPCMaterializeInt( const TargetRegisterClass *RC = ((VT == MVT::i64) ? &PPC::G8RCRegClass : &PPC::GPRCRegClass); + int64_t Imm = UseSExt ? CI->getSExtValue() : CI->getZExtValue(); // If the constant is in range, use a load-immediate. - if (UseSExt && isInt<16>(CI->getSExtValue())) { + // Since LI will sign extend the constant we need to make sure that for + // our zeroext constants that the sign extended constant fits into 16-bits - + // a range of 0..0x7fff. + if (isInt<16>(Imm)) { unsigned Opc = (VT == MVT::i64) ? PPC::LI8 : PPC::LI; unsigned ImmReg = createResultReg(RC); BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ImmReg) - .addImm(CI->getSExtValue()); - return ImmReg; - } else if (!UseSExt && isUInt<16>(CI->getZExtValue())) { - unsigned Opc = (VT == MVT::i64) ? PPC::LI8 : PPC::LI; - unsigned ImmReg = createResultReg(RC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ImmReg) - .addImm(CI->getZExtValue()); + .addImm(Imm); return ImmReg; } // Construct the constant piecewise. - int64_t Imm = CI->getZExtValue(); - if (VT == MVT::i64) return PPCMaterialize64BitInt(Imm, RC); else if (VT == MVT::i32) Modified: vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td ============================================================================== --- vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td Sat Feb 13 14:57:04 2016 (r295589) +++ vendor/llvm/dist/lib/Target/PowerPC/PPCInstrAltivec.td Sat Feb 13 14:57:10 2016 (r295590) @@ -736,7 +736,7 @@ def VPKSHSS : VX1_Int_Ty2<398, "vpkshss" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sat Feb 13 14:57:48 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31963AA7F41; Sat, 13 Feb 2016 14:57:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF9951D98; Sat, 13 Feb 2016 14:57:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEvkbe050351; Sat, 13 Feb 2016 14:57:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEvk0u050350; Sat, 13 Feb 2016 14:57:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131457.u1DEvk0u050350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295591 - vendor/llvm/llvm-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:57:48 -0000 Author: dim Date: Sat Feb 13 14:57:46 2016 New Revision: 295591 URL: https://svnweb.freebsd.org/changeset/base/295591 Log: Tag llvm release_38 branch r260756. Added: vendor/llvm/llvm-release_38-r260756/ - copied from r295590, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Sat Feb 13 14:58:15 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 239F4AA7FBA; Sat, 13 Feb 2016 14:58:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2F3E1ECF; Sat, 13 Feb 2016 14:58:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEwEwL050417; Sat, 13 Feb 2016 14:58:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEwEbR050415; Sat, 13 Feb 2016 14:58:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131458.u1DEwEbR050415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295592 - in vendor/clang/dist: docs include/clang/Sema lib/AST lib/Basic lib/CodeGen lib/Driver lib/Sema test/CodeGenCXX test/CodeGenOpenCL test/Driver test/Misc test/OpenMP test/Prepr... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:58:15 -0000 Author: dim Date: Sat Feb 13 14:58:13 2016 New Revision: 295592 URL: https://svnweb.freebsd.org/changeset/base/295592 Log: Vendor import of clang release_38 branch r260756: https://llvm.org/svn/llvm-project/cfe/branches/release_38@260756 Added: vendor/clang/dist/test/SemaObjC/ovl-check.m Modified: vendor/clang/dist/docs/AttributeReference.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/Address.h vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprObjC.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/test/CodeGenCXX/lambda-expressions.cpp vendor/clang/dist/test/CodeGenOpenCL/pipe_types.cl vendor/clang/dist/test/Driver/netbsd.c vendor/clang/dist/test/Driver/netbsd.cpp vendor/clang/dist/test/Misc/diag-template-diffing-color.cpp vendor/clang/dist/test/Misc/diag-template-diffing.cpp vendor/clang/dist/test/OpenMP/cancel_codegen.cpp vendor/clang/dist/test/OpenMP/cancellation_point_codegen.cpp vendor/clang/dist/test/OpenMP/parallel_sections_codegen.cpp vendor/clang/dist/test/OpenMP/sections_codegen.cpp vendor/clang/dist/test/OpenMP/sections_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/sections_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/sections_private_codegen.cpp vendor/clang/dist/test/OpenMP/sections_reduction_codegen.cpp vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c Modified: vendor/clang/dist/docs/AttributeReference.rst ============================================================================== --- vendor/clang/dist/docs/AttributeReference.rst Sat Feb 13 14:57:46 2016 (r295591) +++ vendor/clang/dist/docs/AttributeReference.rst Sat Feb 13 14:58:13 2016 (r295592) @@ -1,13 +1,2035 @@ .. ------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen - -gen-attr-docs. Do not edit this file by hand!! The contents for - this file are automatically generated by a server-side process. - - Please do not commit this file. The file exists for local testing - purposes only. + -gen-attr-docs. Do not edit this file by hand!! ------------------------------------------------------------------- =================== Attributes in Clang -=================== \ No newline at end of file +=================== +.. contents:: + :local: + +Introduction +============ + +This page lists the attributes currently supported by Clang. + +Function Attributes +=================== + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on +ARM targets. This attribute may be attached to a function definition and +instructs the backend to generate appropriate function entry/exit code so that +it can be used directly as an interrupt service routine. + +The parameter passed to the interrupt attribute is optional, but if +provided it must be a string literal with one of the following values: "IRQ", +"FIQ", "SWI", "ABORT", "UNDEF". + +The semantics are as follows: + +- If the function is AAPCS, Clang instructs the backend to realign the stack to + 8 bytes on entry. This is a general requirement of the AAPCS at public + interfaces, but may not hold when an exception is taken. Doing this allows + other AAPCS functions to be called. +- If the CPU is M-class this is all that needs to be done since the architecture + itself is designed in such a way that functions obeying the normal AAPCS ABI + constraints are valid exception handlers. +- If the CPU is not M-class, the prologue and epilogue are modified to save all + non-banked registers that are used, so that upon return the user-mode state + will not be corrupted. Note that to avoid unnecessary overhead, only + general-purpose (integer) registers are saved in this way. If VFP operations + are needed, that state must be saved manually. + + Specifically, interrupt kinds other than "FIQ" will save all core registers + except "lr" and "sp". "FIQ" interrupts will save r0-r7. +- If the CPU is not M-class, the return instruction is changed to one of the + canonical sequences permitted by the architecture for exception return. Where + possible the function itself will make the necessary "lr" adjustments so that + the "preferred return address" is selected. + + Unfortunately the compiler is unable to make this guarantee for an "UNDEF" + handler, where the offset from "lr" to the preferred return address depends on + the execution state of the code which generated the exception. In this case + a sequence equivalent to "movs pc, lr" will be used. + + +acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as acquiring a capability. + + +assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability) +------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function that dynamically tests whether a capability is held, and halts +the program if it is not held. + + +assume_aligned (gnu::assume_aligned) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use ``__attribute__((assume_aligned([,]))`` on a function +declaration to specify that the return value of the function (which must be a +pointer type) has the specified offset, in bytes, from an address with the +specified alignment. The offset is taken to be zero if omitted. + +.. code-block:: c++ + + // The returned pointer value has 32-byte alignment. + void *a() __attribute__((assume_aligned (32))); + + // The returned pointer value is 4 bytes greater than an address having + // 32-byte alignment. + void *b() __attribute__((assume_aligned (32, 4))); + +Note that this attribute provides information to the compiler regarding a +condition that the code already ensures is true. It does not cause the compiler +to enforce the provided alignment assumption. + + +availability +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +The ``availability`` attribute can be placed on declarations to describe the +lifecycle of that declaration relative to operating system versions. Consider +the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); + +The availability attribute states that ``f`` was introduced in Mac OS X 10.4, +deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +is used by Clang to determine when it is safe to use ``f``: for example, if +Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +succeeds but Clang emits a warning specifying that the function is deprecated. +Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +fails because ``f()`` is no longer available. + +The availability attribute is a comma-separated list starting with the +platform name and then including clauses specifying important milestones in the +declaration's lifetime (in any order) along with additional information. Those +clauses can be: + +introduced=\ *version* + The first version in which this declaration was introduced. + +deprecated=\ *version* + The first version in which this declaration was deprecated, meaning that + users should migrate away from this API. + +obsoleted=\ *version* + The first version in which this declaration was obsoleted, meaning that it + was removed completely and can no longer be used. + +unavailable + This declaration is never available on this platform. + +message=\ *string-literal* + Additional message text that Clang will provide when emitting a warning or + error about use of a deprecated or obsoleted declaration. Useful to direct + users to replacement APIs. + +Multiple availability attributes can be placed on a declaration, which may +correspond to different platforms. Only the availability attribute with the +platform corresponding to the target platform will be used; any others will be +ignored. If no availability attribute specifies availability for the current +target platform, the availability attributes are ignored. Supported platforms +are: + +``ios`` + Apple's iOS operating system. The minimum deployment target is specified by + the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` + command-line arguments. + +``macosx`` + Apple's Mac OS X operating system. The minimum deployment target is + specified by the ``-mmacosx-version-min=*version*`` command-line argument. + +``tvos`` + Apple's tvOS operating system. The minimum deployment target is specified by + the ``-mtvos-version-min=*version*`` command-line argument. + +``watchos`` + Apple's watchOS operating system. The minimum deployment target is specified by + the ``-mwatchos-version-min=*version*`` command-line argument. + +A declaration can be used even when deploying back to a platform version prior +to when the declaration was introduced. When this happens, the declaration is +`weakly linked +`_, +as if the ``weak_import`` attribute were added to the declaration. A +weakly-linked declaration may or may not be present a run-time, and a program +can determine whether the declaration is present by checking whether the +address of that declaration is non-NULL. + +If there are multiple declarations of the same entity, the availability +attributes must either match on a per-platform basis or later +declarations must not have availability attributes for that +platform. For example: + +.. code-block:: c + + void g(void) __attribute__((availability(macosx,introduced=10.4))); + void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches + void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform + void g(void); // okay, inherits both macosx and ios availability from above. + void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch + +When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: + +.. code-block:: objc + + @interface A + - (id)method __attribute__((availability(macosx,introduced=10.4))); + - (id)method2 __attribute__((availability(macosx,introduced=10.4))); + @end + + @interface B : A + - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later + - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4 + @end + + +_Noreturn +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","X", "" + +A function declared as ``_Noreturn`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``_Noreturn`` +that appears to be capable of returning to its caller. + + +noreturn +-------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","X","","", "" + +A function declared as ``[[noreturn]]`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` +that appears to be capable of returning to its caller. + + +carries_dependency +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``carries_dependency`` attribute specifies dependency propagation into and +out of functions. + +When specified on a function or Objective-C method, the ``carries_dependency`` +attribute means that the return value carries a dependency out of the function, +so that the implementation need not constrain ordering upon return from that +function. Implementations of the function and its caller may choose to preserve +dependencies instead of emitting memory ordering instructions such as fences. + +Note, this attribute does not change the meaning of the program, but may result +in generation of more efficient code. + + +disable_tail_calls (clang::disable_tail_calls) +---------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. + +For example: + + .. code-block:: c + + int callee(int); + + int foo(int a) __attribute__((disable_tail_calls)) { + return callee(a); // This call is not tail-call optimized. + } + +Marking virtual functions as ``disable_tail_calls`` is legal. + + .. code-block: c++ + + int callee(int); + + class Base { + public: + [[clang::disable_tail_calls]] virtual int foo1() { + return callee(); // This call is not tail-call optimized. + } + }; + + class Derived1 : public Base { + public: + int foo1() override { + return callee(); // This call is tail-call optimized. + } + }; + + +enable_if +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +.. Note:: Some features of this attribute are experimental. The meaning of + multiple enable_if attributes on a single declaration is subject to change in + a future version of clang. Also, the ABI is not standardized and the name + mangling may change in future versions. To avoid that, use asm labels. + +The ``enable_if`` attribute can be placed on function declarations to control +which overload is selected based on the values of the function's arguments. +When combined with the ``overloadable`` attribute, this feature is also +available in C. + +.. code-block:: c++ + + int isdigit(int c); + int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); + + void foo(char c) { + isdigit(c); + isdigit(10); + isdigit(-10); // results in a compile-time error. + } + +The enable_if attribute takes two arguments, the first is an expression written +in terms of the function parameters, the second is a string explaining why this +overload candidate could not be selected to be displayed in diagnostics. The +expression is part of the function signature for the purposes of determining +whether it is a redeclaration (following the rules used when determining +whether a C++ template specialization is ODR-equivalent), but is not part of +the type. + +The enable_if expression is evaluated as if it were the body of a +bool-returning constexpr function declared with the arguments of the function +it is being applied to, then called with the parameters at the call site. If the +result is false or could not be determined through constant expression +evaluation, then this overload will not be chosen and the provided string may +be used in a diagnostic if the compile fails as a result. + +Because the enable_if expression is an unevaluated context, there are no global +state changes, nor the ability to pass information from the enable_if +expression to the function body. For example, suppose we want calls to +strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of +strbuf) only if the size of strbuf can be determined: + +.. code-block:: c++ + + __attribute__((always_inline)) + static inline size_t strnlen(const char *s, size_t maxlen) + __attribute__((overloadable)) + __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), + "chosen when the buffer size is known but 'maxlen' is not"))) + { + return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); + } + +Multiple enable_if attributes may be applied to a single declaration. In this +case, the enable_if expressions are evaluated from left to right in the +following manner. First, the candidates whose enable_if expressions evaluate to +false or cannot be evaluated are discarded. If the remaining candidates do not +share ODR-equivalent enable_if expressions, the overload resolution is +ambiguous. Otherwise, enable_if overload resolution continues with the next +enable_if attribute on the candidates that have not been discarded and have +remaining enable_if attributes. In this way, we pick the most specific +overload out of a number of viable overloads using enable_if. + +.. code-block:: c++ + + void f() __attribute__((enable_if(true, ""))); // #1 + void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 + + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 + void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 + +In this example, a call to f() is always resolved to #2, as the first enable_if +expression is ODR-equivalent for both declarations, but #1 does not have another +enable_if expression to continue evaluating, so the next round of evaluation has +only a single candidate. In a call to g(1, 1), the call is ambiguous even though +#2 has more enable_if attributes, because the first enable_if expressions are +not ODR-equivalent. + +Query for this feature with ``__has_attribute(enable_if)``. + + +flatten (gnu::flatten) +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``flatten`` attribute causes calls within the attributed function to +be inlined unless it is impossible to do so, for example if the body of the +callee is unavailable or if the callee has the ``noinline`` attribute. + + +format (gnu::format) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Clang supports the ``format`` attribute, which indicates that the function +accepts a ``printf`` or ``scanf``-like format string and corresponding +arguments or a ``va_list`` that contains these arguments. + +Please see `GCC documentation about format attribute +`_ to find details +about attribute syntax. + +Clang implements two kinds of checks with this attribute. + +#. Clang checks that the function with the ``format`` attribute is called with + a format string that uses format specifiers that are allowed, and that + arguments match the format string. This is the ``-Wformat`` warning, it is + on by default. + +#. Clang checks that the format string argument is a literal string. This is + the ``-Wformat-nonliteral`` warning, it is off by default. + + Clang implements this mostly the same way as GCC, but there is a difference + for functions that accept a ``va_list`` argument (for example, ``vprintf``). + GCC does not emit ``-Wformat-nonliteral`` warning for calls to such + functions. Clang does not warn if the format string comes from a function + parameter, where the function is annotated with a compatible attribute, + otherwise it warns. For example: + + .. code-block:: c + + __attribute__((__format__ (__scanf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning: format string is not a string literal + } + + In this case we warn because ``s`` contains a format string for a + ``scanf``-like function, but it is passed to a ``printf``-like function. + + If the attribute is removed, clang still warns, because the format string is + not a string literal. + + Another example: + + .. code-block:: c + + __attribute__((__format__ (__printf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning + } + + In this case Clang does not warn because the format string ``s`` and + the corresponding arguments are annotated. If the arguments are + incorrect, the caller of ``foo`` will receive a warning. + + +internal_linkage (clang::internal_linkage) +------------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``internal_linkage`` attribute changes the linkage type of the declaration to internal. +This is similar to C-style ``static``, but can be used on classes and class methods. When applied to a class definition, +this attribute affects all methods and static data members of that class. +This can be used to contain the ABI of a C++ library by excluding unwanted class methods from the export tables. + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("ARGUMENT")))`` attribute on +MIPS targets. This attribute may be attached to a function definition and instructs +the backend to generate appropriate function entry/exit code so that it can be used +directly as an interrupt service routine. + +By default, the compiler will produce a function prologue and epilogue suitable for +an interrupt service routine that handles an External Interrupt Controller (eic) +generated interrupt. This behaviour can be explicitly requested with the "eic" +argument. + +Otherwise, for use with vectored interrupt mode, the argument passed should be +of the form "vector=LEVEL" where LEVEL is one of the following values: +"sw0", "sw1", "hw0", "hw1", "hw2", "hw3", "hw4", "hw5". The compiler will +then set the interrupt mask to the corresponding level which will mask all +interrupts up to and including the argument. + +The semantics are as follows: + +- The prologue is modified so that the Exception Program Counter (EPC) and + Status coprocessor registers are saved to the stack. The interrupt mask is + set so that the function can only be interrupted by a higher priority + interrupt. The epilogue will restore the previous values of EPC and Status. + +- The prologue and epilogue are modified to save and restore all non-kernel + registers as necessary. + +- The FPU is disabled in the prologue, as the floating pointer registers are not + spilled to the stack. + +- The function return sequence is changed to use an exception return instruction. + +- The parameter sets the interrupt mask for the function corresponding to the + interrupt level specified. If no mask is specified the interrupt mask + defaults to "eic". + + +noalias +------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","X","", "" + +The ``noalias`` attribute indicates that the only memory accesses inside +function are loads and stores from objects pointed to by its pointer-typed +arguments, with arbitrary offsets. + + +noduplicate (clang::noduplicate) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``noduplicate`` attribute can be placed on function declarations to control +whether function calls to this function can be duplicated or not as a result of +optimizations. This is required for the implementation of functions with +certain special requirements, like the OpenCL "barrier" function, that might +need to be run concurrently by all the threads that are executing in lockstep +on the hardware. For example this attribute applied on the function +"nodupfunc" in the code below avoids that: + +.. code-block:: c + + void nodupfunc() __attribute__((noduplicate)); + // Setting it as a C++11 attribute is also valid + // void nodupfunc() [[clang::noduplicate]]; + void foo(); + void bar(); + + nodupfunc(); + if (a > n) { + foo(); + } else { + bar(); + } + +gets possibly modified by some optimizations into code similar to this: + +.. code-block:: c + + if (a > n) { + nodupfunc(); + foo(); + } else { + nodupfunc(); + bar(); + } + +where the call to "nodupfunc" is duplicated and sunk into the two branches +of the condition. + + +no_sanitize (clang::no_sanitize) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use the ``no_sanitize`` attribute on a function declaration to specify +that a particular instrumentation or set of instrumentations should not be +applied to that function. The attribute takes a list of string literals, +which have the same meaning as values accepted by the ``-fno-sanitize=`` +flag. For example, ``__attribute__((no_sanitize("address", "thread")))`` +specifies that AddressSanitizer and ThreadSanitizer should not be applied +to the function. + +See :ref:`Controlling Code Generation ` for a +full list of supported sanitizer flags. + + +no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-address_sanitizer: + +Use ``__attribute__((no_sanitize_address))`` on a function declaration to +specify that address safety instrumentation (e.g. AddressSanitizer) should +not be applied to that function. + + +no_sanitize_thread +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-thread_sanitizer: + +Use ``__attribute__((no_sanitize_thread))`` on a function declaration to +specify that checks for data races on plain (non-atomic) memory accesses should +not be inserted by ThreadSanitizer. The function is still instrumented by the +tool to avoid false positives and provide meaningful stack traces. + + +no_sanitize_memory +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-memory_sanitizer: + +Use ``__attribute__((no_sanitize_memory))`` on a function declaration to +specify that checks for uninitialized memory should not be inserted +(e.g. by MemorySanitizer). The function may still be instrumented by the tool +to avoid false positives in other places. + + +no_split_stack (gnu::no_split_stack) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``no_split_stack`` attribute disables the emission of the split stack +preamble for a particular function. It has no effect if ``-fsplit-stack`` +is not specified. + + +not_tail_called (clang::not_tail_called) +---------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``not_tail_called`` attribute prevents tail-call optimization on statically bound calls. It has no effect on indirect calls. Virtual functions, objective-c methods, and functions marked as ``always_inline`` cannot be marked as ``not_tail_called``. + +For example, it prevents tail-call optimization in the following case: + + .. code-block: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + return foo1(a); // No tail-call optimization on direct calls. + } + +However, it doesn't prevent tail-call optimization in this case: + + .. code-block: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + int (*fn)(int) = &foo1; + + // not_tail_called has no effect on an indirect call even if the call can be + // resolved at compile time. + return (*fn)(a); + } + +Marking virtual functions as ``not_tail_called`` is an error: + + .. code-block: c++ + + class Base { + public: + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] virtual int foo1(); + + virtual int foo2(); + + // Non-virtual functions can be marked ``not_tail_called``. + [[clang::not_tail_called]] int foo3(); + }; + + class Derived1 : public Base { + public: + int foo1() override; + + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] int foo2() override; + }; + + +objc_boxable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Structs and unions marked with the ``objc_boxable`` attribute can be used +with the Objective-C boxed expression syntax, ``@(...)``. + +**Usage**: ``__attribute__((objc_boxable))``. This attribute +can only be placed on a declaration of a trivially-copyable struct or union: + +.. code-block:: objc + + struct __attribute__((objc_boxable)) some_struct { + int i; + }; + union __attribute__((objc_boxable)) some_union { + int i; + float f; + }; + typedef struct __attribute__((objc_boxable)) _some_struct some_struct; + + // ... + + some_struct ss; + NSValue *boxed = @(ss); + + +objc_method_family +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Many methods in Objective-C have conventional meanings determined by their +selectors. It is sometimes useful to be able to mark a method as having a +particular conventional meaning despite not having the right selector, or as +not having the conventional meaning that its selector would suggest. For these +use cases, we provide an attribute to specifically describe the "method family" +that a method belongs to. + +**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of +``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``. This +attribute can only be placed at the end of a method declaration: + +.. code-block:: objc + + - (NSString *)initMyStringValue __attribute__((objc_method_family(none))); + +Users who do not wish to change the conventional meaning of a method, and who +merely want to document its non-standard retain and release semantics, should +use the retaining behavior attributes (``ns_returns_retained``, +``ns_returns_not_retained``, etc). + +Query for this feature with ``__has_attribute(objc_method_family)``. + + +objc_requires_super +------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Some Objective-C classes allow a subclass to override a particular method in a +parent class but expect that the overriding method also calls the overridden +method in the parent class. For these cases, we provide an attribute to +designate that a method requires a "call to ``super``" in the overriding +method in the subclass. + +**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only +be placed at the end of a method declaration: + +.. code-block:: objc + + - (void)foo __attribute__((objc_requires_super)); + +This attribute can only be applied the method declarations within a class, and +not a protocol. Currently this attribute does not enforce any placement of +where the call occurs in the overriding method (such as in the case of +``-dealloc`` where the call must appear at the end). It checks only that it +exists. + +Note that on both OS X and iOS that the Foundation framework provides a +convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this +attribute: + +.. code-block:: objc + + - (void)foo NS_REQUIRES_SUPER; + +This macro is conditionally defined depending on the compiler's support for +this attribute. If the compiler does not support the attribute the macro +expands to nothing. + +Operationally, when a method has this annotation the compiler will warn if the +implementation of an override in a subclass does not call super. For example: + +.. code-block:: objc + + warning: method possibly missing a [super AnnotMeth] call + - (void) AnnotMeth{}; + ^ + + +objc_runtime_name +----------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +By default, the Objective-C interface or protocol identifier is used +in the metadata name for that object. The `objc_runtime_name` +attribute allows annotated interfaces or protocols to use the +specified string argument in the object's metadata name instead of the +default name. + +**Usage**: ``__attribute__((objc_runtime_name("MyLocalName")))``. This attribute +can only be placed before an @protocol or @interface declaration: + +.. code-block:: objc + + __attribute__((objc_runtime_name("MyLocalName"))) + @interface Message + @end + + +optnone (clang::optnone) +------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``optnone`` attribute suppresses essentially all optimizations +on a function or method, regardless of the optimization level applied to +the compilation unit as a whole. This is particularly useful when you +need to debug a particular function, but it is infeasible to build the +entire application without optimization. Avoiding optimization on the +specified function can improve the quality of the debugging information +for that function. + +This attribute is incompatible with the ``always_inline`` and ``minsize`` +attributes. + + +overloadable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang provides support for C++ function overloading in C. Function overloading +in C is introduced using the ``overloadable`` attribute. For example, one +might provide several overloaded versions of a ``tgsin`` function that invokes +the appropriate standard function computing the sine of a value with ``float``, +``double``, or ``long double`` precision: + +.. code-block:: c + + #include + float __attribute__((overloadable)) tgsin(float x) { return sinf(x); } + double __attribute__((overloadable)) tgsin(double x) { return sin(x); } + long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); } + +Given these declarations, one can call ``tgsin`` with a ``float`` value to +receive a ``float`` result, with a ``double`` to receive a ``double`` result, +etc. Function overloading in C follows the rules of C++ function overloading +to pick the best overload given the call arguments, with a few C-specific +semantics: + +* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a + floating-point promotion (per C99) rather than as a floating-point conversion + (as in C++). + +* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is + considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are + compatible types. + +* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T`` + and ``U`` are compatible types. This conversion is given "conversion" rank. + +The declaration of ``overloadable`` functions is restricted to function +declarations and definitions. Most importantly, if any function with a given +name is given the ``overloadable`` attribute, then all function declarations +and definitions with that name (and in that scope) must have the +``overloadable`` attribute. This rule even applies to redeclarations of +functions whose original declaration had the ``overloadable`` attribute, e.g., + +.. code-block:: c + + int f(int) __attribute__((overloadable)); + float f(float); // error: declaration of "f" must have the "overloadable" attribute + + int g(int) __attribute__((overloadable)); + int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute + +Functions marked ``overloadable`` must have prototypes. Therefore, the +following code is ill-formed: + +.. code-block:: c + + int h() __attribute__((overloadable)); // error: h does not have a prototype + +However, ``overloadable`` functions are allowed to use a ellipsis even if there +are no named parameters (as is permitted in C++). This feature is particularly +useful when combined with the ``unavailable`` attribute: + +.. code-block:: c++ + + void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error + +Functions declared with the ``overloadable`` attribute have their names mangled +according to the same rules as C++ function names. For example, the three +``tgsin`` functions in our motivating example get the mangled names +``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively. There are two +caveats to this use of name mangling: + +* Future versions of Clang may change the name mangling of functions overloaded + in C, so you should not depend on an specific mangling. To be completely + safe, we strongly urge the use of ``static inline`` with ``overloadable`` + functions. + +* The ``overloadable`` attribute has almost no meaning when used in C++, + because names will already be mangled and functions are already overloadable. + However, when an ``overloadable`` function occurs within an ``extern "C"`` + linkage specification, it's name *will* be mangled in the same way as it + would in C. + +Query for this feature with ``__has_extension(attribute_overloadable)``. + + +release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as releasing a capability. + + +target (gnu::target) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Clang supports the GNU style ``__attribute__((target("OPTIONS")))`` attribute. +This attribute may be attached to a function definition and instructs +the backend to use different code generation options than were passed on the +command line. + +The current set of options correspond to the existing "subtarget features" for +the target with or without a "-mno-" in front corresponding to the absence +of the feature, as well as ``arch="CPU"`` which will change the default "CPU" +for the function. + +Example "subtarget features" from the x86 backend include: "mmx", "sse", "sse4.2", +"avx", "xop" and largely correspond to the machine specific options handled by +the front end. + + +try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability) +--------------------------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sat Feb 13 14:58:42 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF8CAA7051; Sat, 13 Feb 2016 14:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43D0E101D; Sat, 13 Feb 2016 14:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DEwfTH050473; Sat, 13 Feb 2016 14:58:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DEwfuq050472; Sat, 13 Feb 2016 14:58:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131458.u1DEwfuq050472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295593 - vendor/clang/clang-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:58:42 -0000 Author: dim Date: Sat Feb 13 14:58:41 2016 New Revision: 295593 URL: https://svnweb.freebsd.org/changeset/base/295593 Log: Tag clang release_38 branch r260756. Added: vendor/clang/clang-release_38-r260756/ - copied from r295592, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Sat Feb 13 14:59:57 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B5DAA712D; Sat, 13 Feb 2016 14:59:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC281262; Sat, 13 Feb 2016 14:59:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DExu4A050574; Sat, 13 Feb 2016 14:59:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DExt1G050566; Sat, 13 Feb 2016 14:59:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131459.u1DExt1G050566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 14:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295594 - in vendor/compiler-rt/dist: . cmake/Modules lib/tsan lib/tsan/rtl test/msan test/tsan X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:59:57 -0000 Author: dim Date: Sat Feb 13 14:59:55 2016 New Revision: 295594 URL: https://svnweb.freebsd.org/changeset/base/295594 Log: Vendor import of compiler-rt release_38 branch r260756: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_38@260756 Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc vendor/compiler-rt/dist/test/msan/fork.cc vendor/compiler-rt/dist/test/tsan/CMakeLists.txt vendor/compiler-rt/dist/test/tsan/lit.cfg vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -66,8 +66,10 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) # Windows where we need to use clang-cl instead. if(NOT MSVC) set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++) else() set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) + set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe) endif() else() # Take output dir and install path from the user. @@ -81,6 +83,7 @@ else() option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) # Use a host compiler to compile/link tests. set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing") + set(COMPILER_RT_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "C++ Compiler to use for testing") if (NOT LLVM_CONFIG_PATH) find_program(LLVM_CONFIG_PATH "llvm-config" Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sat Feb 13 14:59:55 2016 (r295594) @@ -290,11 +290,12 @@ macro(add_custom_libcxx name prefix) SOURCE_DIR ${COMPILER_RT_LIBCXX_PATH} CMAKE_ARGS -DCMAKE_MAKE_PROGRAM:STRING=${CMAKE_MAKE_PROGRAM} -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER} - -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER} -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH= + -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} LOG_BUILD 1 LOG_CONFIGURE 1 LOG_INSTALL 1 Modified: vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -204,10 +204,17 @@ endif() # Build libcxx instrumented with TSan. if(COMPILER_RT_HAS_LIBCXX_SOURCES AND COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang") - set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan) - add_custom_libcxx(libcxx_tsan ${LIBCXX_PREFIX} - DEPS ${TSAN_RUNTIME_LIBRARIES} - CFLAGS -fsanitize=thread) + set(libcxx_tsan_deps) + foreach(arch ${TSAN_SUPPORTED_ARCH}) + get_target_flags_for_arch(${arch} TARGET_CFLAGS) + set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch}) + add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX} + DEPS ${TSAN_RUNTIME_LIBRARIES} + CFLAGS ${TARGET_CFLAGS} -fsanitize=thread) + list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}) + endforeach() + + add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps}) endif() if(COMPILER_RT_INCLUDE_TESTS) Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc Sat Feb 13 14:59:55 2016 (r295594) @@ -159,8 +159,8 @@ void PrintMatchedSuppressions() { Printf("ThreadSanitizer: Matched %d suppressions (pid=%d):\n", hit_count, (int)internal_getpid()); for (uptr i = 0; i < matched.size(); i++) { - Printf("%d %s:%s\n", matched[i]->hit_count, matched[i]->type, - matched[i]->templ); + Printf("%d %s:%s\n", atomic_load_relaxed(&matched[i]->hit_count), + matched[i]->type, matched[i]->templ); } } } // namespace __tsan Modified: vendor/compiler-rt/dist/test/msan/fork.cc ============================================================================== --- vendor/compiler-rt/dist/test/msan/fork.cc Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/msan/fork.cc Sat Feb 13 14:59:55 2016 (r295594) @@ -4,6 +4,11 @@ // RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins=2 -g -O3 %s -o %t // RUN: MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t |& FileCheck %s +// +// Big-endian mips64 currently hangs on this test. Mark it unsupported to allow +// llvm-lit to finish. This also marks mips unsupported in most cases but msan +// is already unsupported for 32-bit mips. +// UNSUPPORTED: mips64-supported-target // Fun fact: if test output is redirected to a file (as opposed to // being piped directly to FileCheck), we may lose some "done"s due to Modified: vendor/compiler-rt/dist/test/tsan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sat Feb 13 14:59:55 2016 (r295594) @@ -14,9 +14,33 @@ else() set(TSAN_HAS_LIBCXX False) endif() -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) +set(TSAN_TESTSUITES) + +set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH}) +if(APPLE) + darwin_filter_host_archs(TSAN_SUPPORTED_ARCH TSAN_TEST_ARCH) +endif() + +foreach(arch ${TSAN_TEST_ARCH}) + string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX) + if(ANDROID OR ${arch} MATCHES "arm|aarch64") + # This is only true if we are cross-compiling. + # Build all tests with host compiler and use host tools. + set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) + set(TSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) + else() + get_target_flags_for_arch(${arch} TSAN_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " TSAN_TEST_TARGET_CFLAGS "${TSAN_TEST_TARGET_CFLAGS}") + endif() + + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) + list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) +endforeach() if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( @@ -26,6 +50,6 @@ if(COMPILER_RT_INCLUDE_TESTS) endif() add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" - ${CMAKE_CURRENT_BINARY_DIR} + ${TSAN_TESTSUITES} DEPENDS ${TSAN_TEST_DEPS}) set_target_properties(check-tsan PROPERTIES FOLDER "TSan tests") Modified: vendor/compiler-rt/dist/test/tsan/lit.cfg ============================================================================== --- vendor/compiler-rt/dist/test/tsan/lit.cfg Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/lit.cfg Sat Feb 13 14:59:55 2016 (r295594) @@ -12,7 +12,7 @@ def get_required_attr(config, attr_name) return attr_value # Setup config name. -config.name = 'ThreadSanitizer' +config.name = 'ThreadSanitizer' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) @@ -39,16 +39,18 @@ else: extra_cflags = [] # Setup default compiler flags used with -fsanitize=thread option. -clang_tsan_cflags = ["-fsanitize=thread", - "-Wall", - "-m64"] + config.debug_info_flags + extra_cflags +clang_tsan_cflags = (["-fsanitize=thread", + "-Wall"] + + [config.target_cflags] + + config.debug_info_flags + + extra_cflags) clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags # Add additional flags if we're using instrumented libc++. # Instrumented libcxx currently not supported on Darwin. if config.has_libcxx and config.host_os != 'Darwin': # FIXME: Dehardcode this path somehow. libcxx_path = os.path.join(config.compiler_rt_obj_root, "lib", - "tsan", "libcxx_tsan") + "tsan", "libcxx_tsan_" + config.arch) libcxx_incdir = os.path.join(libcxx_path, "include", "c++", "v1") libcxx_libdir = os.path.join(libcxx_path, "lib") libcxx_so = os.path.join(libcxx_libdir, "libc++.so") Modified: vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in ============================================================================== --- vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Sat Feb 13 14:58:41 2016 (r295593) +++ vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Sat Feb 13 14:59:55 2016 (r295594) @@ -1,7 +1,10 @@ ## Autogenerated by LLVM/Clang configuration. # Do not edit! +config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@" +config.arch = "@arch@" config.has_libcxx = @TSAN_HAS_LIBCXX@ +config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") From owner-svn-src-vendor@freebsd.org Sat Feb 13 15:00:33 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A94BAA71D9; Sat, 13 Feb 2016 15:00:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B87B113D7; Sat, 13 Feb 2016 15:00:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF0Vvi050671; Sat, 13 Feb 2016 15:00:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF0Vvt050670; Sat, 13 Feb 2016 15:00:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131500.u1DF0Vvt050670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295595 - vendor/compiler-rt/compiler-rt-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:00:33 -0000 Author: dim Date: Sat Feb 13 15:00:31 2016 New Revision: 295595 URL: https://svnweb.freebsd.org/changeset/base/295595 Log: Tag compiler-rt release_38 branch r260756. Added: vendor/compiler-rt/compiler-rt-release_38-r260756/ - copied from r295594, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Sat Feb 13 15:00:51 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC3DAA722C; Sat, 13 Feb 2016 15:00:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 881751602; Sat, 13 Feb 2016 15:00:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF0oo9050731; Sat, 13 Feb 2016 15:00:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF0nv6050723; Sat, 13 Feb 2016 15:00:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131500.u1DF0nv6050723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295596 - in vendor/libc++/dist/test: libcxx/test std/localization/locale.categories/category.collate/locale.collate.byname std/localization/locale.categories/category.ctype/locale.ctyp... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:00:51 -0000 Author: dim Date: Sat Feb 13 15:00:49 2016 New Revision: 295596 URL: https://svnweb.freebsd.org/changeset/base/295596 Log: Vendor import of libc++ release_38 branch r260756: https://llvm.org/svn/llvm-project/libcxx/branches/release_38@260756 Modified: vendor/libc++/dist/test/libcxx/test/format.py vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Modified: vendor/libc++/dist/test/libcxx/test/format.py ============================================================================== --- vendor/libc++/dist/test/libcxx/test/format.py Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/libcxx/test/format.py Sat Feb 13 15:00:49 2016 (r295596) @@ -161,7 +161,7 @@ class LibcxxTestFormat(object): 'expected-error', 'expected-no-diagnostics'] use_verify = self.use_verify_for_fail and \ any([tag in contents for tag in verify_tags]) - extra_flags = [] + extra_flags = ['-fsyntax-only'] if use_verify: extra_flags += ['-Xclang', '-verify', '-Xclang', '-verify-ignore-unexpected=note'] Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class collate_byname Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; Modified: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Sat Feb 13 15:00:31 2016 (r295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp Sat Feb 13 15:00:49 2016 (r295596) @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; From owner-svn-src-vendor@freebsd.org Sat Feb 13 15:01:15 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 880CBAA72A6; Sat, 13 Feb 2016 15:01:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43905187E; Sat, 13 Feb 2016 15:01:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1EQK051403; Sat, 13 Feb 2016 15:01:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1EZX051402; Sat, 13 Feb 2016 15:01:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1EZX051402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295597 - vendor/libc++/libc++-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:15 -0000 Author: dim Date: Sat Feb 13 15:01:14 2016 New Revision: 295597 URL: https://svnweb.freebsd.org/changeset/base/295597 Log: Tag libc++ release_38 branch r260756. Added: vendor/libc++/libc++-release_38-r260756/ - copied from r295596, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Sat Feb 13 15:01:37 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15ADAA7307; Sat, 13 Feb 2016 15:01:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6977B1A26; Sat, 13 Feb 2016 15:01:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1ahL053414; Sat, 13 Feb 2016 15:01:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1Xj6051457; Sat, 13 Feb 2016 15:01:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1Xj6051457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295598 - in vendor/lldb/dist: . include/lldb/API include/lldb/Core include/lldb/Symbol packages/Python/lldbsuite/test packages/Python/lldbsuite/test/expression_command/char packages/Py... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:38 -0000 Author: dim Date: Sat Feb 13 15:01:33 2016 New Revision: 295598 URL: https://svnweb.freebsd.org/changeset/base/295598 Log: Vendor import of lldb release_38 branch r260756: https://llvm.org/svn/llvm-project/lldb/branches/release_38@260756 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c (contents, props changed) Modified: vendor/lldb/dist/Makefile vendor/lldb/dist/include/lldb/API/SBInstruction.h vendor/lldb/dist/include/lldb/Core/RangeMap.h vendor/lldb/dist/include/lldb/Symbol/Symtab.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py vendor/lldb/dist/scripts/interface/SBInstruction.i vendor/lldb/dist/source/API/SBInstruction.cpp vendor/lldb/dist/source/Core/Module.cpp vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile vendor/lldb/dist/source/Symbol/GoASTContext.cpp vendor/lldb/dist/source/Symbol/Symtab.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Modified: vendor/lldb/dist/Makefile ============================================================================== --- vendor/lldb/dist/Makefile Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -88,14 +88,6 @@ EXTRA_OPTIONS += -Wno-sign-compare ifeq ($(IS_TOP_LEVEL),1) -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) -$(RecursiveTargets):: - $(Verb) if [ ! -f test/Makefile ]; then \ - $(MKDIR) test; \ - $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ - fi -endif - test:: @ $(MAKE) -C test Modified: vendor/lldb/dist/include/lldb/API/SBInstruction.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBInstruction.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/API/SBInstruction.h Sat Feb 13 15:01:33 2016 (r295598) @@ -60,6 +60,9 @@ public: bool DoesBranch (); + bool + HasDelaySlot (); + void Print (FILE *out); Modified: vendor/lldb/dist/include/lldb/Core/RangeMap.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/RangeMap.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/Core/RangeMap.h Sat Feb 13 15:01:33 2016 (r295598) @@ -1216,6 +1216,25 @@ namespace lldb_private { } return UINT32_MAX; } + + uint32_t + FindEntryIndexesThatContain(B addr, std::vector &indexes) const + { +#ifdef ASSERT_RANGEMAP_ARE_SORTED + assert (IsSorted()); +#endif + + if (!m_entries.empty()) + { + typename Collection::const_iterator pos; + for (const auto &entry : m_entries) + { + if (entry.Contains(addr)) + indexes.push_back(entry.data); + } + } + return indexes.size() ; + } Entry * FindEntryThatContains (B addr) Modified: vendor/lldb/dist/include/lldb/Symbol/Symtab.h ============================================================================== --- vendor/lldb/dist/include/lldb/Symbol/Symtab.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/include/lldb/Symbol/Symtab.h Sat Feb 13 15:01:33 2016 (r295598) @@ -81,6 +81,7 @@ public: Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes); Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr); + void ForEachSymbolContainingFileAddress(lldb::addr_t file_addr, std::function const &callback); size_t FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list); void CalculateSymbolSizes (); Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Sat Feb 13 15:01:33 2016 (r295598) @@ -65,5 +65,6 @@ class ExprCharTestCase(TestBase): @expectedFailurei386("llvm.org/pr23069") @expectedFailurex86_64("llvm.org/pr23069") @expectedFailureWindows("llvm.org/pr21765") + @expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*') def test_unsigned_char(self): self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'}) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules + Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,84 @@ +""" +Test specific to MIPS +""" + +from __future__ import print_function + +import os, time +import re +import unittest2 +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + +class AvoidBreakpointInDelaySlotAPITestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessArch(archs=re.compile('mips*')) + def test(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + self.expect("file " + exe, + patterns = [ "Current executable set to .*a.out.*" ]) + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + breakpoint = target.BreakpointCreateByName('main', 'a.out') + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() == 1, + VALID_BREAKPOINT) + + # Now launch the process, and do not stop at entry point. + process = target.LaunchSimple (None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + list = target.FindFunctions('foo', lldb.eFunctionNameTypeAuto) + self.assertTrue(list.GetSize() == 1) + sc = list.GetContextAtIndex(0) + self.assertTrue(sc.GetSymbol().GetName() == "foo") + function = sc.GetFunction() + self.assertTrue(function) + self.function(function, target) + + def function (self, function, target): + """Iterate over instructions in function and place a breakpoint on delay slot instruction""" + # Get the list of all instructions in the function + insts = function.GetInstructions(target) + print(insts) + i = 0 + for inst in insts: + if (inst.HasDelaySlot()): + # Remember the address of branch instruction. + branchinstaddress = inst.GetAddress().GetLoadAddress(target) + + # Get next instruction i.e delay slot instruction. + delayinst = insts.GetInstructionAtIndex(i+1) + delayinstaddr = delayinst.GetAddress().GetLoadAddress(target) + + # Set breakpoint on delay slot instruction + breakpoint = target.BreakpointCreateByAddress(delayinstaddr) + + # Verify the breakpoint. + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() == 1, + VALID_BREAKPOINT) + # Get the location from breakpoint + location = breakpoint.GetLocationAtIndex(0) + + # Get the address where breakpoint is actually set. + bpaddr = location.GetLoadAddress() + + # Breakpoint address should be adjusted to the address of branch instruction. + self.assertTrue(branchinstaddress == bpaddr) + i += 1 + else: + i += 1 + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c Sat Feb 13 15:01:33 2016 (r295598) @@ -0,0 +1,21 @@ +#include + +foo (int a, int b) +{ + int c; + if (a<=b) + c=b-a; + else + c=b+a; + return c; +} + +int main() +{ + int a=7, b=8, c; + + c = foo(a, b); + +return 0; +} + Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lldbtest.py Sat Feb 13 15:01:33 2016 (r295598) @@ -633,6 +633,14 @@ def check_list_or_lambda(list_or_lambda, else: return list_or_lambda is None or value is None or list_or_lambda == value +def matchArchitectures(archs, actual_arch): + retype = type(re.compile('hello, world')) + list_passes = isinstance(archs, list) and actual_arch in archs + basestring_passes = isinstance(archs, six.string_types) and actual_arch == archs + regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch) + + return (list_passes or basestring_passes or regex_passes) + # provide a function to xfail on defined oslist, compiler version, and archs # if none is specified for any argument, that argument won't be checked and thus means for all # for example, @@ -1026,7 +1034,7 @@ def skipUnlessHostPlatform(oslist): return unittest2.skipUnless(getHostPlatform() in oslist, "requires on of %s" % (", ".join(oslist))) -def skipUnlessArch(archlist): +def skipUnlessArch(archs): """Decorate the item to skip tests unless running on one of the listed architectures.""" def myImpl(func): if isinstance(func, type) and issubclass(func, unittest2.TestCase): @@ -1035,9 +1043,8 @@ def skipUnlessArch(archlist): @wraps(func) def wrapper(*args, **kwargs): self = args[0] - if self.getArchitecture() not in archlist: - self.skipTest("skipping for architecture %s (requires one of %s)" % - (self.getArchitecture(), ", ".join(archlist))) + if not matchArchitectures(archs, self.getArchitecture()): + self.skipTest("skipping for architecture %s" % (self.getArchitecture())) else: func(*args, **kwargs) return wrapper Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py Sat Feb 13 15:01:33 2016 (r295598) @@ -24,7 +24,6 @@ class SymbolAPITestCase(TestBase): self.line2 = line_number('main.c', '// Find the line number for breakpoint 2 here.') @add_test_categories(['pyapi']) - @expectedFailureWindows("llvm.org/pr24778") def test(self): """Exercise some SBSymbol and SBAddress APIs.""" self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Sat Feb 13 15:01:33 2016 (r295598) @@ -22,6 +22,10 @@ class ThreadsStackTracesTestCase(TestBas self.line = line_number('main.cpp', '// Set break point at this line.') @expectedFailureAll("llvm.org/pr23043", ["linux"], archs=["i386"]) # We are unable to produce a backtrace of the main thread when the thread is blocked in fgets + + #The __thread_start function in libc doesn't contain any epilogue and prologue instructions + #hence unwinding fail when we are stopped in __thread_start + @expectedFailureAll(triple = 'mips*') @expectedFailureWindows("llvm.org/pr24778") @add_test_categories(['pyapi']) def test_stack_traces(self): Modified: vendor/lldb/dist/scripts/interface/SBInstruction.i ============================================================================== --- vendor/lldb/dist/scripts/interface/SBInstruction.i Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/scripts/interface/SBInstruction.i Sat Feb 13 15:01:33 2016 (r295598) @@ -51,6 +51,9 @@ public: bool DoesBranch (); + bool + HasDelaySlot (); + void Print (FILE *out); Modified: vendor/lldb/dist/source/API/SBInstruction.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBInstruction.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/API/SBInstruction.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -160,6 +160,14 @@ SBInstruction::DoesBranch () return false; } +bool +SBInstruction::HasDelaySlot () +{ + if (m_opaque_sp) + return m_opaque_sp->HasDelaySlot (); + return false; +} + void SBInstruction::SetOpaque (const lldb::InstructionSP &inst_sp) { Modified: vendor/lldb/dist/source/Core/Module.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Module.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Core/Module.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -559,7 +559,18 @@ Module::ResolveSymbolContextForAddress ( Symtab *symtab = sym_vendor->GetSymtab(); if (symtab && so_addr.IsSectionOffset()) { - sc.symbol = symtab->FindSymbolContainingFileAddress(so_addr.GetFileAddress()); + Symbol *matching_symbol = nullptr; + + symtab->ForEachSymbolContainingFileAddress(so_addr.GetFileAddress(), + [&matching_symbol](Symbol *symbol) -> bool { + if (symbol->GetType() != eSymbolTypeInvalid) + { + matching_symbol = symbol; + return false; // Stop iterating + } + return true; // Keep iterating + }); + sc.symbol = matching_symbol; if (!sc.symbol && resolve_scope & eSymbolContextFunction && !(resolved_flags & eSymbolContextFunction)) { Modified: vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp ============================================================================== --- vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -35,12 +35,12 @@ using namespace lldb_private; static char ID; -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check" +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check" #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check" static const char g_valid_pointer_check_text[] = "extern \"C\" void\n" -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" "{\n" " unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n" "}"; Modified: vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -242,16 +242,27 @@ ABISysV_mips::PrepareTrivialCall (Thread const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP); const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA); const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0); + const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0); if (log) - log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); + log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0); + + /* Write r0 with 0, in case we are stopped in syscall, + * such setting prevents automatic decrement of the PC. + * This clears the bug 23659 for MIPS. + */ + if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0)) + return false; + + if (log) + log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); // Set "sp" to the requested value if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp)) return false; if (log) - log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); + log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); // Set "ra" to the return address if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr)) Modified: vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -207,16 +207,27 @@ ABISysV_mips64::PrepareTrivialCall (Thre const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP); const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA); const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0); + const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0); if (log) - log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); + log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0); + + /* Write r0 with 0, in case we are stopped in syscall, + * such setting prevents automatic decrement of the PC. + * This clears the bug 23659 for MIPS. + */ + if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0)) + return false; + + if (log) + log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp); // Set "sp" to the requested value if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp)) return false; if (log) - log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); + log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr); // Set "ra" to the return address if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr)) Modified: vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -169,6 +169,18 @@ ObjectFilePECOFF::MagicBytesMatch (DataB return magic == IMAGE_DOS_SIGNATURE; } +lldb::SymbolType +ObjectFilePECOFF::MapSymbolType(uint16_t coff_symbol_type) +{ + // TODO: We need to complete this mapping of COFF symbol types to LLDB ones. + // For now, here's a hack to make sure our function have types. + const auto complex_type = coff_symbol_type >> llvm::COFF::SCT_COMPLEX_TYPE_SHIFT; + if (complex_type == llvm::COFF::IMAGE_SYM_DTYPE_FUNCTION) + { + return lldb::eSymbolTypeCode; + } + return lldb::eSymbolTypeInvalid; +} ObjectFilePECOFF::ObjectFilePECOFF (const lldb::ModuleSP &module_sp, DataBufferSP& data_sp, @@ -534,8 +546,8 @@ ObjectFilePECOFF::GetSymtab() { const uint32_t symbol_size = 18; const uint32_t addr_byte_size = GetAddressByteSize (); - const size_t symbol_data_size = num_syms * symbol_size; - // Include the 4 bytes string table size at the end of the symbols + const size_t symbol_data_size = num_syms * symbol_size; + // Include the 4-byte string table size at the end of the symbols DataBufferSP symtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff, symbol_data_size + 4)); DataExtractor symtab_data (symtab_data_sp, GetByteOrder(), addr_byte_size); lldb::offset_t offset = symbol_data_size; @@ -556,8 +568,8 @@ ObjectFilePECOFF::GetSymtab() coff_symbol_t symbol; const uint32_t symbol_offset = offset; const char *symbol_name_cstr = NULL; - // If the first 4 bytes of the symbol string are zero, then we - // it is followed by a 4 byte string table offset. Else these + // If the first 4 bytes of the symbol string are zero, then they + // are followed by a 4-byte string table offset. Else these // 8 bytes contain the symbol name if (symtab_data.GetU32 (&offset) == 0) { @@ -586,6 +598,7 @@ ObjectFilePECOFF::GetSymtab() { Address symbol_addr(sect_list->GetSectionAtIndex(symbol.sect-1), symbol.value); symbols[i].GetAddressRef() = symbol_addr; + symbols[i].SetType(MapSymbolType(symbol.type)); } if (symbol.naux > 0) Modified: vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Sat Feb 13 15:01:33 2016 (r295598) @@ -101,7 +101,10 @@ public: static bool MagicBytesMatch (lldb::DataBufferSP& data_sp); - + + static lldb::SymbolType + MapSymbolType(uint16_t coff_symbol_type); + bool ParseHeader() override; @@ -116,7 +119,7 @@ public: uint32_t GetAddressByteSize() const override; - + // virtual lldb_private::AddressClass // GetAddressClass (lldb::addr_t file_addr); Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/Makefile Sat Feb 13 15:01:33 2016 (r295598) @@ -8,6 +8,25 @@ ##===----------------------------------------------------------------------===## LLDB_LEVEL := ../../../.. +LEVEL := $(LLDB_LEVEL)/../.. + +include $(LEVEL)/Makefile.config + +SOURCES += PlatformDarwin.cpp \ + PlatformDarwinKernel.cpp \ + PlatformMacOSX.cpp \ + PlatformRemoteiOS.cpp \ + PlatformRemoteAppleTV.cpp \ + PlatformRemoteAppleWatch.cpp + +ifeq ($(HOST_OS),Darwin) +SOURCES += PlatformAppleSimulator.cpp \ + PlatformiOSSimulator.cpp \ + PlatformiOSSimulatorCoreSimulatorSupport.mm \ + PlatformAppleTVSimulator.cpp \ + PlatformAppleWatchSimulator.cpp +endif + LIBRARYNAME := lldbPluginPlatformMacOSX BUILD_ARCHIVE = 1 Modified: vendor/lldb/dist/source/Symbol/GoASTContext.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/GoASTContext.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Symbol/GoASTContext.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -13,6 +13,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/StreamFile.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/StringPrinter.h" @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( //---------------------------------------------------------------------- // Dumping types //---------------------------------------------------------------------- +#define DEPTH_INCREMENT 2 + void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, - const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, + const DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) { - assert(false); + if (IsTypedefType(type)) + type = GetTypedefedType(type).GetOpaqueQualType(); + if (!type) + return; + GoType *t = static_cast(type); + + if (GoStruct *st = t->GetStruct()) + { + if (GetCompleteType(type)) + { + uint32_t field_idx = 0; + for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) + { + // Print the starting squiggly bracket (if this is the + // first member) or comma (for member 2 and beyond) for + // the struct/union/class member. + if (field_idx == 0) + s->PutChar('{'); + else + s->PutChar(','); + + // Indent + s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); + + // Print the member type if requested + if (show_types) + { + ConstString field_type_name = field->m_type.GetTypeName(); + s->Printf("(%s) ", field_type_name.AsCString()); + } + // Print the member name and equal sign + s->Printf("%s = ", field->m_name.AsCString()); + + + // Dump the value of the member + CompilerType field_type = field->m_type; + field_type.DumpValue (exe_ctx, + s, // Stream to dump to + field_type.GetFormat(), // The format with which to display the member + data, // Data buffer containing all bytes for this type + data_byte_offset + field->m_byte_offset,// Offset into "data" where to grab value from + field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type + verbose, // Verbose output? + depth + DEPTH_INCREMENT); // Scope depth for any types that have children + } + + // Indent the trailing squiggly bracket + if (field_idx > 0) + s->Printf("\n%*s}", depth, ""); + + } + } + + if (GoArray *a = t->GetArray()) { + CompilerType element_clang_type = a->GetElementType(); + lldb::Format element_format = element_clang_type.GetFormat(); + uint32_t element_byte_size = element_clang_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()); + + uint64_t element_idx; + for (element_idx = 0; element_idx < a->GetLength(); ++element_idx) + { + // Print the starting squiggly bracket (if this is the + // first member) or comman (for member 2 and beyong) for + // the struct/union/class member. + if (element_idx == 0) + s->PutChar('{'); + else + s->PutChar(','); + + // Indent and print the index + s->Printf("\n%*s[%" PRIu64 "] ", depth + DEPTH_INCREMENT, "", element_idx); + + // Figure out the field offset within the current struct/union/class type + uint64_t element_offset = element_idx * element_byte_size; + + // Dump the value of the member + element_clang_type.DumpValue (exe_ctx, + s, // Stream to dump to + element_format, // The format with which to display the element + data, // Data buffer containing all bytes for this type + data_byte_offset + element_offset,// Offset into "data" where to grab value from + element_byte_size, // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type + verbose, // Verbose output? + depth + DEPTH_INCREMENT); // Scope depth for any types that have children + } + + // Indent the trailing squiggly bracket + if (element_idx > 0) + s->Printf("\n%*s}", depth, ""); + } + + if (show_summary) + DumpSummary (type, exe_ctx, s, data, data_byte_offset, data_byte_size); } bool @@ -1371,19 +1474,55 @@ void GoASTContext::DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size) { - assert(false); + if (type && GoType::KIND_STRING == static_cast(type)->GetGoKind()) + { + // TODO(ribrdb): read length and data + } } void GoASTContext::DumpTypeDescription(lldb::opaque_compiler_type_t type) { - assert(false); -} // Dump to stdout + // Dump to stdout + StreamFile s (stdout, false); + DumpTypeDescription (type, &s); +} void GoASTContext::DumpTypeDescription(lldb::opaque_compiler_type_t type, Stream *s) { - assert(false); + if (!type) + return; + ConstString name = GetTypeName(type); + GoType *t = static_cast(type); + + if (GoStruct *st = t->GetStruct()) + { + if (GetCompleteType(type)) + { + if (NULL == strchr(name.AsCString(), '{')) + s->Printf("type %s ", name.AsCString()); + s->PutCString("struct {"); + if (st->GetNumFields() == 0) { + s->PutChar('}'); + return; + } + s->IndentMore(); + uint32_t field_idx = 0; + for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) + { + s->PutChar('\n'); + s->Indent(); + s->Printf("%s %s", field->m_name.AsCString(), field->m_type.GetTypeName().AsCString()); + } + s->IndentLess(); + s->PutChar('\n'); + s->Indent("}"); + return; + } + } + + s->PutCString(name.AsCString()); } CompilerType Modified: vendor/lldb/dist/source/Symbol/Symtab.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/Symtab.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Symbol/Symtab.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -1071,6 +1071,26 @@ Symtab::FindSymbolContainingFileAddress } void +Symtab::ForEachSymbolContainingFileAddress(addr_t file_addr, std::function const &callback) +{ + Mutex::Locker locker (m_mutex); + + if (!m_file_addr_to_index_computed) + InitAddressIndexes(); + + std::vector all_addr_indexes; + + // Get all symbols with file_addr + const size_t addr_match_count = m_file_addr_to_index.FindEntryIndexesThatContain(file_addr, all_addr_indexes); + + for (size_t i = 0; i < addr_match_count; ++i) + { + if (!callback(SymbolAtIndex(all_addr_indexes[i]))) + break; + } +} + +void Symtab::SymbolIndicesToSymbolContextList (std::vector &symbol_indexes, SymbolContextList &sc_list) { // No need to protect this call using m_mutex all other method calls are Modified: vendor/lldb/dist/source/Target/Target.cpp ============================================================================== --- vendor/lldb/dist/source/Target/Target.cpp Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/source/Target/Target.cpp Sat Feb 13 15:01:33 2016 (r295598) @@ -2442,18 +2442,18 @@ Target::GetBreakableLoadAddress (lldb::a SymbolContext sc; uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc); + Address sym_addr; if (sc.function) - { - function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this); - if (function_start == LLDB_INVALID_ADDRESS) - function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress(); - } + sym_addr = sc.function->GetAddressRange().GetBaseAddress(); else if (sc.symbol) - { - Address sym_addr = sc.symbol->GetAddress(); + sym_addr = sc.symbol->GetAddress(); + + function_start = sym_addr.GetLoadAddress(this); + if (function_start == LLDB_INVALID_ADDRESS) function_start = sym_addr.GetFileAddress(); - } - current_offset = addr - function_start; + + if (function_start) + current_offset = addr - function_start; } // If breakpoint address is start of function then we dont have to do anything. Modified: vendor/lldb/dist/tools/lldb-server/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Feb 13 15:01:14 2016 (r295597) +++ vendor/lldb/dist/tools/lldb-server/CMakeLists.txt Sat Feb 13 15:01:33 2016 (r295598) @@ -33,24 +33,19 @@ add_lldb_executable(lldb-server LLDBServerUtilities.cpp ) -if (BUILD_SHARED_LIBS ) - target_link_libraries(lldb-server liblldb) - target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) +# The Darwin linker doesn't understand --start-group/--end-group. +if (LLDB_LINKER_SUPPORTS_GROUPS) + target_link_libraries(lldb-server + -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) + target_link_libraries(lldb-server + -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group) else() - # The Darwin linker doesn't understand --start-group/--end-group. - if (LLDB_LINKER_SUPPORTS_GROUPS) - target_link_libraries(lldb-server - -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) - target_link_libraries(lldb-server - -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group) - else() - target_link_libraries(lldb-server ${LLDB_USED_LIBS}) - target_link_libraries(lldb-server ${CLANG_USED_LIBS}) - endif() - llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) - - target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) + target_link_libraries(lldb-server ${LLDB_USED_LIBS}) + target_link_libraries(lldb-server ${CLANG_USED_LIBS}) endif() +llvm_config(lldb-server ${LLVM_LINK_COMPONENTS}) + +target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS}) set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION}) From owner-svn-src-vendor@freebsd.org Sat Feb 13 15:01:56 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E21AA741E; Sat, 13 Feb 2016 15:01:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E83E61BAE; Sat, 13 Feb 2016 15:01:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DF1t82053475; Sat, 13 Feb 2016 15:01:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1DF1tNp053474; Sat, 13 Feb 2016 15:01:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602131501.u1DF1tNp053474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Feb 2016 15:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r295599 - vendor/lldb/lldb-release_38-r260756 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 15:01:56 -0000 Author: dim Date: Sat Feb 13 15:01:54 2016 New Revision: 295599 URL: https://svnweb.freebsd.org/changeset/base/295599 Log: Tag lldb release_38 branch r260756. Added: vendor/lldb/lldb-release_38-r260756/ - copied from r295598, vendor/lldb/dist/