Bug 244772

Summary: emulators/qemu-sbruno: Fix build with lld 10.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: freebsd-emulation (Nobody) <emulation>
Status: Closed FIXED    
Severity: Affects Some People CC: db, kevans
Priority: --- Flags: kevans: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Fix emulators/qemu-sbruno build with lld 10.0.0 none

Description Dimitry Andric freebsd_committer freebsd_triage 2020-03-12 20:51:08 UTC
Created attachment 212362 [details]
Fix emulators/qemu-sbruno build with lld 10.0.0

As reported in bug 244251, with clang and lld 10.0.0 the emulators/qemu-sbruno port fails in the configure stage:

===>  Configuring for qemu-user-static-2.11.50.g20191211_3

ERROR: We need to link the QEMU user mode binaries at a
       specific text address. Unfortunately your linker
       doesn't support either the -Ttext-segment option or
       printing the default linker script with --verbose.
       If you don't want the user mode binaries, pass the
       --disable-user option to configure.

===>  Script "configure" failed unexpectedly.
Please report the problem to emulation@FreeBSD.org [maintainer] and attach
the
"/wrkdirs/usr/ports/emulators/qemu-user-static/work/qemu-bsd-user-d587db6/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

This is because lld 10.0.0 no longer supports the -Ttext-segment option, and uses --image-base for similar functionality.

I am proposing a patch that makes the configure script check for the --image-base option first, then the -Ttext-segment option.
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2020-03-19 18:08:44 UTC
Maintainer approves.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-03-20 00:48:44 UTC
A commit references this bug:

Author: db
Date: Fri Mar 20 00:47:59 UTC 2020
New revision: 528752
URL: https://svnweb.freebsd.org/changeset/ports/528752

Log:
  Fix emulators/qemu-sbruno build with lld 10.0.0

  As reported in bug 244251, with clang and lld 10.0.0 the emulators/qemu-sbruno port fails in the configure stage:

  ===>  Configuring for qemu-user-static-2.11.50.g20191211_3

  ERROR: We need to link the QEMU user mode binaries at a
         specific text address. Unfortunately your linker
         doesn't support either the -Ttext-segment option or
         printing the default linker script with --verbose.
         If you don't want the user mode binaries, pass the
         --disable-user option to configure.

  ===>  Script "configure" failed unexpectedly.
  Please report the problem to emulation@FreeBSD.org [maintainer] and attach
  the
  "/wrkdirs/usr/ports/emulators/qemu-user-static/work/qemu-bsd-user-d587db6/config.log"
  including the output of the failure of your make command. Also, it might be
  a good idea to provide an overview of all packages installed on your system
  (e.g. a /usr/local/sbin/pkg-static info -g -Ea).
  *** Error code 1

  This is because lld 10.0.0 no longer supports the -Ttext-segment option, and uses --image-base for similar functionality.

  I am proposing a patch that makes the configure script check for the --image-base option first, then the -Ttext-segment option.

  PR:		ports/244772
  Submitted by:	dim@FreeBSD.org
  Approved by:	Maintainer

Changes:
  head/emulators/qemu-user-static-devel/files/patch-configure