[llvm-dev] Linking Kaleidoscope-8 wants all targets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Linking Kaleidoscope-8 wants all targets

Muhui Jiang via llvm-dev
I am compiling and linking Kaleidoscope sample from 2 to 7 with Code::Blocks, where I have add to compiler settings: `llvm-config --cxxflags` and to linker settings: `llvm-config --ldflags --system-libs --libs core orcjit native`

In 2 to 7 is OK, but sample 8 has errors:
||=== Build: Debug in Chapter8 (compiler: LLVM Clang Compiler) ===|
obj/Debug/toy.o||In function `llvm::InitializeAllTargetInfos()':|
/usr/local/include/llvm/Config/Targets.def|26|undefined reference to `LLVMInitializeAArch64TargetInfo'|
/usr/local/include/llvm/Config/Targets.def|27|undefined reference to `LLVMInitializeAMDGPUTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|28|undefined reference to `LLVMInitializeARMTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|29|undefined reference to
...............................

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Linking Kaleidoscope-8 wants all targets

Muhui Jiang via llvm-dev
Hey Eric - looks like maybe you & I (when adding this chapter for the debug info tutorial) just made a mistake here initializing all targets rather than only the native target (not like this is doing remote JIT or anything - so I think only the native target should be required)?

- Dave

On Sun, Jul 1, 2018 at 7:22 AM Andy via llvm-dev <[hidden email]> wrote:
I am compiling and linking Kaleidoscope sample from 2 to 7 with Code::Blocks, where I have add to compiler settings: `llvm-config --cxxflags` and to linker settings: `llvm-config --ldflags --system-libs --libs core orcjit native`

In 2 to 7 is OK, but sample 8 has errors:
||=== Build: Debug in Chapter8 (compiler: LLVM Clang Compiler) ===|
obj/Debug/toy.o||In function `llvm::InitializeAllTargetInfos()':|
/usr/local/include/llvm/Config/Targets.def|26|undefined reference to `LLVMInitializeAArch64TargetInfo'|
/usr/local/include/llvm/Config/Targets.def|27|undefined reference to `LLVMInitializeAMDGPUTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|28|undefined reference to `LLVMInitializeARMTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|29|undefined reference to
...............................
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Linking Kaleidoscope-8 wants all targets

Muhui Jiang via llvm-dev
Yeah, likely. :)

On Mon, Jul 2, 2018 at 9:53 AM David Blaikie <[hidden email]> wrote:
Hey Eric - looks like maybe you & I (when adding this chapter for the debug info tutorial) just made a mistake here initializing all targets rather than only the native target (not like this is doing remote JIT or anything - so I think only the native target should be required)?

- Dave


On Sun, Jul 1, 2018 at 7:22 AM Andy via llvm-dev <[hidden email]> wrote:
I am compiling and linking Kaleidoscope sample from 2 to 7 with Code::Blocks, where I have add to compiler settings: `llvm-config --cxxflags` and to linker settings: `llvm-config --ldflags --system-libs --libs core orcjit native`

In 2 to 7 is OK, but sample 8 has errors:
||=== Build: Debug in Chapter8 (compiler: LLVM Clang Compiler) ===|
obj/Debug/toy.o||In function `llvm::InitializeAllTargetInfos()':|
/usr/local/include/llvm/Config/Targets.def|26|undefined reference to `LLVMInitializeAArch64TargetInfo'|
/usr/local/include/llvm/Config/Targets.def|27|undefined reference to `LLVMInitializeAMDGPUTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|28|undefined reference to `LLVMInitializeARMTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|29|undefined reference to
...............................
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Linking Kaleidoscope-8 wants all targets

Muhui Jiang via llvm-dev
Hmm, actually, looks intentional from reading Chapter 8 ( https://llvm.org/docs/tutorial/LangImpl08.html ) - which says that it's doing it, and explains that the compilation command needs to be different, showing how to use llvm-config for this example.

One reason might be, though it's not demonstrated, that the default target triple for the LLVM build being used may not be the native target - or it may be overridden at runtime by LLVM_TARGET_TRIPLE_ENV to be not the native target.

Andy - please check the tutorial for instructions on how to build Chapter 8 (& 9 is probably the same, but the chapter should tell you how to build it if it's any different again).

- Dave

On Mon, Jul 2, 2018 at 9:58 AM Eric Christopher <[hidden email]> wrote:
Yeah, likely. :)

On Mon, Jul 2, 2018 at 9:53 AM David Blaikie <[hidden email]> wrote:
Hey Eric - looks like maybe you & I (when adding this chapter for the debug info tutorial) just made a mistake here initializing all targets rather than only the native target (not like this is doing remote JIT or anything - so I think only the native target should be required)?

- Dave


On Sun, Jul 1, 2018 at 7:22 AM Andy via llvm-dev <[hidden email]> wrote:
I am compiling and linking Kaleidoscope sample from 2 to 7 with Code::Blocks, where I have add to compiler settings: `llvm-config --cxxflags` and to linker settings: `llvm-config --ldflags --system-libs --libs core orcjit native`

In 2 to 7 is OK, but sample 8 has errors:
||=== Build: Debug in Chapter8 (compiler: LLVM Clang Compiler) ===|
obj/Debug/toy.o||In function `llvm::InitializeAllTargetInfos()':|
/usr/local/include/llvm/Config/Targets.def|26|undefined reference to `LLVMInitializeAArch64TargetInfo'|
/usr/local/include/llvm/Config/Targets.def|27|undefined reference to `LLVMInitializeAMDGPUTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|28|undefined reference to `LLVMInitializeARMTargetInfo'|
/usr/local/include/llvm/Config/Targets.def|29|undefined reference to
...............................
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev