1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

xen-tools: extract seabios, build with clang

Submitted by:		bapt
Minor fixes by:		royger
Approved by:		bapt
This commit is contained in:
Roger Pau Monné 2016-03-31 15:32:49 +00:00
parent 5ef60cf65d
commit 029c399e28
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=412232
10 changed files with 81 additions and 40 deletions

View File

@ -420,6 +420,7 @@
SUBDIR += shc
SUBDIR += shuffle
SUBDIR += shuffle-db
SUBDIR += seabios
SUBDIR += since
SUBDIR += skyutils
SUBDIR += sloccount

27
misc/seabios/Makefile Normal file
View File

@ -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*}

2
misc/seabios/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (seabios-1.9.1.tar.gz) = 8a2a562fe5cfd37fe8327cdc4a60accdfe441e235b29e6999fdeb442ba98d608
SIZE (seabios-1.9.1.tar.gz) = 570186

View File

@ -1,6 +1,6 @@
From 70a912f04dec2b556f37a60d1f596fcedb13f8a8 Mon Sep 17 00:00:00 2001
From 8a0df37ee2f77a126925dfe9ae1d6a6bd24aad45 Mon Sep 17 00:00:00 2001
From: Kevin O'Connor <kevin@koconnor.net>
Date: Wed, 24 Feb 2016 11:45:55 +0100
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
@ -14,14 +14,16 @@ 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/tools/firmware/seabios-dir/scripts/layoutrom.py b/tools/firmware/seabios-dir/scripts/layoutrom.py
index dd770fe..c7e406c 100755
--- a/tools/firmware/seabios-dir/scripts/layoutrom.py
+++ b/tools/firmware/seabios-dir/scripts/layoutrom.py
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
######################################################################
@ -48,7 +50,7 @@ index dd770fe..c7e406c 100755
totspace = alignpos(totspace, section.align) + section.size
startaddr = int((endaddr - totspace) / minalign) * minalign
curaddr = startaddr
@@ -267,7 +271,7 @@ def doLayout(sections, config, genreloc):
@@ -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
@ -57,15 +59,15 @@ index dd770fe..c7e406c 100755
sections32low, sec32low_end, 16
, segoffset=zonelow_base - relocdelta)
li.sec32low_end = sec32low_end
@@ -399,6 +403,8 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
filesections32flat = getSectionsFileid(li.sections, '32flat')
out = outXRefs([], exportsyms=li.varlowsyms
, forcedelta=li.final_sec32low_start-li.sec32low_start)
@@ -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.5.4 (Apple Git-61)
2.6.4 (Apple Git-63)

4
misc/seabios/pkg-descr Normal file
View File

@ -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

View File

@ -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-docs
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" \

View File

@ -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

View File

@ -1,11 +0,0 @@
--- tools/firmware/seabios-dir/scripts/buildversion.sh.orig 2015-03-13 09:02:17 UTC
+++ tools/firmware/seabios-dir/scripts/buildversion.sh
@@ -12,7 +12,7 @@ if [ -z "$BUILD_VERSION" ]; then
else
VERSION="?"
fi
- VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`"
+ VERSION="${VERSION}"
else
VERSION="$BUILD_VERSION"
fi

View File

@ -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";

View File

@ -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);
}
}