Bug 244770 - emulators/qemu: Fix build with lld 10.0.0
Summary: emulators/qemu: Fix build with lld 10.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
Depends on:
Blocks: 244251
  Show dependency treegraph
Reported: 2020-03-12 20:50 UTC by Dimitry Andric
Modified: 2020-03-20 17:31 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)

Fix emulators/qemu build with lld 10.0.0 (5.62 KB, patch)
2020-03-12 20:50 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2020-03-12 20:50:58 UTC
Created attachment 212360 [details]
Fix emulators/qemu build with lld 10.0.0

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

===>  Configuring for qemu-4.1.1_1

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 bofh@FreeBSD.org [maintainer] and attach the
"/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.1.1/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 olevole 2020-03-18 21:54:15 UTC
works for me!

% clang -v && uname -Kmr
FreeBSD clang version 10.0.0 (git@github.com:llvm/llvm-project.git llvmorg-10.0.0-rc3-1-gc290cb61fdc)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
13.0-CURRENT amd64 1300084
Comment 2 Dimitry Andric freebsd_committer 2020-03-18 22:35:08 UTC
Btw, the important part here is if people can check whether the qemu user mode binaries work as they should.

I did some light testing of qemu-static-mips64, with the binaries provided on https://wiki.freebsd.org/QemuUserModeHowTo, and that seemed to work.
Comment 3 commit-hook freebsd_committer 2020-03-20 17:29:49 UTC
A commit references this bug:

Author: bofh
Date: Fri Mar 20 17:29:32 UTC 2020
New revision: 528790
URL: https://svnweb.freebsd.org/changeset/ports/528790

  emulators/qemu: Fix build with lld 10.0.0

  PR:		244770
  Submitted by:	dim

Comment 4 Muhammad Moinur Rahman freebsd_committer 2020-03-20 17:31:21 UTC
Sorry for the delay. Messed up my builder while upgrading. Will take care of the rest of the qemu* soon. They are already being built when I write.