RFR: 8253757: Add LLVM-based backend for hsdis [v2]
Xin Liu
xliu at openjdk.java.net
Thu Oct 1 01:28:50 UTC 2020
On Wed, 30 Sep 2020 21:45:43 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:
>> src/utils/hsdis/Makefile line 198:
>>
>>> 196: $(TARGET_DIR)/libiberty/libiberty.a
>>> 197: else
>>> 198: LIBRARIES/amd64 = LLVMX86Disassembler LLVMX86AsmParser LLVMX86CodeGen LLVMCFGuard LLVMGlobalISel LLVMSelectionDAG \
>>
>> To disassemble code, I don't think we have to link so many libraries. It looks like code only explicitly depends
>> LLVMMCDisassembler and LLVMTarget here.
>> If we do need to link those libraries, how about we just use `llvm-config --libs`. If we declare so many names here,
>> the Makefile is subject to LLVM. In history, LLVM refactored a lot.
>
>>To disassemble code, I don't think we have to link so many libraries. It looks like code only explicitly depends
>>LLVMMCDisassembler and LLVMTarget here.
>
> This is the result of `llvm-config --libs x86 x86disassembler` and `llvm-config --libs aarch64 aarch64disassembler`.
>
>> If we do need to link those libraries, how about we just use llvm-config --libs. If we declare so many names here, the
>> Makefile is subject to LLVM. In history, LLVM refactored a lot.
>
> That should work in the general case. I did it this way originally because of cases where we need to use a
> cross-compiled LLVM. Then `llvm-config` and the related libraries would be compiled for the host platform. Then, the
> user can just specify the `LIBRARIES/*` variable by hand on the command line.
I saw you manged to solve this cross-compilation issue. cool!
Please note that I am not a reviewer. feel free to ignore what I said if it makes nonsense.
I just want to chip in some constructive ideas.
-------------
PR: https://git.openjdk.java.net/jdk/pull/392
More information about the hotspot-compiler-dev
mailing list