All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
	Thomas Huth <thuth@redhat.com>, Andrew Jones <drjones@redhat.com>,
	kvm-devel <kvm@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [kvm-unit-tests BUG] lib/ldiv32.c breaks arm compilation
Date: Tue, 11 May 2021 19:41:20 +0200	[thread overview]
Message-ID: <b737d530-35e5-33af-0ea9-de6f507516aa@redhat.com> (raw)
In-Reply-To: <05b5ce5d-4cd8-1fe3-1d2e-d34d4cf31384@arm.com>

On 11/05/21 19:03, Alexandru Elisei wrote:
> I think it's because I'm using the*arm-none-eabi*  toolchain for compilation
> instead of arm-linux-gnu, that's the toolchain for cross compiling arm code that
> is present in the official Arch Linux repositories. Is that unsupported? I don't
> remember any mention of it not being supported, but it's entirely possible that I
> just forgot.

No, it's just that there was no difference until now.  If you can add it 
to CI we can make sure it doesn't break.

> With rem initialized to 0 I get this:
> 
> rm-none-eabi-ld -nostdlib -Ttext=40010000 -o arm/selftest.elf -T
> /home/alex/data/repos/kvm-unit-tests/arm/flat.lds \
>      arm/selftest.o arm/cstart.o lib/libcflat.a lib/libfdt/libfdt.a
> lib/arm/libeabi.a arm/selftest.aux.o
> arm-none-eabi-ld: lib/libcflat.a(printf.o): in function `print_int':
> /home/alex/data/repos/kvm-unit-tests/lib/printf.c:72: undefined reference to
> `__aeabi_ldivmod'
> arm-none-eabi-ld: /home/alex/data/repos/kvm-unit-tests/lib/printf.c:73: undefined
> reference to `__aeabi_ldivmod'
> arm-none-eabi-ld: lib/libcflat.a(printf.o): in function `print_unsigned':
> /home/alex/data/repos/kvm-unit-tests/lib/printf.c:102: undefined reference to
> `__aeabi_uldivmod'
> arm-none-eabi-ld: lib/libcflat.a(alloc_page.o): in function `_page_alloc_init_area':
> /home/alex/data/repos/kvm-unit-tests/lib/alloc_page.c:482: undefined reference to
> `__aeabi_uldivmod'
> make: *** [/home/alex/data/repos/kvm-unit-tests/arm/Makefile.common:65:
> arm/selftest.elf] Error 1

So for this we need to include the uldivmod and ldivmod functions 
similar to those in 
https://android.googlesource.com/toolchain/compiler-rt/+/release_32/lib/arm.

The uninitialized warning is because of the division by zero case.  I've 
sent a couple patches to fix everything, please review!

Paolo


WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
	Thomas Huth <thuth@redhat.com>, Andrew Jones <drjones@redhat.com>,
	kvm-devel <kvm@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [kvm-unit-tests BUG] lib/ldiv32.c breaks arm compilation
Date: Tue, 11 May 2021 19:41:20 +0200	[thread overview]
Message-ID: <b737d530-35e5-33af-0ea9-de6f507516aa@redhat.com> (raw)
In-Reply-To: <05b5ce5d-4cd8-1fe3-1d2e-d34d4cf31384@arm.com>

On 11/05/21 19:03, Alexandru Elisei wrote:
> I think it's because I'm using the*arm-none-eabi*  toolchain for compilation
> instead of arm-linux-gnu, that's the toolchain for cross compiling arm code that
> is present in the official Arch Linux repositories. Is that unsupported? I don't
> remember any mention of it not being supported, but it's entirely possible that I
> just forgot.

No, it's just that there was no difference until now.  If you can add it 
to CI we can make sure it doesn't break.

> With rem initialized to 0 I get this:
> 
> rm-none-eabi-ld -nostdlib -Ttext=40010000 -o arm/selftest.elf -T
> /home/alex/data/repos/kvm-unit-tests/arm/flat.lds \
>      arm/selftest.o arm/cstart.o lib/libcflat.a lib/libfdt/libfdt.a
> lib/arm/libeabi.a arm/selftest.aux.o
> arm-none-eabi-ld: lib/libcflat.a(printf.o): in function `print_int':
> /home/alex/data/repos/kvm-unit-tests/lib/printf.c:72: undefined reference to
> `__aeabi_ldivmod'
> arm-none-eabi-ld: /home/alex/data/repos/kvm-unit-tests/lib/printf.c:73: undefined
> reference to `__aeabi_ldivmod'
> arm-none-eabi-ld: lib/libcflat.a(printf.o): in function `print_unsigned':
> /home/alex/data/repos/kvm-unit-tests/lib/printf.c:102: undefined reference to
> `__aeabi_uldivmod'
> arm-none-eabi-ld: lib/libcflat.a(alloc_page.o): in function `_page_alloc_init_area':
> /home/alex/data/repos/kvm-unit-tests/lib/alloc_page.c:482: undefined reference to
> `__aeabi_uldivmod'
> make: *** [/home/alex/data/repos/kvm-unit-tests/arm/Makefile.common:65:
> arm/selftest.elf] Error 1

So for this we need to include the uldivmod and ldivmod functions 
similar to those in 
https://android.googlesource.com/toolchain/compiler-rt/+/release_32/lib/arm.

The uninitialized warning is because of the division by zero case.  I've 
sent a couple patches to fix everything, please review!

Paolo

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  parent reply	other threads:[~2021-05-11 17:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 15:43 [kvm-unit-tests BUG] lib/ldiv32.c breaks arm compilation Alexandru Elisei
2021-05-11 15:43 ` Alexandru Elisei
2021-05-11 16:43 ` Paolo Bonzini
2021-05-11 16:43   ` Paolo Bonzini
2021-05-11 17:03   ` Alexandru Elisei
2021-05-11 17:03     ` Alexandru Elisei
2021-05-11 17:10     ` Paolo Bonzini
2021-05-11 17:10       ` Paolo Bonzini
2021-05-11 17:41     ` Paolo Bonzini [this message]
2021-05-11 17:41       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b737d530-35e5-33af-0ea9-de6f507516aa@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.