From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by sourceware.org (Postfix) with ESMTPS id 9881C3896C06 for ; Mon, 1 Jun 2020 21:36:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9881C3896C06 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-xe42.google.com with SMTP id z13so802157vsn.10 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=HOWa61MRXLEEsBojeTl6vfH6hd4FJbluiTmPy/+X48bv/RMoZfv/32efltxmOLGHYv c9tupMHIJXe2CwO18u5MfLup0+Wvo/ucuRUCXfPwuNYlCbqgE3B6Ve83kLxokqk/f60m J+cXLixt51OKYREj0GLpvFeCg5FCq1VTdZiYc3GAfqJcdrnZk2Q7iTtrF/vD74Lnr9+4 jDJzBsd523BR1Ot7ka2ohLgFPufVnZDR+6SKoJS8uw2my9DhTSE6rdsl4t3ULaYlwg+d QhMs737I/XG/HeQcq4An0NU6RjbnOmSCn2/sLy5utu3STPpwupOJlF8MZ8bK4hT8U3yF JoWw== X-Gm-Message-State: AOAM530aoYe3QxqwxPry0zJsg6/g+3BNFFKLpLAWpy/okhjB7/t2uUZZ Xhz4HUI88PnsrT/tMcVI0mf/SF0yuTzb4rd7I4c3dA== 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.0 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches 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