From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by sourceware.org (Postfix) with ESMTPS id 981AE3896C05 for ; Mon, 1 Jun 2020 21:36:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 981AE3896C05 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-vs1-xe43.google.com with SMTP id k13so801418vsm.13 for ; Mon, 01 Jun 2020 14:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=78n37X21pMArAMCPBWLUIRJ6YIJHAQM8FbNnkQKg0BI=; b=cEjOOYKvk2s+kUSS/K5lKKTjuoJoDacaU9TSDNXWpBPOccXa5OBoN94p65I1HvP9Jl 1j1EGu/hmh371ogQhYhFQ122X9a96ohJF+b5XdEjyZu91berUIHaVKRfJC5mDsuxfZga BJtt3Hg8D+APG0HgjtM/scV8One1kVsKsmVcFS5BPTZVRIIDAh16O3Qlr4eyOLuWsDLG QHezQ4wJ/tbcl3nOJlTD/WsRZxUa3neT2uTX+1OQqP5nxOMiZunXc8pfkAai88nX3GUt rDzQcmPgvG8w4/D3kQTb0kAVmH6qhUctrd2q02/VGzO7Nm45CaF0El9/47KG7Ppvfh3g xZgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=78n37X21pMArAMCPBWLUIRJ6YIJHAQM8FbNnkQKg0BI=; b=nQIyyfzFbv3+i5RfgYRRxBQB1OoNVJ7nPngAYZsRrFJBPI2i6oaffeeAOVu5xvW1ST ccJkBRnidkc4v6r3UMcUTIx0C/lOtRUJzKdjpxE2G8VFox33iKo5rlnug0EdwB8hM+dl ksCAX6KDNzamw5KiwTP3of9Clz6VnCWKEgoE8cByR0pIgbw2diZ7IzaesdGFhac8pcfV TCgZZI+zGJla0bWRLhe89qhi5kHtz0f46LoenoeYarHiylpeXDwhoYs1yOWniHkvVFIt EyWTLVsMkhpLHwNVHMDf4xdebtEx1g3WCQOz3/5Bh3dETxEt2YBbNass5j2w9ujlfn5i 7UlQ== X-Gm-Message-State: AOAM532gj76azUZDrRdcm1PqwGCjSDqe46bT8abYfgXlUIoq5zF/vYMH Lo9ySB14m+8HqdTNVfP0FW+BegHf1oc7OFzj/rp7lA== X-Google-Smtp-Source: ABdhPJy/9Cht5J+ML1ALIju2f0MjozZ5aEny96SJdGSmdKFTKUDFVq+Y00eG/Chz8ZRi2407Y76QO5PXf4fG7VW1Txw= X-Received: by 2002:a67:1486:: with SMTP id 128mr15028324vsu.191.1591047365156; Mon, 01 Jun 2020 14:36:05 -0700 (PDT) MIME-Version: 1.0 References: <1588733747-18787-1-git-send-email-nelson.chu@sifive.com> <08e32e0b-af89-ed39-242b-9dcb4bf939f4@redhat.com> In-Reply-To: From: Jim Wilson Date: Mon, 1 Jun 2020 14:35:54 -0700 Message-ID: Subject: Re: [PATCH v2 0/9] RISC-V: Support version controling for ISA standard extensions and CSR To: Nelson Chu Cc: Nick Clifton , Alex Bradbury , Kito Cheng , Binutils , gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 21:36:09 -0000 I found another problem with the patches. RISC-V Linux native gdbserver fails to build. gdbserver/linux-riscv-low.cc includes include/opcode/riscv.h. Your patch added bfd.h include to that file, just like 7 other files in that dir. Unfortunately, gdbserver is not built with -I options pointing at the bfd source and build trees like gdb is. Also, bfd is configured for the host, and gdbserver is configured for the target, so including bfd header files in gdbserver seems wrong. linux-riscv-low.cc is the only one trying to include header files from include/opcode but that doesn't seem inherently wrong. We could fix this by moving the parts that gdbserver needs to another file that is target safe. This is primarily riscv_insn_length, but might also include other stuff. riscv-opc.h is probably safe but seems odd, so maybe a riscv-target.h or riscv-common.h would be better, and add a comment saying that this is intended to be shared between host and target code. Then gdbserver can include the safe file and avoid the bfd.h include. Or alternatively we could duplicate some code and just put it directly in gdbserver, but I'd prefer to avoid that if we can. JIm