llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.64k stars 10.91k forks source link

Getting llvm-config to be platform independent. #55278

Open lygstate opened 2 years ago

lygstate commented 2 years ago

Currently the llvm-config are platform dependent, For example, the LLVM_SYSTEM_LIBS are comes from predefined macro, Can we doing something like, make sure LLVM_SYSTEM_LIBS comes from llvm-config.ini or something alike so that llvm-config can read from that file to output platform dependent flags.

Also the HostTriple can be record in the txt files.

chapuni commented 2 years ago

I think also libLLVMSupport.a is host-dependent. LLVM_SYSTEM_LIBS may be its requirements.

lygstate commented 2 years ago

I think also libLLVMSupport.a is host-dependent. LLVM_SYSTEM_LIBS may be its requirements.

Yeap, that why the LLVM_SYSTEM_LIBS are written into platform dependent llvm-config.ini file We have a platform independent llvm-config.exe or llvm-confg elf binary, and it's reading the platform dependent llvm-config.ini file to retrive platform-dependent compiling options. That's solves the libLLVMSupport.a's host-dependent flags.