llvm

Undefined symbols for architecture x86_64 in clang

喜你入骨 提交于 2019-12-25 16:55:46
问题 I've checked more or less all the answers to this kind of problem wich seems quite usual when compiling with the new llvm package but I couldn't find any solution. MacBook-Air-di-Manfredo:SINGLE_TETRAMER manfredo$ clang++ -v -Wall -O3 -g -fpic -c -lm grbyinsertion.cpp -I/Users/manfredo/Desktop/tesi/codice_tesi/oxDNA/src/Observables Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.1.0 Thread model: posix clang: warning: -lm: 'linker' input unused "

Clang's ASM output vs GCC's

和自甴很熟 提交于 2019-12-25 07:38:27
问题 (I don't know almost anything about assembly language yet). I'm trying to follow this tutorial. The problem is that his compiler, and my test setup (gcc on Linux 32 bit) produces completely different, and significantly less output than my main setup (clang on OSX 64 bit). Here are my outputs for int main() {} gcc on Linux 32 bit $ cat blank.c int main() {} $ gcc -S blank.c $ cat blank.s .file "blank.c" .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushl %ebp .cfi_def_cfa

LLVM tutorial OCaml Compilation Assembler Error

断了今生、忘了曾经 提交于 2019-12-25 07:22:04
问题 I have been working through the LLVM Kaleidoscope Tutorial for OCaml. On the third part of the tutorial, I have navigated to the example code in the folder OCaml-Kaleidoscope\Chapter3 I am encountering an issue when compiling with ocamlbuild toy.byte on cygwin. This is the code given in the tutorial to compile. The error I am getting is mkdir 'C:\Users\setup\Compiler\llvm\examples\OCaml-Kaleidoscope\Chapter3\_build' ''ocamlopt.opt unix.cmxa -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib

Compiling with LLVM/Clang causes crash, not GCC 4.2

筅森魡賤 提交于 2019-12-25 04:53:28
问题 I'm working on an iPhone app, and I'm having some compiler trouble. Here's the low-down: I am compiling using Xcode 3.2.3, targeting iOS 4.0: my device is a 2nd Gen. iPod touch running iOS 4.0. Compiling with GCC 4.2: works on both the simulator and the device Compiling with LLVM compiler 1.5: works on simulator, but not on device. Compiling with LLVM GCC 4.2: same problem as with LLVM compiler 1.5. When it fails, the app never even finishes loading. This is what the log looks like: run

gcc crashes while building llvm 3.42 from source (with cmake)

╄→尐↘猪︶ㄣ 提交于 2019-12-25 00:28:23
问题 While trying to build llvm/clang 3.42 on ubuntu 17.04, I have failed with configre+make as mentioned in this SO post. I gave cmake a shot with this very similar script: #!/bin/bash ############### # DEFINITIONS # ############### LLVM_SVN=https://llvm.org/svn/llvm-project TAG=tags/RELEASE_342/final ############### # DIRECTORIES # ############### BASEDIR=/home/oren/GIT/myLLVMpass ############### # DIRECTORIES # ############### LLVM_DIR=${BASEDIR}/llvm-3.4.2 LLVM_BUILD_DIR=${LLVM_DIR}/build LLVM

What's the difference between “ModulePassManagers”, “FunctionPassManager” and “BasicBlockPassManagers” in LLVM?

前提是你 提交于 2019-12-24 16:07:43
问题 What's the difference between "ModulePassManagers", "FunctionPassManager" and "BasicBlockPassManagers" in LLVM? And, does "FunctionPassManager" can only be used on "function" type in LLVM-IR? 回答1: LLVM IR is subdivided into different units. The different units of LLVM IR are as follows Modules Functions Basic blocks Instructions A module consists of functions that are in turn made up of different basic blocks that contain a sequence of instructions. The different pass managers operate on

Generate LLVM IR for httpd

六月ゝ 毕业季﹏ 提交于 2019-12-24 12:21:42
问题 I am trying to compile apache2 with LLVM, to generate final binaries in LLVM IR. I used flto option in compiling and linking and passed "also-emit-llvm" to the linker through clang. It seems to work for most steps, however I had two concerns 1) Earlier I used LLVM 3.6, whose gold plugin doesn't accept also-emit-llvm, but has emit-llvm only, basically it will emit only elf or llvm. Which the Autotools build system doesn't like. The configure and make script want binaries, while I want llvm.

Clang equivalent of GCC's __builtin_darn()

こ雲淡風輕ζ 提交于 2019-12-24 11:46:58
问题 I'm trying to discover Clang's equivalent to GCC's __builtin_darn() on Power9. Grepping Clang 7.0 sources it looks like LLVM supports it: llvm_source$ cat llvm/test/MC/PowerPC/ppc64-encoding.s | grep darn -B 1 -A 1 # CHECK-BE: darn 2, 3 # encoding: [0x7c,0x43,0x05,0xe6] # CHECK-LE: darn 2, 3 # encoding: [0xe6,0x05,0x43,0x7c] darn 2, 3 However, I can't seen to find the builtin: llvm_source$ grep -IR darn | grep builtin llvm_source$ What is Clang equivalent of GCC's __builtin_darn() ? 回答1: You

Loadable modules messages under Cygwin

为君一笑 提交于 2019-12-24 09:18:48
问题 When building LLVM using cmake, a few components involving "Loadable modules" are not built, and warning messages such as the following are issued: -- LLVMHello ignored -- Loadable modules not supported on this platform. ... -- BugpointPasses ignored -- Loadable modules not supported on this platform. ... -- SampleAnalyzerPlugin ignored -- Loadable modules not supported on this platform. -- PrintFunctionNames ignored -- Loadable modules not supported on this platform. But loadable modules are

LLVM 6 Trunk Build on Ubuntu 16.04 not building lld

蓝咒 提交于 2019-12-24 09:17:57
问题 I am building LLVM 6 on Ubuntu 16.04. I want lld too. But no matter what I do, lld doesn't build/install. Followed the following instruction from here. Still sifting through first and second :) Read the documentation. Read the documentation. Remember that you were warned twice about reading the documentation. In particular, the relative paths specified are important. Checkout LLVM: cd where-you-want-llvm-to-live svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm Checkout Clang: cd where