Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>, kvm@vger.kernel.org
Cc: Cameron Esfahani <dirty@apple.com>
Subject: Re: [kvm-unit-tests PATCH 3/7] x86: Makefile: Fix linkage of realmode on x86_64-elf binutils
Date: Fri, 28 Aug 2020 07:44:27 +0200	[thread overview]
Message-ID: <89a13eb4-81af-5a51-191f-9017cf70980f@redhat.com> (raw)
In-Reply-To: <20200810130618.16066-4-r.bolshakov@yadro.com>

On 10/08/2020 15.06, Roman Bolshakov wrote:
> link spec [1][2] is empty on x86_64-elf-gcc, i.e. -m32 is not propogated
> to the linker as "-m elf_i386" and that causes the error:
> 
>   /usr/local/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: i386 architecture
>   of input file `x86/realmode.o' is incompatible with i386:x86-64 output
> 
> 1. https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
> 2. https://gcc.gnu.org/onlinedocs/gccint/Driver.html
> 
> Cc: Cameron Esfahani <dirty@apple.com>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  x86/Makefile.common | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/x86/Makefile.common b/x86/Makefile.common
> index 2ea9c9f..8230ac0 100644
> --- a/x86/Makefile.common
> +++ b/x86/Makefile.common
> @@ -66,7 +66,8 @@ test_cases: $(tests-common) $(tests)
>  $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/x86 -I lib
>  
>  $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o
> -	$(CC) -m32 -nostdlib -o $@ -Wl,-T,$(SRCDIR)/$(TEST_DIR)/realmode.lds $^
> +	$(CC) -m32 -nostdlib -o $@ -Wl,-m,elf_i386 \
> +	      -Wl,-T,$(SRCDIR)/$(TEST_DIR)/realmode.lds $^
>  
>  $(TEST_DIR)/realmode.o: bits = 32

Reviewed-by: Thomas Huth <thuth@redhat.com>


  reply	other threads:[~2020-08-28  5:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 13:06 [kvm-unit-tests PATCH 0/7] Add support for generic ELF cross-compiler Roman Bolshakov
2020-08-10 13:06 ` [kvm-unit-tests PATCH 1/7] x86: Makefile: Allow division on x86_64-elf binutils Roman Bolshakov
2020-08-28  5:00   ` Thomas Huth
2020-08-28  6:54     ` Roman Bolshakov
2020-08-28  7:24       ` Thomas Huth
2020-08-28  7:47         ` Roman Bolshakov
2020-08-28  7:56           ` Thomas Huth
2020-08-28  8:37             ` Roman Bolshakov
2020-08-31 17:30     ` Roman Bolshakov
2020-08-31 20:33       ` Thomas Huth
2020-08-10 13:06 ` [kvm-unit-tests PATCH 2/7] x86: Replace instruction prefixes with spaces Roman Bolshakov
2020-08-28  4:34   ` Thomas Huth
2020-08-10 13:06 ` [kvm-unit-tests PATCH 3/7] x86: Makefile: Fix linkage of realmode on x86_64-elf binutils Roman Bolshakov
2020-08-28  5:44   ` Thomas Huth [this message]
2020-08-10 13:06 ` [kvm-unit-tests PATCH 4/7] lib: Bundle debugreg.h from the kernel Roman Bolshakov
2020-08-28  4:56   ` Thomas Huth
2020-08-10 13:06 ` [kvm-unit-tests PATCH 5/7] lib: x86: Use portable format macros for uint32_t Roman Bolshakov
2020-08-28  5:49   ` Thomas Huth
2020-08-10 13:06 ` [kvm-unit-tests PATCH 6/7] configure: Add an option to specify getopt Roman Bolshakov
2020-08-28  5:55   ` Thomas Huth
2020-08-28  7:12     ` Roman Bolshakov
2020-08-28  7:34       ` Thomas Huth
2020-08-10 13:06 ` [kvm-unit-tests PATCH 7/7] README: Update build instructions for macOS Roman Bolshakov
2020-08-26 16:52 ` [kvm-unit-tests PATCH 0/7] Add support for generic ELF cross-compiler Roman Bolshakov

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=89a13eb4-81af-5a51-191f-9017cf70980f@redhat.com \
    --to=thuth@redhat.com \
    --cc=dirty@apple.com \
    --cc=kvm@vger.kernel.org \
    --cc=r.bolshakov@yadro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox