[LTP] [PATCH 1/2] KVM test infrastructure

Petr Vorel pvorel@suse.cz
Thu Mar 10 21:41:25 CET 2022


> On 09. 03. 22 20:13, Petr Vorel wrote:
> > Hi Martin,

> > this patchset looks really great.

> > Unfortunately there are some compilation time errors [1]. Various
> > Debian/Ubuntu versions (but not all) and Alpine have problem to
> > compile it [1]: /usr/bin/ld: bootstrap_x86_64.o: relocation
> > R_X86_64_16 against symbol `kvm_gdt32_desc' can not be used when
> > making a PIE object; recompile with -fPIE

> > Can you please have look into it?

> Can you try whether this one-liner fixes the error? The diff will
> probably get corrupted by my mail client because GUEST_CFLAGS is too
> long but it's trivial to apply this by hand:

> diff --git a/testcases/kernel/kvm/Makefile b/testcases/kernel/kvm/Makefile
> index 139358961..24ca91fc3 100644
> --- a/testcases/kernel/kvm/Makefile
> +++ b/testcases/kernel/kvm/Makefile
> @@ -9,7 +9,7 @@ ASFLAGS =
>  CPPFLAGS += -I$(abs_srcdir)/include
>  GUEST_CPPFLAGS = $(CPPFLAGS) -DCOMPILE_PAYLOAD
>  GUEST_CFLAGS = -ffreestanding -O2 -Wall -fno-asynchronous-unwind-tables
> -mno-mmx -mno-sse
> -GUEST_LDFLAGS = -nostdlib -Wl,--build-id=none
> +GUEST_LDFLAGS = -nostdlib -Wl,--build-id=none,-no-pie
>  GUEST_LDLIBS =

>  FILTER_OUT_MAKE_TARGETS := lib_guest lib_host lib_x86

Unfortunately, just adding -no-pie to GUEST_LDFLAGS does not help:
https://github.com/pevik/ltp/actions/runs/1965302083

/usr/bin/ld: bootstrap_x86_64.o: relocation R_X86_64_16 against symbol `kvm_gdt32_desc' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: -pie: error: PHDR segment not covered by LOAD segment

FYI slightly different OS failed on your original version, but that's probably
not interesting:
https://github.com/pevik/ltp/actions/runs/1959152447

Kind regards,
Petr


More information about the ltp mailing list