From 114325b86a3d0360afc772c44335fc9092686f58 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 5 Dec 2023 23:44:35 -0800 Subject: Kaleidoscope-Ch8: use Reloc::PIC_ which has better portability across different OSes. In addition, on many ELF OSes, this output relocatable file can be linked without -no-pie. --- llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/docs/tutorial/MyFirstLanguageFrontend') diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst index 33ee7d2..17bf8a4 100644 --- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst +++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst @@ -105,8 +105,8 @@ To see which features and CPUs that LLVM knows about, we can use 3dnowa - Enable 3DNow! Athlon instructions. ... -For our example, we'll use the generic CPU without any additional -features, options or relocation model. +For our example, we'll use the generic CPU without any additional feature or +target option. .. code-block:: c++ @@ -114,8 +114,7 @@ features, options or relocation model. auto Features = ""; TargetOptions opt; - auto RM = std::optional(); - auto TargetMachine = Target->createTargetMachine(TargetTriple, CPU, Features, opt, RM); + auto TargetMachine = Target->createTargetMachine(TargetTriple, CPU, Features, opt, Reloc::PIC_); Configuring the Module -- cgit v1.1