Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Mar 2016 15:32:49 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r412232 - in head: misc misc/seabios misc/seabios/files sysutils/xen-tools sysutils/xen-tools/files
Message-ID:  <201603311532.u2VFWn0l037907@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger (src committer)
Date: Thu Mar 31 15:32:49 2016
New Revision: 412232
URL: https://svnweb.freebsd.org/changeset/ports/412232

Log:
  xen-tools: extract seabios, build with clang
  
  Submitted by:		bapt
  Minor fixes by:		royger
  Approved by:		bapt

Added:
  head/misc/seabios/
  head/misc/seabios/Makefile   (contents, props changed)
  head/misc/seabios/distinfo   (contents, props changed)
  head/misc/seabios/files/
  head/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch   (contents, props changed)
  head/misc/seabios/pkg-descr   (contents, props changed)
  head/sysutils/xen-tools/files/patch-tools_libxc_xc__dom__bzimageloader.c   (contents, props changed)
  head/sysutils/xen-tools/files/patch-tools_misc_xenpm.c   (contents, props changed)
Deleted:
  head/sysutils/xen-tools/files/0001-build-fix-.text-section-address-alignment.patch
  head/sysutils/xen-tools/files/patch-tools_firmware_seabios-dir_scripts_buildversion.sh
Modified:
  head/misc/Makefile
  head/sysutils/xen-tools/Makefile
  head/sysutils/xen-tools/distinfo

Modified: head/misc/Makefile
==============================================================================
--- head/misc/Makefile	Thu Mar 31 15:23:13 2016	(r412231)
+++ head/misc/Makefile	Thu Mar 31 15:32:49 2016	(r412232)
@@ -420,6 +420,7 @@
     SUBDIR += shc
     SUBDIR += shuffle
     SUBDIR += shuffle-db
+    SUBDIR += seabios
     SUBDIR += since
     SUBDIR += skyutils
     SUBDIR += sloccount

Added: head/misc/seabios/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/seabios/Makefile	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME=	seabios
+PORTVERSION=	1.9.1
+CATEGORIES=	misc
+MASTER_SITES=	http://code.coreboot.org/p/seabios/downloads/get/
+
+MAINTAINER=	royger@FreeBSD.org
+COMMENT=	Open source implementation of a 16bit X86 BIOS
+
+LICENSE=	LGPL3
+
+USES=	gmake python:build
+
+MAKE_ARGS=	HOSTCC="${CC}" LD32BIT_FLAG="-melf_i386_fbsd"
+USE_GCC=	yes
+
+EXTRA_PATCHES=	${FILESDIR}/0001-build-fix-.text-section-address-alignment.patch:-p1
+
+PLIST_FILES=	${DATADIR}/bios.bin
+
+do-install:
+	${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/out/bios.bin ${STAGEDIR}${DATADIR}
+
+.include <bsd.port.mk>
+RUN_DEPENDS:=	${RUN_DEPENDS:Ngcc*}

Added: head/misc/seabios/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/seabios/distinfo	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,2 @@
+SHA256 (seabios-1.9.1.tar.gz) = 8a2a562fe5cfd37fe8327cdc4a60accdfe441e235b29e6999fdeb442ba98d608
+SIZE (seabios-1.9.1.tar.gz) = 570186

Added: head/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,73 @@
+From 8a0df37ee2f77a126925dfe9ae1d6a6bd24aad45 Mon Sep 17 00:00:00 2001
+From: Kevin O'Connor <kevin@koconnor.net>
+Date: Fri, 19 Feb 2016 21:34:16 -0500
+Subject: [PATCH] build: fix .text section address alignment
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some linkers verify that sections have a start address that is aligned
+with the minimum alignment of that section.  Add extra padding to the
+".text" section to ensure it is always aligned with the maximum
+alignment of any section placed in ".text".
+
+Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Reported by: Ed Maste <emaste@FreeBSD.org>
+
+(cherry picked from commit 3910de0dee216d5b5bf23cfa29bfc80d082b2ee7)
+---
+ scripts/layoutrom.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
+index b976fb0..6616721 100755
+--- a/scripts/layoutrom.py
++++ b/scripts/layoutrom.py
+@@ -34,18 +34,22 @@ COMMONTRAILER = """
+ # Determine section locations
+ ######################################################################
+ 
+-# Align 'pos' to 'alignbytes' offset
++# Align 'pos' up to 'alignbytes' offset
+ def alignpos(pos, alignbytes):
+     mask = alignbytes - 1
+     return (pos + mask) & ~mask
+ 
++# Align 'pos' down to 'alignbytes' offset
++def aligndown(pos, alignbytes):
++    mask = alignbytes - 1
++    return pos & ~mask
++
+ # Determine the final addresses for a list of sections that end at an
+ # address.
+ def setSectionsStart(sections, endaddr, minalign=1, segoffset=0):
+     totspace = 0
+     for section in sections:
+-        if section.align > minalign:
+-            minalign = section.align
++        minalign = max(minalign, section.align)
+         totspace = alignpos(totspace, section.align) + section.size
+     startaddr = int((endaddr - totspace) / minalign) * minalign
+     curaddr = startaddr
+@@ -269,7 +273,7 @@ def doLayout(sections, config, genreloc):
+         final_sec32low_end = BUILD_LOWRAM_END
+         zonelow_base = final_sec32low_end - 64*1024
+     relocdelta = final_sec32low_end - sec32low_end
+-    li.sec32low_start, li.sec32low_align = setSectionsStart(
++    li.sec32low_start, sec32low_align = setSectionsStart(
+         sections32low, sec32low_end, 16
+         , segoffset=zonelow_base - relocdelta)
+     li.sec32low_end = sec32low_end
+@@ -405,6 +409,8 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
+     if li.config.get('CONFIG_MULTIBOOT'):
+         multiboot_header = "LONG(0x1BADB002) LONG(0) LONG(-0x1BADB002)"
+         sec32all_start -= 3 * 4
++    sec32all_align = max([section.align for section in li.sections])
++    sec32all_start = aligndown(sec32all_start, sec32all_align)
+     out += outXRefs(filesections32flat, exportsyms=[li.entrysym]) + """
+     _reloc_min_align = 0x%x ;
+     zonefseg_start = 0x%x ;
+-- 
+2.6.4 (Apple Git-63)
+

Added: head/misc/seabios/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/seabios/pkg-descr	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,4 @@
+Seabios is an open source implementation of a 16bit X86 BIOS. SeaBIOS can run in
+an emulator or it can run natively on X86 hardware
+
+WWW: http://www.seabios.org

Modified: head/sysutils/xen-tools/Makefile
==============================================================================
--- head/sysutils/xen-tools/Makefile	Thu Mar 31 15:23:13 2016	(r412231)
+++ head/sysutils/xen-tools/Makefile	Thu Mar 31 15:32:49 2016	(r412232)
@@ -2,10 +2,9 @@
 
 PORTNAME=	xen
 PORTVERSION=	4.5.2
-PORTREVISION=   2
+PORTREVISION=   3
 CATEGORIES=	sysutils emulators
-MASTER_SITES=	http://bits.xensource.com/oss-xen/release/${PORTVERSION}/ \
-		http://code.coreboot.org/p/seabios/downloads/get/:seabios
+MASTER_SITES=	http://bits.xensource.com/oss-xen/release/${PORTVERSION}/
 PKGNAMESUFFIX=	-tools
 
 MAINTAINER=	royger@FreeBSD.org
@@ -17,27 +16,25 @@ LICENSE_COMB=	multi
 LIB_DEPENDS=	libyajl.so:${PORTSDIR}/devel/yajl \
 		liblzo2.so:${PORTSDIR}/archivers/lzo2 \
 		libpixman-1.so:${PORTSDIR}/x11/pixman
-BUILD_DEPENDS=	dev86>0:${PORTSDIR}/devel/dev86
+BUILD_DEPENDS=	dev86>0:${PORTSDIR}/devel/dev86 \
+		seabios>0:${PORTSDIR}/misc/seabios
 
 OPTIONS_DEFINE=	DOCS
 
 ONLY_FOR_ARCHS=	amd64
 ONLY_FOR_ARCHS_REASON=	"not yet ported to anything other than amd64"
 
-SEABIOSVERSION=	1.8.2
-DISTFILES+=	${DISTNAME}.tar.gz \
-		seabios-${SEABIOSVERSION}.tar.gz:seabios
-
 WRKSRC=		${WRKDIR}/xen-${PORTVERSION}
 
-USES=		cpe gmake libtool perl5 pkgconfig python shebangfix
+USES=		cpe gmake libtool perl5 pkgconfig python shebangfix localbase
 USE_GNOME=	glib20
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	HOSTCC="${CC}" CC="${CC}" \
 		ac_cv_path_BASH=${TRUE} \
 		ac_cv_path_XGETTEXT=${TRUE}
-MAKE_ARGS=	HOSTCC="${CC}" CC="${CC}" GCC="${GCC}" cc="${GCC}"
+MAKE_ARGS=	HOSTCC="${CC}" CC="${CC}" GCC="${CC}" cc="${GCC}" \
+		HOSTCFLAGS="${CFLAGS}" SEABIOS_PATH="${LOCALBASE}/share/seabios/bios.bin"
 QEMU_ARGS=	--disable-gtk \
 		--disable-smartcard-nss \
 		--disable-sdl \
@@ -47,15 +44,15 @@ QEMU_ARGS=	--disable-gtk \
 		--disable-tools \
 		--disable-curl \
 		--cxx=c++
+CFLAGS=		-Wno-ignored-attributes -Qunused-arguments -Wno-header-guard \
+		-Wno-tautological-compare -Wno-format-extra-args -w
 
 EXTRA_PATCHES=	${FILESDIR}/0002-libxc-fix-xc_dom_load_elf_symtab.patch:-p1 \
-		${FILESDIR}/0001-build-fix-.text-section-address-alignment.patch:-p1 \
 		${FILESDIR}/xsa160-4.6.patch:-p1
 
 CONFIGURE_ARGS+=	--with-extra-qemuu-configure-args="${QEMU_ARGS}"
 SHEBANG_FILES=	tools/misc/xencov_split \
 		tools/misc/xen-ringwatch
-USE_GCC=	yes
 ALL_TARGET=	tools docs
 INSTALL_TARGET=	install-tools install-docs
 
@@ -65,9 +62,6 @@ INSTALL_TARGET=	install-tools install-do
 IGNORE=		only supported on FreeBSD
 .endif
 
-post-extract:
-	${MV} ${WRKDIR}/seabios-${SEABIOSVERSION} ${WRKSRC}/tools/firmware/seabios-dir
-
 post-patch:
 	@${REINPLACE_CMD} "s,x86_64,amd64,g" ${WRKSRC}/tools/configure
 	@${REINPLACE_CMD} -e "s,/var/lib,/var/db,g" \

Modified: head/sysutils/xen-tools/distinfo
==============================================================================
--- head/sysutils/xen-tools/distinfo	Thu Mar 31 15:23:13 2016	(r412231)
+++ head/sysutils/xen-tools/distinfo	Thu Mar 31 15:32:49 2016	(r412232)
@@ -1,4 +1,2 @@
 SHA256 (xen-4.5.2.tar.gz) = 4c9e5dac4eea484974e9f76da2756c8e0973b4e884d28d37e955df9ebf00e7e8
 SIZE (xen-4.5.2.tar.gz) = 18416220
-SHA256 (seabios-1.8.2.tar.gz) = f59479307fdae840de398b75aacb2333c8eba24a5964d68c77e32ca6c987ee61
-SIZE (seabios-1.8.2.tar.gz) = 538497

Added: head/sysutils/xen-tools/files/patch-tools_libxc_xc__dom__bzimageloader.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/patch-tools_libxc_xc__dom__bzimageloader.c	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,11 @@
+--- tools/libxc/xc_dom_bzimageloader.c.orig	2015-11-03 09:11:18 UTC
++++ tools/libxc/xc_dom_bzimageloader.c
+@@ -469,7 +469,7 @@ static int xc_try_lzo1x_decode(
+ 
+     for ( *size = 0; ; )
+     {
+-        lzo_uint src_len, dst_len, out_len;
++        lzo_uint src_len, dst_len, out_len = 0;
+         unsigned char *tmp_buf;
+ 
+         msg = "Short input";

Added: head/sysutils/xen-tools/files/patch-tools_misc_xenpm.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/patch-tools_misc_xenpm.c	Thu Mar 31 15:32:49 2016	(r412232)
@@ -0,0 +1,13 @@
+--- tools/misc/xenpm.c.orig	2015-11-03 09:11:18 UTC
++++ tools/misc/xenpm.c
+@@ -97,8 +97,8 @@ static void parse_cpuid_and_int(int argc
+ 
+     if ( argc == 0 || sscanf(argv[argc > 1], "%d", val) != 1 )
+     {
+-        fprintf(stderr, argc ? "Invalid %s '%s'\n" : "Missing %s\n",
+-                what, argv[argc > 1]);
++        fprintf(stderr, argc ? "Invalid %s '%s'\n" : "Missing %s\n%s",
++                what, argc ? argv[argc > 1] : "");
+         exit(EINVAL);
+     }
+ }



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