Index: head/sysutils/xen-tools411/Makefile =================================================================== --- head/sysutils/xen-tools411/Makefile (revision 477952) +++ head/sysutils/xen-tools411/Makefile (revision 477953) @@ -1,94 +1,96 @@ # $FreeBSD$ PORTNAME= xen PKGNAMESUFFIX= -tools411 PORTVERSION= 4.11.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ MAINTAINER= royger@FreeBSD.org COMMENT= Xen management tools LICENSE= GPLv2 LGPL3 LICENSE_COMB= multi BROKEN_FreeBSD_10= does not build LIB_DEPENDS= libyajl.so:devel/yajl \ liblzo2.so:archivers/lzo2 \ libpixman-1.so:x11/pixman \ libargp.so:devel/argp-standalone DOCS_BUILD_DEPENDS=markdown>0:textproc/markdown \ hs-pandoc>0:textproc/hs-pandoc BUILD_DEPENDS= seabios>0:misc/seabios RUN_DEPENDS= seabios>0:misc/seabios OPTIONS_DEFINE= DOCS ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than amd64" USES= cpe gettext gmake libtool localbase:ldflags perl5 pkgconfig \ python:2.7 shebangfix USE_GNOME= glib20 USE_LDCONFIG= yes HAS_CONFIGURE= yes # Set ARCH=x86_64 in order to overwrite the environment ARCH=amd64 MAKE_ARGS= clang=y ARCH=x86_64 # Set correct include paths taking /usr/local into account. EXTRA_PATCHES= ${FILESDIR}/0001-build-fix-include-paths-in-FreeBSD.patch:-p1 # Build with lld (LLVM linker) EXTRA_PATCHES+= ${FILESDIR}/0001-x86-replace-usage-in-the-linker-script.patch:-p1 \ ${FILESDIR}/0001-x86-efi-move-the-logic-to-detect-PE-build-support.patch:-p1 \ ${FILESDIR}/0002-x86-efi-split-compiler-vs-linker-support.patch:-p1 # Fix docs build EXTRA_PATCHES+= ${FILESDIR}/0001-docs-use-the-make-wildcard-function-instead-of-find.patch:-p1 # XSA-273 and XSA-272 EXTRA_PATCHES+= ${FILESDIR}/0031-tools-oxenstored-Make-evaluation-order-explicit.patch:-p1 \ ${FILESDIR}/0041-xl.conf-Add-global-affinity-masks.patch:-p1 +# Fix hvmloader build with LLVM LD +EXTRA_PATCHES+= ${FILESDIR}/0001-hvmloader-fix-build-with-LLVM-Linker.patch:-p1 CONFIGURE_ARGS+= --with-system-seabios=${LOCALBASE}/share/seabios/bios.bin SHEBANG_FILES= tools/misc/xen-ringwatch \ tools/misc/xencov_split \ tools/python/scripts/convert-legacy-stream \ tools/python/scripts/verify-stream-v2 \ tools/xenmon/xenmon.py ALL_TARGET= tools DOCS_ALL_TARGET= docs INSTALL_TARGET= install-tools DOCS_INSTALL_TARGET= install-docs .include .if ${OPSYS} != FreeBSD IGNORE= only supported on FreeBSD .endif .if ${OSVERSION} < 1200074 IGNORE= only supported on recent FreeBSD HEAD .endif post-patch: @for p in `ls ${FILESDIR}/*qemuu*.patch 2>/dev/null`; do \ ${ECHO_CMD} "====> Applying $${p##*/}" ; \ ${PATCH} -s -p1 -i $${p} -d ${WRKSRC}/tools/qemu-xen ; \ done # The ports native 'build' target cannot be used because it sets CFLAGS, and # that breaks the Xen kernel build system that's used by the tools in order to # build the pv-shim. do-build: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${ALL_TARGET} do-install: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${INSTALL_TARGET} post-install: ${MKDIR} ${STAGEDIR}/var/run/xen .include Index: head/sysutils/xen-tools411/files/0001-hvmloader-fix-build-with-LLVM-Linker.patch =================================================================== --- head/sysutils/xen-tools411/files/0001-hvmloader-fix-build-with-LLVM-Linker.patch (nonexistent) +++ head/sysutils/xen-tools411/files/0001-hvmloader-fix-build-with-LLVM-Linker.patch (revision 477953) @@ -0,0 +1,101 @@ +From 9aa8c031ce844ada6832a56d3b25341bed2825db Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Fri, 24 Aug 2018 10:14:28 +0200 +Subject: [PATCH] hvmloader: fix build with LLVM Linker +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The hvmloader binary generated when using LLVM LD doesn't work +properly and seems to get stuck while trying to generate and load the +ACPI tables. This is caused by the layout of the binary when linked +with LLVM LD. + +LLVM LD has a different default linker script that GNU LD, and the +resulting hvmloader binary is slightly different: + +LLVM LD: +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + PHDR 0x000034 0x000ff034 0x000ff034 0x00060 0x00060 R 0x4 + LOAD 0x000000 0x000ff000 0x000ff000 0x38000 0x38000 RWE 0x1000 + GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0 + +GNU LD: +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000080 0x00100000 0x00100000 0x36308 0x3fd74 RWE 0x10 + GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 + +Note that in the LLVM LD case (as with GNU LD) the .text section does +indeed have the address set to 0x100000 as requested on the command +line: + +[ 1] .text PROGBITS 00100000 001000 00dd10 00 AX 0 0 16 + +There's however the PHDR which is not present when using GNU LD. + +Fix this by using a very simple linker script that generates the same +binary regardless of whether LLVM or GNU LD is used. By using a linker +script the usage of -Ttext can also be avoided by placing the desired +.text load address directly in the linker script. + +Signed-off-by: Roger Pau Monné +--- +Jan Beulich +Andrew Cooper +Wei Liu +Ian Jackson +--- + tools/firmware/hvmloader/Makefile | 7 ++----- + tools/firmware/hvmloader/hvmloader.lds | 13 +++++++++++++ + 2 files changed, 15 insertions(+), 5 deletions(-) + create mode 100644 tools/firmware/hvmloader/hvmloader.lds + +diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile +index 496ac72b77..e980ce7c5f 100644 +--- a/tools/firmware/hvmloader/Makefile ++++ b/tools/firmware/hvmloader/Makefile +@@ -20,9 +20,6 @@ + XEN_ROOT = $(CURDIR)/../../.. + include $(XEN_ROOT)/tools/firmware/Rules.mk + +- +-LOADADDR = 0x100000 +- + # SMBIOS spec requires format mm/dd/yyyy + SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y) + +@@ -82,8 +79,8 @@ vpath build.c $(ACPI_PATH) + vpath static_tables.c $(ACPI_PATH) + OBJS += $(ACPI_OBJS) + +-hvmloader: $(OBJS) +- $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(LOADADDR) -o $@ $^ ++hvmloader: $(OBJS) hvmloader.lds ++ $(LD) $(LDFLAGS_DIRECT) -N -T hvmloader.lds -o $@ $(OBJS) + + roms.inc: $(ROMS) + echo "/* Autogenerated file. DO NOT EDIT */" > $@.new +diff --git a/tools/firmware/hvmloader/hvmloader.lds b/tools/firmware/hvmloader/hvmloader.lds +new file mode 100644 +index 0000000000..15d8f38fff +--- /dev/null ++++ b/tools/firmware/hvmloader/hvmloader.lds +@@ -0,0 +1,13 @@ ++SECTIONS ++{ ++ . = 0x100000; ++ /* ++ * NB: there's no need to use the AT keyword in order to set the LMA, by ++ * default the linker will use VMA = LMA unless specified otherwise. ++ */ ++ .text : { *(.text) } ++ .rodata : { *(.rodata) } ++ .data : { *(.data) } ++ .bss : { *(.bss) } ++ _end = .; ++} +-- +2.18.0 + Property changes on: head/sysutils/xen-tools411/files/0001-hvmloader-fix-build-with-LLVM-Linker.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property