Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jun 2019 12:34:29 +0000 (UTC)
From:      Leandro Lupori <luporl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348683 - in stable/12: cddl/contrib/opensolaris/lib/libzfs/common stand/common stand/ofw/libofw stand/powerpc/boot1.chrp stand/powerpc/kboot stand/powerpc/ofw
Message-ID:  <201906051234.x55CYTcC098338@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luporl
Date: Wed Jun  5 12:34:28 2019
New Revision: 348683
URL: https://svnweb.freebsd.org/changeset/base/348683

Log:
  MFC r348005:
  [PowerPC64] stand: fix build using clang 8 as compiler
  
  This change fixes "stand" build issues when using clang 8
  as compiler.
  
  Submitted by:	alfredo.junior_eldorado.org.br
  Reviewed by:	jhibbits
  Differential Revision:	https://reviews.freebsd.org/D20026

Modified:
  stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
  stable/12/stand/common/load_elf.c
  stable/12/stand/ofw/libofw/ofw_net.c
  stable/12/stand/ofw/libofw/openfirm.c
  stable/12/stand/powerpc/boot1.chrp/boot1.c
  stable/12/stand/powerpc/kboot/Makefile
  stable/12/stand/powerpc/kboot/main.c
  stable/12/stand/powerpc/ofw/elf_freebsd.c
  stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
==============================================================================
--- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -114,7 +114,7 @@ get_stats_for_obj(differ_info_t *di, const char *dsnam
 		(void) snprintf(di->errbuf, sizeof (di->errbuf),
 		    dgettext(TEXT_DOMAIN,
 		    "Unable to determine path or stats for "
-		    "object %lld in %s"), obj, dsname);
+		    "object %jd in %s"), (uintmax_t)obj, dsname);
 		return (-1);
 	}
 }
@@ -406,8 +406,8 @@ write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff
 		} else {
 			(void) snprintf(di->errbuf, sizeof (di->errbuf),
 			    dgettext(TEXT_DOMAIN,
-			    "next allocated object (> %lld) find failure"),
-			    zc.zc_obj);
+			    "next allocated object (> %jd) find failure"),
+			    (uintmax_t)zc.zc_obj);
 			di->zerr = errno;
 			break;
 		}

Modified: stable/12/stand/common/load_elf.c
==============================================================================
--- stable/12/stand/common/load_elf.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/common/load_elf.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -483,7 +483,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_
 			off += 0x01000000;
 			ehdr->e_entry += off;
 #ifdef ELF_VERBOSE
-			printf("Converted entry 0x%08x\n", ehdr->e_entry);
+			printf("Converted entry 0x%jx\n", (uintmax_t)ehdr->e_entry);
 #endif
 		} else
 			off = 0;
@@ -509,8 +509,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_
 		off -= ehdr->e_entry & ~PAGE_MASK;
 		ehdr->e_entry += off;
 #ifdef ELF_VERBOSE
-		printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n",
-		    ehdr->e_entry, off);
+		printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n",
+		    (uintmax_t)ehdr->e_entry, off);
 #endif
 #else
 		off = 0;	/* other archs use direct mapped kernels */

Modified: stable/12/stand/ofw/libofw/ofw_net.c
==============================================================================
--- stable/12/stand/ofw/libofw/ofw_net.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/ofw/libofw/ofw_net.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -225,12 +225,12 @@ ofwn_init(struct iodesc *desc, void *machdep_hint)
 	dmabuf = NULL;
 	if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf)
 	    < 0) {   
-		printf("Failed to allocate DMA buffer (got %08x).\n", dmabuf);
+		printf("Failed to allocate DMA buffer (got %p).\n", dmabuf);
 		goto punt;
 	}
 
 #if defined(NETIF_DEBUG)
-	printf("ofwn_init: allocated DMA buffer: %08x\n", dmabuf);
+	printf("ofwn_init: allocated DMA buffer: %p\n", dmabuf);
 #endif
 #endif
 

Modified: stable/12/stand/ofw/libofw/openfirm.c
==============================================================================
--- stable/12/stand/ofw/libofw/openfirm.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/ofw/libofw/openfirm.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -669,7 +669,6 @@ OF_block_size(ihandle_t instance)
 }
 
 /* 
-/*
  * Memory functions
  */
 

Modified: stable/12/stand/powerpc/boot1.chrp/boot1.c
==============================================================================
--- stable/12/stand/powerpc/boot1.chrp/boot1.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/powerpc/boot1.chrp/boot1.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/elf.h>
 #include <machine/stdarg.h>
 #include <machine/md_var.h>
+#include <ufs/ffs/fs.h>
 
 #include "paths.h"
 

Modified: stable/12/stand/powerpc/kboot/Makefile
==============================================================================
--- stable/12/stand/powerpc/kboot/Makefile	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/powerpc/kboot/Makefile	Wed Jun  5 12:34:28 2019	(r348683)
@@ -36,9 +36,6 @@ CFLAGS+=	-DRELOC=${RELOC}
 
 LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
 
-# 64-bit bridge extensions
-CFLAGS+= -Wa,-mppc64bridge
-
 DPADD=		${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
 LDADD=		${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
 

Modified: stable/12/stand/powerpc/kboot/main.c
==============================================================================
--- stable/12/stand/powerpc/kboot/main.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/powerpc/kboot/main.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -484,8 +484,18 @@ kboot_kseg_get(int *nseg, void **ptr)
 void
 _start(int argc, const char **argv, char **env)
 {
+// This makes error "variable 'sp' is uninitialized" be just a warning on clang.
+// Initializing 'sp' is not desired here as it would overwrite "r1" original value
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic warning "-Wuninitialized"
+#endif
 	register volatile void **sp asm("r1");
 	main((int)sp[0], (const char **)&sp[1]);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
 }
 
 /*

Modified: stable/12/stand/powerpc/ofw/elf_freebsd.c
==============================================================================
--- stable/12/stand/powerpc/ofw/elf_freebsd.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/powerpc/ofw/elf_freebsd.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -84,7 +84,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp)
 	if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0)
 		return (error);
 
-	printf("Kernel entry at 0x%lx ...\n", e->e_entry);
+	printf("Kernel entry at 0x%x ...\n", entry);
 
 	dev_cleanup();
 	if (dtbp != 0) {

Modified: stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c
==============================================================================
--- stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c	Wed Jun  5 09:25:40 2019	(r348682)
+++ stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c	Wed Jun  5 12:34:28 2019	(r348683)
@@ -87,7 +87,7 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp)
 	if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0)
 		return (error);
 
-	printf("Kernel entry at 0x%lx ...\n", entry);
+	printf("Kernel entry at 0x%x ...\n", entry);
 
 	dev_cleanup();
 



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