qemu-user: fix build with LLVM lld 10
PATCH 1/1 qemu-user: fix build with LLVM lld 10
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
--- configure | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-)
configure +23 -19
@@ -6514,27 +6514,31 @@ if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] ) && [ "$pie" = no ]; then cat > $TMPC <<EOF int main(void) { return 0; } EOF - textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" + # Test with image-base first, which appeared in lld 10.0.0 + textseg_ldflags="-Wl,--image-base=$textseg_addr" if ! compile_prog "" "$textseg_ldflags"; then - # In case ld does not support -Ttext-segment, edit the default linker - # script via sed to set the .text start addr. This is needed on FreeBSD - # at least. - if ! $ld --verbose >/dev/null 2>&1; then - error_exit \ - "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." - fi + textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" + if ! compile_prog "" "$textseg_ldflags"; then + # In case ld does not support -Ttext-segment, edit the default linker + # script via sed to set the .text start addr. This is needed on FreeBSD + # at least. + if ! $ld --verbose >/dev/null 2>&1; then + error_exit \ + "We need to link the QEMU user mode binaries at a" \ + "specific text address. Unfortunately your linker" \ + "doesn't support either the --image-base or -Ttext-segment" \ + "options or printing the default linker script with" \ + "--verbose. If you don't want the user mode binaries," \ + "pass the --disable-user option to configure." + fi - $ld --verbose | sed \ - -e '1,/==================================================/d' \ - -e '/==================================================/,$d' \ - -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ - -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld - textseg_ldflags="-Wl,-T../config-host.ld" + $ld --verbose | sed \ + -e '1,/==================================================/d' \ + -e '/==================================================/,$d' \ + -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ + -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld + textseg_ldflags="-Wl,-T../config-host.ld" + fi fi fi fi
Signature · 1 line
2.26.0
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>
Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the x86_64 vsyscall patches upstream.
r~
Quoted 16 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---
Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.
While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
Thanks, Roger.
Quoted 19 lines · Roger Pau Monné
Quoted 18 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---The Plan is still to drop this whole section of code.
Quoted 7 lines
Quoted 1 line
However, it's still blocked on getting the
x86_64vsyscall patches upstream.While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
I think the vsyscall patch has just been merged, however way I don't think targeting HEAD of a OS release during the rc phase is appropriate.
Signature · 1 line
Alex Bennée
Quoted 24 lines · Alex Bennée
Quoted 21 lines · Roger Pau Monné
Quoted 19 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.
Quoted 8 lines
Quoted 5 lines
While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
I think the vsyscall patch has just been merged, however way I don't think targeting HEAD of a OS release during the rc phase is appropriate.
I'm not sure I understand what you mean. If QEMU doesn't build on FreeBSD HEAD it won't build on the next release. Also the LLVM toolchain used is not a development version AFAIK, but the actual 10.0.0 release, which QEMU should aim to support?
Can this be applied to stable branches then please if QEMU master doesn't have that chunk in configure anymore?
FWIW, I've just looked at configure from git master branch and it still has that exact same linker detection chunk that this patch is trying to fix.
Thanks, Roger.
Quoted 31 lines · Roger Pau Monné
Quoted 30 lines · Alex Bennée
Quoted 26 lines · Roger Pau Monné
Quoted 16 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
Quoted 7 lines
Quoted 2 lines
I think the vsyscall patch has just been merged, however way I don't think targeting HEAD of a OS release during the rc phase is appropriate.
I'm not sure I understand what you mean. If QEMU doesn't build on FreeBSD HEAD it won't build on the next release. Also the LLVM toolchain used is not a development version AFAIK, but the actual 10.0.0 release, which QEMU should aim to support?
QEMU's supported build platforms are based on what is currently shipping as stable versions:
https://www.qemu.org/docs/master/system/build-platforms.html
Quoted 2 lines
Can this be applied to stable branches then please if QEMU master doesn't have that chunk in configure anymore?
Usually platforms released after a given QEMU release will just carry their own patches in the local packaging. When is the current HEAD due to be cut as the next release? The schedule for QEMU's release is documented on out planning pages:
https://wiki.qemu.org/Planning/5.0
Quoted 3 lines
FWIW, I've just looked at configure from git master branch and it still has that exact same linker detection chunk that this patch is trying to fix.
Now the vsyscalls patch is in this can be cleaned up I think. Richard?
Signature · 1 line
Alex Bennée
Quoted 42 lines · Alex Bennée
Quoted 31 lines · Roger Pau Monné
Quoted 30 lines · Alex Bennée
Quoted 26 lines · Roger Pau Monné
Quoted 16 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
Quoted 7 lines
Quoted 2 lines
I think the vsyscall patch has just been merged, however way I don't think targeting HEAD of a OS release during the rc phase is appropriate.
I'm not sure I understand what you mean. If QEMU doesn't build on FreeBSD HEAD it won't build on the next release. Also the LLVM toolchain used is not a development version AFAIK, but the actual 10.0.0 release, which QEMU should aim to support?
Quoted 4 lines
QEMU's supported build platforms are based on what is currently shipping as stable versions:
https://www.qemu.org/docs/master/system/build-platforms.html
FWIW, when I wrote that my intention was *not* to exclude the bleeding edge distro development branches.
Obviously we can break on those distros at any time as they're moving targets, but IMHO we should treat bugs as we would for any other released distros and aim to fix them promptly when bugs occurr.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 46 lines · Daniel P. Berrangé
Quoted 45 lines · Alex Bennée
Quoted 31 lines · Roger Pau Monné
Quoted 30 lines · Alex Bennée
Quoted 26 lines · Roger Pau Monné
Quoted 16 lines · Richard Henderson
Quoted 7 lines · Roger Pau Monne
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.While this doesn't materialize, could it be possible to get this patch accepted?
This is currently blocking the build of QEMU on FreeBSD HEAD, which has already switched to LLVM 10.0.0.
Quoted 7 lines
Quoted 2 lines
I think the vsyscall patch has just been merged, however way I don't think targeting HEAD of a OS release during the rc phase is appropriate.
I'm not sure I understand what you mean. If QEMU doesn't build on FreeBSD HEAD it won't build on the next release. Also the LLVM toolchain used is not a development version AFAIK, but the actual 10.0.0 release, which QEMU should aim to support?
QEMU's supported build platforms are based on what is currently shipping as stable versions:
Quoted 8 lines
FWIW, when I wrote that my intention was *not* to exclude the bleeding edge distro development branches.
Obviously we can break on those distros at any time as they're moving targets, but IMHO we should treat bugs as we would for any other released distros and aim to fix them promptly when bugs occurr.
Sure - I think there are now patches incoming from Richard to delete the linker code which should meet the criteria for an RC fix, especially if they solve the LLVM 10.0 problem as well.
Signature · 1 line
Alex Bennée
Le 26/03/2020 à 17:56, Richard Henderson a écrit :
Quoted 16 lines · Roger Pau Monne
Quoted 7 lines
lld 10.0.0 introduced a new linker option --image-base equivalent to the GNU -Ttext-segment one, hence use it when available.
This fixes the build of QEMU on systems using lld 10 or greater.
Signed-off-by Dimitry Andric <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Quoted 7 lines
---
Cc: Laurent Vivier <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
---
Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.
Richard,
will you propose another fix to fix build with LLVM lld 10?
Thanks,
Laurent
Quoted 7 lines · Laurent Vivier
Quoted 3 lines
The Plan is still to drop this whole section of code.
However, it's still blocked on getting the
x86_64vsyscall patches upstream.Richard,
will you propose another fix to fix build with LLVM lld 10?
Sent.
r~