Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Nov 2018 18:54:24 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r340235 - in projects/clang700-import: lib/csu/mips lib/csu/sparc64 libexec/rtld-elf share/man/man8 share/mk stand/common stand/i386/libi386 sys/arm64/arm64 sys/compat/freebsd32 sys/geo...
Message-ID:  <201811071854.wA7IsOHg058783@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Nov  7 18:54:24 2018
New Revision: 340235
URL: https://svnweb.freebsd.org/changeset/base/340235

Log:
  Merge ^/head r340213 through r340234.

Modified:
  projects/clang700-import/lib/csu/mips/crt.h
  projects/clang700-import/lib/csu/sparc64/crt.h
  projects/clang700-import/libexec/rtld-elf/rtld.c
  projects/clang700-import/share/man/man8/rc.subr.8
  projects/clang700-import/share/mk/src.opts.mk
  projects/clang700-import/stand/common/disk.c
  projects/clang700-import/stand/common/part.c
  projects/clang700-import/stand/i386/libi386/biosdisk.c
  projects/clang700-import/sys/arm64/arm64/elf_machdep.c
  projects/clang700-import/sys/compat/freebsd32/freebsd32_systrace_args.c
  projects/clang700-import/sys/compat/freebsd32/syscalls.master
  projects/clang700-import/sys/geom/geom_io.c
  projects/clang700-import/sys/kern/imgact_elf.c
  projects/clang700-import/sys/kern/makesyscalls.sh
  projects/clang700-import/sys/kern/syscalls.master
  projects/clang700-import/sys/kern/systrace_args.c
  projects/clang700-import/sys/riscv/riscv/elf_machdep.c
  projects/clang700-import/sys/sys/elf_common.h
  projects/clang700-import/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  projects/clang700-import/   (props changed)

Modified: projects/clang700-import/lib/csu/mips/crt.h
==============================================================================
--- projects/clang700-import/lib/csu/mips/crt.h	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/lib/csu/mips/crt.h	Wed Nov  7 18:54:24 2018	(r340235)
@@ -27,5 +27,25 @@
 #define	_CRT_H_
 
 #define	HAVE_CTORS
+#define	CTORS_CONSTRUCTORS
+#ifdef __mips_o32
+#define	INIT_CALL_SEQ(func)						\
+    ".set noreorder		\n"					\
+    "bal	1f		\n"					\
+    "nop			\n"					\
+    "1:				\n"					\
+    ".cpload $ra		\n"					\
+    ".set reorder		\n"					\
+    "jal	" __STRING(func)
+#else
+#define	INIT_CALL_SEQ(func)						\
+    ".set noreorder		\n"					\
+    "bal	1f		\n"					\
+    "nop			\n"					\
+    "1:				\n"					\
+    ".set reorder		\n"					\
+    ".cpsetup $ra, $v0, 1b	\n"					\
+    "jal	" __STRING(func)
+#endif
 
 #endif

Modified: projects/clang700-import/lib/csu/sparc64/crt.h
==============================================================================
--- projects/clang700-import/lib/csu/sparc64/crt.h	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/lib/csu/sparc64/crt.h	Wed Nov  7 18:54:24 2018	(r340235)
@@ -27,5 +27,7 @@
 #define	_CRT_H_
 
 #define	HAVE_CTORS
+#define	CTORS_CONSTRUCTORS
+#define	INIT_CALL_SEQ(func)	"call " __STRING(func) "; nop"
 
 #endif

Modified: projects/clang700-import/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/clang700-import/libexec/rtld-elf/rtld.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/libexec/rtld-elf/rtld.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -1264,6 +1264,13 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D
 		*((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr) &r_debug;
 		break;
 
+	case DT_MIPS_RLD_MAP_REL:
+		// The MIPS_RLD_MAP_REL tag stores the offset to the .rld_map
+		// section relative to the address of the tag itself.
+		*((Elf_Addr *)(__DECONST(char*, dynp) + dynp->d_un.d_val)) =
+		    (Elf_Addr) &r_debug;
+		break;
+
 	case DT_MIPS_PLTGOT:
 		obj->mips_pltgot = (Elf_Addr *)(obj->relocbase +
 		    dynp->d_un.d_ptr);

Modified: projects/clang700-import/share/man/man8/rc.subr.8
==============================================================================
--- projects/clang700-import/share/man/man8/rc.subr.8	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/share/man/man8/rc.subr.8	Wed Nov  7 18:54:24 2018	(r340235)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 19, 2018
+.Dd November 7, 2018
 .Dt RC.SUBR 8
 .Os
 .Sh NAME
@@ -491,16 +491,22 @@ Check for the existence of the listed directories
 before running the
 .Cm start
 method.
+The list is checked before running
+.Va start_precmd .
 .It Va required_files
 Check for the readability of the listed files
 before running the
 .Cm start
 method.
+The list is checked before running
+.Va start_precmd .
 .It Va required_modules
 Ensure that the listed kernel modules are loaded
 before running the
 .Cm start
 method.
+The list is checked after running
+.Va start_precmd .
 This is done after invoking the commands from
 .Va start_precmd
 so that the missing modules are not loaded in vain
@@ -531,6 +537,8 @@ on each of the list variables
 before running the
 .Cm start
 method.
+The list is checked after running
+.Va start_precmd .
 .It Va ${name}_chdir
 Directory to
 .Ic cd

Modified: projects/clang700-import/share/mk/src.opts.mk
==============================================================================
--- projects/clang700-import/share/mk/src.opts.mk	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/share/mk/src.opts.mk	Wed Nov  7 18:54:24 2018	(r340235)
@@ -193,6 +193,7 @@ __DEFAULT_YES_OPTIONS = \
     ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
+    BSD_CRTBEGIN \
     BSD_GREP \
     CLANG_EXTRAS \
     DTRACE_TESTS \
@@ -383,13 +384,6 @@ BROKEN_OPTIONS+=HYPERV
 # NVME is only x86 and powerpc64
 .if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "powerpc64"
 BROKEN_OPTIONS+=NVME
-.endif
-
-.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
-    ${__T} == "powerpc64"
-__DEFAULT_NO_OPTIONS+=BSD_CRTBEGIN
-.else
-BROKEN_OPTIONS+=BSD_CRTBEGIN
 .endif
 
 .include <bsd.mkopt.mk>

Modified: projects/clang700-import/stand/common/disk.c
==============================================================================
--- projects/clang700-import/stand/common/disk.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/stand/common/disk.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -265,9 +265,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
 		rc = ENXIO;
 		goto out;
 	}
-	if (mediasize > od->mediasize) {
-		od->mediasize = mediasize;
-	}
+	od->mediasize = mediasize;
 
 	if (ptable_gettype(od->table) == PTABLE_BSD &&
 	    partition >= 0) {

Modified: projects/clang700-import/stand/common/part.c
==============================================================================
--- projects/clang700-import/stand/common/part.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/stand/common/part.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -323,8 +323,7 @@ ptable_gptread(struct ptable *table, void *dev, diskre
 	 * Note, this is still not a foolproof way to get disk's size. For
 	 * example, an image file can be truncated when copied to smaller media.
 	 */
-	if (hdr.hdr_lba_alt + 1 > table->sectors)
-		table->sectors = hdr.hdr_lba_alt + 1;
+	table->sectors = hdr.hdr_lba_alt + 1;
 
 	for (i = 0; i < size / hdr.hdr_entsz; i++) {
 		ent = (struct gpt_ent *)(tbl + i * hdr.hdr_entsz);

Modified: projects/clang700-import/stand/i386/libi386/biosdisk.c
==============================================================================
--- projects/clang700-import/stand/i386/libi386/biosdisk.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/stand/i386/libi386/biosdisk.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -439,6 +439,33 @@ bd_print(int verbose)
 }
 
 /*
+ * Read disk size from partition.
+ * This is needed to work around buggy BIOS systems returning
+ * wrong (truncated) disk media size.
+ * During bd_probe() we tested if the multiplication of bd_sectors
+ * would overflow so it should be safe to perform here.
+ */
+static uint64_t
+bd_disk_get_sectors(struct disk_devdesc *dev)
+{
+	struct disk_devdesc disk;
+	uint64_t size;
+
+	disk.dd.d_dev = dev->dd.d_dev;
+	disk.dd.d_unit = dev->dd.d_unit;
+	disk.d_slice = -1;
+	disk.d_partition = -1;
+	disk.d_offset = 0;
+
+	size = BD(dev).bd_sectors * BD(dev).bd_sectorsize;
+	if (disk_open(&disk, size, BD(dev).bd_sectorsize) == 0) {
+		(void) disk_ioctl(&disk, DIOCGMEDIASIZE, &size);
+		disk_close(&disk);
+	}
+	return (size / BD(dev).bd_sectorsize);
+}
+
+/*
  * Attempt to open the disk described by (dev) for use by (f).
  *
  * Note that the philosophy here is "give them exactly what
@@ -452,9 +479,7 @@ static int
 bd_open(struct open_file *f, ...)
 {
 	struct disk_devdesc *dev;
-	struct disk_devdesc disk;
 	va_list ap;
-	uint64_t size;
 	int rc;
 
 	va_start(ap, f);
@@ -470,33 +495,12 @@ bd_open(struct open_file *f, ...)
 		if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA)
 			return (EIO);
 	}
-	BD(dev).bd_open++;
 	if (BD(dev).bd_bcache == NULL)
 	    BD(dev).bd_bcache = bcache_allocate();
 
-	/*
-	 * Read disk size from partition.
-	 * This is needed to work around buggy BIOS systems returning
-	 * wrong (truncated) disk media size.
-	 * During bd_probe() we tested if the mulitplication of bd_sectors
-	 * would overflow so it should be safe to perform here.
-	 */
-	disk.dd.d_dev = dev->dd.d_dev;
-	disk.dd.d_unit = dev->dd.d_unit;
-	disk.d_slice = -1;
-	disk.d_partition = -1;
-	disk.d_offset = 0;
-
-	if (disk_open(&disk, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
-	    BD(dev).bd_sectorsize) == 0) {
-
-		if (disk_ioctl(&disk, DIOCGMEDIASIZE, &size) == 0) {
-			size /= BD(dev).bd_sectorsize;
-			if (size > BD(dev).bd_sectors)
-				BD(dev).bd_sectors = size;
-		}
-		disk_close(&disk);
-	}
+	if (BD(dev).bd_open == 0)
+		BD(dev).bd_sectors = bd_disk_get_sectors(dev);
+	BD(dev).bd_open++;
 
 	rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
 	    BD(dev).bd_sectorsize);

Modified: projects/clang700-import/sys/arm64/arm64/elf_machdep.c
==============================================================================
--- projects/clang700-import/sys/arm64/arm64/elf_machdep.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/arm64/arm64/elf_machdep.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -107,21 +107,6 @@ static Elf64_Brandinfo freebsd_brand_info = {
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
 
-static Elf64_Brandinfo freebsd_brand_oinfo = {
-	.brand		= ELFOSABI_FREEBSD,
-	.machine	= EM_AARCH64,
-	.compat_3_brand	= "FreeBSD",
-	.emul_path	= NULL,
-	.interp_path	= "/usr/libexec/ld-elf.so.1",
-	.sysvec		= &elf64_freebsd_sysvec,
-	.interp_newpath	= NULL,
-	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
-};
-
-SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
-    (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);
-
 void
 elf64_dump_thread(struct thread *td __unused, void *dst __unused,
     size_t *off __unused)

Modified: projects/clang700-import/sys/compat/freebsd32/freebsd32_systrace_args.c
==============================================================================
--- projects/clang700-import/sys/compat/freebsd32/freebsd32_systrace_args.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/compat/freebsd32/freebsd32_systrace_args.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -8839,7 +8839,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* break */
 	case 17:
 		if (ndx == 0 || ndx == 1)
-			p = "caddr_t";
+			p = "void *";
 		break;
 	/* getpid */
 	case 20:
@@ -9388,7 +9388,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* shmat */
 	case 228:
 		if (ndx == 0 || ndx == 1)
-			p = "int";
+			p = "void *";
 		break;
 	/* shmdt */
 	case 230:
@@ -10139,7 +10139,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* freebsd32_mmap */
 	case 477:
 		if (ndx == 0 || ndx == 1)
-			p = "caddr_t";
+			p = "void *";
 		break;
 	/* freebsd32_lseek */
 	case 478:
@@ -10170,7 +10170,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* freebsd32_mmap */
 	case 477:
 		if (ndx == 0 || ndx == 1)
-			p = "caddr_t";
+			p = "void *";
 		break;
 	/* freebsd32_lseek */
 	case 478:

Modified: projects/clang700-import/sys/compat/freebsd32/syscalls.master
==============================================================================
--- projects/clang700-import/sys/compat/freebsd32/syscalls.master	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/compat/freebsd32/syscalls.master	Wed Nov  7 18:54:24 2018	(r340235)
@@ -88,7 +88,7 @@
 					int mode, int dev); }
 15	AUE_CHMOD	NOPROTO	{ int chmod(const char *path, mode_t mode); }
 16	AUE_CHOWN	NOPROTO	{ int chown(const char *path, int uid, int gid); }
-17	AUE_NULL	NOPROTO	{ caddr_t break(char *nsize); }
+17	AUE_NULL	NOPROTO	{ void *break(char *nsize); }
 18	AUE_GETFSSTAT	COMPAT4	{ int freebsd32_getfsstat( \
 				    struct statfs32 *buf, long bufsize, \
 				    int mode); }
@@ -175,7 +175,7 @@
 68	AUE_NULL	OBSOL	vwrite
 69	AUE_SBRK	NOPROTO	{ int sbrk(int incr); }
 70	AUE_SSTK	NOPROTO	{ int sstk(int incr); }
-71	AUE_MMAP	COMPAT|NOPROTO	{ int mmap(void *addr, int len, \
+71	AUE_MMAP	COMPAT|NOPROTO	{ void *mmap(void *addr, int len, \
 				    int prot, int flags, int fd, int pos); }
 72	AUE_O_VADVISE	COMPAT11|NOPROTO	{ int vadvise(int anom); }
 73	AUE_MUNMAP	NOPROTO	{ int munmap(void *addr, size_t len); }
@@ -373,7 +373,7 @@
 				    __setrlimit_args int
 196	AUE_GETDIRENTRIES COMPAT11 { int freebsd32_getdirentries(int fd, \
 				    char *buf, u_int count, int32_t *basep); }
-197	AUE_MMAP	COMPAT6	{ caddr_t freebsd32_mmap(void *addr, \
+197	AUE_MMAP	COMPAT6	{ void *freebsd32_mmap(void *addr, \
 				    size_t len, int prot, int flags, int fd, \
 				    int pad, uint32_t pos1, uint32_t pos2); }
 198	AUE_NULL	NOPROTO	{ int nosys(void); } __syscall \
@@ -432,7 +432,7 @@
 				    size_t msgsz, int msgflg); }
 227	AUE_MSGRCV	NOSTD	{ int freebsd32_msgrcv(int msqid, void *msgp, \
 				    size_t msgsz, long msgtyp, int msgflg); }
-228	AUE_SHMAT	NOSTD|NOPROTO	{ int shmat(int shmid, void *shmaddr, \
+228	AUE_SHMAT	NOSTD|NOPROTO	{ void *shmat(int shmid, void *shmaddr, \
 				    int shmflg); }
 229	AUE_SHMCTL	COMPAT7|NOSTD	{ int freebsd32_shmctl( \
 				    int shmid, int cmd, \
@@ -876,7 +876,7 @@
 				    const void *buf, size_t nbyte, \
 				    int pad, \
 				    uint32_t offset1, uint32_t offset2); }
-477	AUE_MMAP	STD 	{ caddr_t freebsd32_mmap(void *addr, \
+477	AUE_MMAP	STD 	{ void *freebsd32_mmap(void *addr, \
 				    size_t len, int prot, int flags, int fd, \
 				    int pad, \
 				    uint32_t pos1, uint32_t pos2); }
@@ -897,7 +897,7 @@
 476	AUE_PWRITE	STD	{ ssize_t freebsd32_pwrite(int fd, \
 				    const void *buf, size_t nbyte, \
 				    uint32_t offset1, uint32_t offset2); }
-477	AUE_MMAP	STD 	{ caddr_t freebsd32_mmap(void *addr, \
+477	AUE_MMAP	STD 	{ void *freebsd32_mmap(void *addr, \
 				    size_t len, int prot, int flags, int fd, \
 				    uint32_t pos1, uint32_t pos2); }
 478	AUE_LSEEK	STD	{ off_t freebsd32_lseek(int fd, \

Modified: projects/clang700-import/sys/geom/geom_io.c
==============================================================================
--- projects/clang700-import/sys/geom/geom_io.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/geom/geom_io.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -420,8 +420,6 @@ g_io_check(struct bio *bp)
 			return (EIO);
 		if (bp->bio_offset > pp->mediasize)
 			return (EIO);
-		if (bp->bio_offset == pp->mediasize && bp->bio_length > 0)
-			return (EIO);
 
 		/* Truncate requests to the end of providers media. */
 		excess = bp->bio_offset + bp->bio_length;

Modified: projects/clang700-import/sys/kern/imgact_elf.c
==============================================================================
--- projects/clang700-import/sys/kern/imgact_elf.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/kern/imgact_elf.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -120,7 +120,8 @@ SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), 
 
 int __elfN(nxstack) =
 #if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \
-    (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__)
+    (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) || \
+    defined(__riscv)
 	1;
 #else
 	0;

Modified: projects/clang700-import/sys/kern/makesyscalls.sh
==============================================================================
--- projects/clang700-import/sys/kern/makesyscalls.sh	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/kern/makesyscalls.sh	Wed Nov  7 18:54:24 2018	(r340235)
@@ -325,6 +325,7 @@ sed -e '
 	}
 	function parseline() {
 		f=4			# toss number, type, audit event
+		ret_inc = 0
 		argc= 0;
 		argssize = "0"
 		thr_flag = "SY_THR_STATIC"
@@ -340,12 +341,15 @@ sed -e '
 			funcalias=""
 			argalias=""
 			rettype="int"
+			if ($(f+2) == "*") {
+				ret_inc = 1
+			}
 			end=NF
 		}
 		if (flag("NODEF")) {
 			auditev="AUE_NULL"
-			funcname=$4
-			argssize = "AS(" $6 ")"
+			funcname=$(4 + ret_inc)
+			argssize = "AS(" $(6 + ret_inc) ")"
 			return
 		}
 		if ($f != "{")
@@ -363,6 +367,11 @@ sed -e '
 
 		syscallret=$f
 		f++
+		while (ret_inc > 0) {
+			syscallret=syscallret " " $f
+			f++
+			ret_inc--
+		}
 
 		funcname=$f
 

Modified: projects/clang700-import/sys/kern/syscalls.master
==============================================================================
--- projects/clang700-import/sys/kern/syscalls.master	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/kern/syscalls.master	Wed Nov  7 18:54:24 2018	(r340235)
@@ -180,7 +180,7 @@
 		);
 	}
 17	AUE_NULL	STD {
-		caddr_t break(
+		void *break(
 		    _In_ char *nsize
 		);
 	}
@@ -480,7 +480,7 @@
 		);
 	}
 71	AUE_MMAP	COMPAT {
-		int mmap(
+		void *mmap(
 		    _In_ void *addr,
 		    int len,
 		    int prot,
@@ -1168,7 +1168,7 @@
 		);
 	}
 197	AUE_MMAP	COMPAT6 {
-		caddr_t mmap(
+		void *mmap(
 		    _In_ void *addr,
 		    size_t len,
 		    int prot,
@@ -1317,7 +1317,7 @@
 		);
 	}
 228	AUE_SHMAT	NOSTD {
-		int shmat(
+		void *shmat(
 		    int shmid,
 		    _In_ const void *shmaddr,
 		    int shmflg
@@ -2543,7 +2543,7 @@
 		);
 	}
 477	AUE_MMAP	STD {
-		caddr_t mmap(
+		void *mmap(
 		    _In_ void *addr,
 		    size_t len,
 		    int prot,

Modified: projects/clang700-import/sys/kern/systrace_args.c
==============================================================================
--- projects/clang700-import/sys/kern/systrace_args.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/kern/systrace_args.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -8788,7 +8788,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* break */
 	case 17:
 		if (ndx == 0 || ndx == 1)
-			p = "caddr_t";
+			p = "void *";
 		break;
 	/* getpid */
 	case 20:
@@ -9357,7 +9357,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* shmat */
 	case 228:
 		if (ndx == 0 || ndx == 1)
-			p = "int";
+			p = "void *";
 		break;
 	/* shmdt */
 	case 230:
@@ -10187,7 +10187,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
 	/* mmap */
 	case 477:
 		if (ndx == 0 || ndx == 1)
-			p = "caddr_t";
+			p = "void *";
 		break;
 	/* lseek */
 	case 478:

Modified: projects/clang700-import/sys/riscv/riscv/elf_machdep.c
==============================================================================
--- projects/clang700-import/sys/riscv/riscv/elf_machdep.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/riscv/riscv/elf_machdep.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -83,10 +83,12 @@ struct sysentvec elf64_freebsd_sysvec = {
 	.sv_setregs	= exec_setregs,
 	.sv_fixlimit	= NULL,
 	.sv_maxssiz	= NULL,
-	.sv_flags	= SV_ABI_FREEBSD | SV_LP64,
+	.sv_flags	= SV_ABI_FREEBSD | SV_LP64 | SV_SHP,
 	.sv_set_syscall_retval = cpu_set_syscall_retval,
 	.sv_fetch_syscall_args = cpu_fetch_syscall_args,
 	.sv_syscallnames = syscallnames,
+	.sv_shared_page_base = SHAREDPAGE,
+	.sv_shared_page_len = PAGE_SIZE,
 	.sv_schedtail	= NULL,
 	.sv_thread_detach = NULL,
 	.sv_trap	= NULL,
@@ -108,22 +110,6 @@ static Elf64_Brandinfo freebsd_brand_info = {
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
 	(sysinit_cfunc_t) elf64_insert_brand_entry,
 	&freebsd_brand_info);
-
-static Elf64_Brandinfo freebsd_brand_oinfo = {
-	.brand		= ELFOSABI_FREEBSD,
-	.machine	= EM_RISCV,
-	.compat_3_brand	= "FreeBSD",
-	.emul_path	= NULL,
-	.interp_path	= "/usr/libexec/ld-elf.so.1",
-	.sysvec		= &elf64_freebsd_sysvec,
-	.interp_newpath	= NULL,
-	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
-};
-
-SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
-	(sysinit_cfunc_t) elf64_insert_brand_entry,
-	&freebsd_brand_oinfo);
 
 static int debug_kld;
 SYSCTL_INT(_kern, OID_AUTO, debug_kld,

Modified: projects/clang700-import/sys/sys/elf_common.h
==============================================================================
--- projects/clang700-import/sys/sys/elf_common.h	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/sys/sys/elf_common.h	Wed Nov  7 18:54:24 2018	(r340235)
@@ -707,6 +707,7 @@ typedef struct {
 #define	DT_MIPS_PLTGOT			0x70000032
 #define	DT_MIPS_RLD_OBJ_UPDATE		0x70000033
 #define	DT_MIPS_RWPLT			0x70000034
+#define	DT_MIPS_RLD_MAP_REL		0x70000035
 
 #define	DT_PPC_GOT			0x70000000
 #define	DT_PPC_TLSOPT			0x70000001

Modified: projects/clang700-import/tools/tools/syscall_timing/syscall_timing.c
==============================================================================
--- projects/clang700-import/tools/tools/syscall_timing/syscall_timing.c	Wed Nov  7 18:52:28 2018	(r340234)
+++ projects/clang700-import/tools/tools/syscall_timing/syscall_timing.c	Wed Nov  7 18:54:24 2018	(r340235)
@@ -335,6 +335,23 @@ test_getuid(uintmax_t num, uintmax_t int_arg __unused,
 }
 
 static uintmax_t
+test_lstat(uintmax_t num, uintmax_t int_arg __unused, const char *path)
+{
+	struct stat sb;
+	uintmax_t i;
+	int error;
+
+	benchmark_start();
+	BENCHMARK_FOREACH(i, num) {
+		error = lstat(path, &sb);
+		if (error != 0)
+			err(-1, "lstat");
+	}
+	benchmark_stop();
+	return (i);
+}
+
+static uintmax_t
 test_memcpy(uintmax_t num, uintmax_t int_arg, const char *path __unused)
 {
 	char buf[int_arg], buf2[int_arg];
@@ -824,6 +841,23 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg
 }
 
 static uintmax_t
+test_readlink(uintmax_t num, uintmax_t int_arg __unused, const char *path)
+{
+	char buf[PATH_MAX];
+	ssize_t rv;
+	uintmax_t i;
+
+	benchmark_start();
+	BENCHMARK_FOREACH(i, num) {
+		rv = readlink(path, buf, sizeof(buf));
+		if (rv < 0 && errno != EINVAL)
+			err(-1, "readlink");
+	}
+	benchmark_stop();
+	return (i);
+}
+
+static uintmax_t
 test_vfork(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused)
 {
 	pid_t pid;
@@ -904,6 +938,7 @@ static const struct test tests[] = {
 	{ "getresuid", test_getresuid, .t_flags = 0 },
 	{ "gettimeofday", test_gettimeofday, .t_flags = 0 },
 	{ "getuid", test_getuid, .t_flags = 0 },
+	{ "lstat", test_lstat, .t_flags = FLAG_PATH },
 	{ "memcpy_1", test_memcpy, .t_flags = 0, .t_int = 1 },
 	{ "memcpy_10", test_memcpy, .t_flags = 0, .t_int = 10 },
 	{ "memcpy_100", test_memcpy, .t_flags = 0, .t_int = 100 },
@@ -962,6 +997,7 @@ static const struct test tests[] = {
 	{ "socketpair_dgram", test_socketpair_dgram, .t_flags = 0 },
 	{ "socket_tcp", test_socket_stream, .t_int = PF_INET },
 	{ "socket_udp", test_socket_dgram, .t_int = PF_INET },
+	{ "readlink", test_readlink, .t_flags = FLAG_PATH },
 	{ "vfork", test_vfork, .t_flags = 0 },
 	{ "vfork_exec", test_vfork_exec, .t_flags = 0 },
 };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811071854.wA7IsOHg058783>