From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BAE6C433E6 for ; Fri, 28 Aug 2020 07:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3751F2078A for ; Fri, 28 Aug 2020 07:56:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MBRvjC7o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728505AbgH1H4j (ORCPT ); Fri, 28 Aug 2020 03:56:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60470 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727911AbgH1H4g (ORCPT ); Fri, 28 Aug 2020 03:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598601395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CEVLNkNjXKJeTe+nVhlePDi5852O1LmQzJV/lWnP0DU=; b=MBRvjC7oagTBkSLMss3SPk8fYqje8cJfhAx3yZPKOe2X7iFYe+D+Wxv/RCE07WKlUNcQlz kOJkt1KZ6bO/d/JQvAIvgNDl6WdpkYzg+fRO1/OtWcCExXdlaWqaJ+hWclUw1++lKy2nAG s4MyYcGbwIs+0WTqhjFqrm7prUS6tvk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-IKX_PXTBOxuZ-K49q3qUnQ-1; Fri, 28 Aug 2020 03:56:31 -0400 X-MC-Unique: IKX_PXTBOxuZ-K49q3qUnQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8130807337; Fri, 28 Aug 2020 07:56:30 +0000 (UTC) Received: from thuth.remote.csb (ovpn-112-79.ams2.redhat.com [10.36.112.79]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DA5180925; Fri, 28 Aug 2020 07:56:29 +0000 (UTC) Subject: Re: [kvm-unit-tests PATCH 1/7] x86: Makefile: Allow division on x86_64-elf binutils To: Roman Bolshakov Cc: kvm@vger.kernel.org, Cameron Esfahani References: <20200810130618.16066-1-r.bolshakov@yadro.com> <20200810130618.16066-2-r.bolshakov@yadro.com> <20200828065417.GA54274@SPB-NB-133.local> <20200828074745.GC54274@SPB-NB-133.local> From: Thomas Huth Message-ID: Date: Fri, 28 Aug 2020 09:56:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200828074745.GC54274@SPB-NB-133.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 28/08/2020 09.47, Roman Bolshakov wrote: > On Fri, Aug 28, 2020 at 09:24:10AM +0200, Thomas Huth wrote: >> On 28/08/2020 08.54, Roman Bolshakov wrote: >>> On Fri, Aug 28, 2020 at 07:00:19AM +0200, Thomas Huth wrote: >>>> On 10/08/2020 15.06, Roman Bolshakov wrote: >>>>> For compatibility with other SVR4 assemblers, '/' starts a comment on >>>>> *-elf binutils target and thus division operator is not allowed [1][2]. >>>>> That breaks cstart64.S build: >>>>> >>>>> x86/cstart64.S: Assembler messages: >>>>> x86/cstart64.S:294: Error: unbalanced parenthesis in operand 1. >>>>> >>>>> The option is ignored on the Linux target of GNU binutils. >>>>> >>>>> 1. https://sourceware.org/binutils/docs/as/i386_002dChars.html >>>>> 2. https://sourceware.org/binutils/docs/as/i386_002dOptions.html#index-_002d_002ddivide-option_002c-i386 >>>>> >>>>> Cc: Cameron Esfahani >>>>> Signed-off-by: Roman Bolshakov >>>>> --- >>>>> x86/Makefile | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/x86/Makefile b/x86/Makefile >>>>> index 8a007ab..22afbb9 100644 >>>>> --- a/x86/Makefile >>>>> +++ b/x86/Makefile >>>>> @@ -1 +1,3 @@ >>>>> include $(SRCDIR)/$(TEST_DIR)/Makefile.$(ARCH) >>>>> + >>>>> +COMMON_CFLAGS += -Wa,--divide >>>> >>>> Some weeks ago, I also played with an elf cross compiler and came to the >>>> same conclusion, that we need this option there. Unfortunately, it does >>>> not work with clang: >>>> >>>> https://gitlab.com/huth/kvm-unit-tests/-/jobs/707986800#L1629 >>>> >>>> You could try to wrap it with "cc-option" instead ... or use a proper >>>> check in the configure script to detect whether it's needed or not. >>>> >>> >>> Hi Thomas, >>> >>> Thanks for reviewing the series. I'll look into both options and will >>> test with both gcc and clang afterwards. I can also update .travis.yml >>> in a new patch to test the build on macOS. >> >> That would be great, thanks! Note that you need at least Clang v10 (the >> one from Fedora 32 is fine) to compile the kvm-unit-tests. >> >> And if it's of any help, this was the stuff that I used in .travis.yml >> for my experiments (might still be incomplete, though): >> >> - os: osx >> osx_image: xcode12 >> addons: >> homebrew: >> packages: >> - bash >> - coreutils >> - qemu >> - x86_64-elf-gcc >> env: >> - CONFIG="--cross-prefix=x86_64-elf-" >> - BUILD_DIR="build" >> - TESTS="umip" >> - ACCEL="tcg" >> >> - os: osx >> osx_image: xcode12 >> addons: >> homebrew: >> packages: >> - bash >> - coreutils >> - qemu >> - i386-elf-gcc > > It's going to be i686-elf-gcc. Ah, there are two flavours? Ok, good to know. >> env: >> - CONFIG="--arch=i386 --cross-prefix=x86_64-elf-" > > `--cross-prefix=i686-elf-`, respectively. > >> - BUILD_DIR="build" >> - TESTS="umip" >> - ACCEL="tcg" >> > > Thanks, I'll use it as the basis. Do I need to add your Signed-off-by: here? > or Suggested-by: is enough? Suggested-by is fine. > IIRC all tests pass on TCG/5.1. Yes, please tweak the TEST="..:" lines accordingly, I just added one test there for my initial tries. Thomas