Questions tagged [clang]

clang is a C, C++, Objective-C/C++ compiler compatible with GNU gcc extensions.

Filter by
Sorted by
Tagged with
0 votes
1 answer
224 views

32bit program on 64bit: cannot execute binary file: Exec format error

I'm linking an application consisting out of two libraries in clang under WSL. The command I use looks as follows (simplified): clang -m32 -fsanitize=address -L _build/ -l:lib1.lib -l:lib2.lib -o test ...
user avatar
0 votes
1 answer
61 views

Linker unable to find header and library files

I've installed the CHERI simulator from this link. It allows me to use the clang compiler for both risc-v and a capability extended risc-v architecture. I've defined the following aliases alias clang-...
user avatar
1 vote
0 answers
101 views

run-clang-tidy is a broken symlink in Ubuntu 21.10

I found that the run-clang-tidy script is a broken symlink in Ubuntu 21.10: $ run-clang-tidy bash: run-clang-tidy: command not found $ cd /usr/bin $ ls -l *tidy* lrwxrwxrwx 1 root root 29 Sep 28 10:...
user avatar
1 vote
1 answer
480 views

linux kernel compilation error

I got error: make ${BUILD_FLAGS} -j1 modules HOSTCC scripts/basic/fixdep CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh DESCEND objtool CHK include/generated/...
user avatar
1 vote
0 answers
124 views

Why pgrep hangs when clang AddressSanitizer library is preloaded using LD_PRELOAD?

I noticed that when I set LD_PRELOAD env. variable to libclang_rt.asan-x86_64.so pgrep hangs. Why is this happening and how to avoid this? senx:/$ time pgrep anything real 0m0,022s user 0m0,...
user avatar
  • 141
0 votes
1 answer
342 views

Installation of clang not correct, always “segmentation fault”

I have recently switched to ubuntu (20.04.2 LTS) and have tried installing clang (and clang++). I did it with: sudo apt-get install clang and can find clang and clang++ in /usr/bin When I try to ...
user avatar
  • 1
0 votes
0 answers
51 views

Clang Exits with Error Code 1

gmake (with Clang10) complains that in file m_file.cpp there is "no matching function for call to 'fileno'". Also, that it "cannot initialize a param of type 'FILE *' ::fclose(m_fp). ...
user avatar
0 votes
1 answer
107 views

Unable to use -lfl on NixOS

I'm new to NixOS and I'm trying to build a project which uses Flex. I get the following error if I try and build the project /nix/store/b10shv9yqbgps47y0n8x7l7bq8fmp1i6-binutils-2.31.1/bin/ld: cannot ...
user avatar
  • 111
2 votes
0 answers
3k views

How to change clang-10, llvm-10, etc to clang, llvm, etc.?

I use Spacemacs, and installed llvm-10, clnag-10, clangd-10, and all related packages, in Debian 10. Used the following command to install llvm $ sudo bash -c "$(wget -O - https://apt.llvm.org/...
user avatar
  • 23
21 votes
4 answers
53k views

How to install clang-10 on Ubuntu 20.4

I upgraded my Linux box from Ubuntu 18.04 to 20.04. I need to install the clang suite of compilers and the apt command is giving me errors. I've searched many possible solutions but so far none of the ...
user avatar
  • 319
1 vote
1 answer
224 views

Why does `clang-format --version` return 1

I'm working on a RHEL7 and I just installed clang: sudo yum install clang. Then I execute the command clang-format --version and the output is below: me@localhost:~$ clang-format --version LLVM (...
user avatar
  • 2,819
0 votes
0 answers
326 views

Print clang include path and store in file

I'm writing a program that needs to pull in the clang include paths. Thanks to Dump include paths from g++ I'm half-way there. The command I'm using is: clang++ -E -x c++ - -v < /dev/null The ...
user avatar
  • 101
2 votes
1 answer
2k views

Missing c++ headers under alpine clang

I'm trying to build a small alpine-based docker container to build c++ app using clang++. Dockerfile looks like this: FROM alpine:3.10 RUN apk add --no-cache clang But when I'm trying to compile a ...
user avatar
0 votes
1 answer
933 views

Clang++ Compiles, but doesn't run

I try to compile a program by typing (lets assume here I'm cd'd into the directory) clang++ file_name.cpp. It compiles and should autorun, but it doesn't, and just ends the event, and opens the ...
user avatar
1 vote
1 answer
529 views

Compile clang-tidy under Alpine Linux

I'm trying to make a Docker image for a CI pipeline, that needs to contain clang-tidy among other tools. The problem is that I can't find any package containing clang-tidy on the Alpine repos, which ...
user avatar
2 votes
0 answers
182 views

How to build LLVM/Clang isolated from the host system?

I'm looking for something like the Linux From Scratch process for GCC, but for LLVM/Clang. Linux From Scratch builds an isolated GCC/binutils toolchain, and because of the rather monolithic nature, `...
user avatar
0 votes
1 answer
241 views

clang: error: no such file or directory: '_REENTRANT'

I am trying to install UDUNITS-2 package for the graphical visual browser: ncview. I need to understand the following error message: clang: error: no such file or directory: '_REENTRANT' A similar ...
user avatar
-5 votes
2 answers
242 views

BUG in clang linker - name resolving issue

I found bug in clang, and i post it here because it's very difficult to find how to do it in clang system. I think this information in useful - i saw similar questions in web. So, clang makes wrong ...
user avatar
2 votes
2 answers
2k views

Are there any successful forks or refactors of the Linux Kernel?

A google search reveals this slashdot story yielding this github repository that hasn't had a commit since 2016. There are 22,602 forks listed on github.com but these are going to be mostly (if not ...
user avatar
  • 1,715
0 votes
0 answers
1k views

binary can't find specific library, but can find others in the same directory

I have a binary that I can compile with either clang or gcc, and the directory for the application is something like this: /app root dir /bin /<application> /lib /<application ...
user avatar
  • 203
2 votes
1 answer
5k views

gdb doesn't step into function although source is available

I have a shared library compiled with -g -O0 including: void MyClass::whatever() { ... doSomething(myImage, myPoints); ... } bool MyClass::doSomething(const Image& image, std::vector<cv:...
user avatar
  • 11.6k
2 votes
3 answers
193 views

Made an oupsie while testing some protection and executed rm /usr/bin/clang*

I deleted clang. I tried to use apt to uninstall clang, and then re-install it but I get this error: Setting up clang (1:3.8-33ubuntu3.1) ... update-alternatives: error: alternative path /usr/bin/...
user avatar
3 votes
1 answer
541 views

Problem with installing Clang: undefined symbol: LLVMInitializeMipsAsmParser

I'm new to Linux environment. Few days ago I've installed Fedora on my laptop. I want to complie some C++ source code but having trouble with Clang. First, after installing it with yum I see an error (...
user avatar
  • 31
2 votes
0 answers
2k views

GCC/G++ compiles code to shared library instead of executable [closed]

I am having a rather puzzling problem. Recently, whenever I compile a program using GCC or G++, the compiler creates a shared library rather than an executable file. The library still runs if I ...
user avatar
4 votes
1 answer
9k views

How to install clang 3.9 or higher using apt-get on Linux Mint?

I know that there are similar questions for installation of clang-lower versions. But, I am trying to follow them to install clang-3.9 or 4.0 , but I am unable to do so on my Linux Mint 18. First, I ...
user avatar
4 votes
2 answers
8k views

clang is refusing to install through apt

So, I wanted to get Unreal Engine 4, but for some odd reason, clang does not want to install. I have never used clang at all before, and it isn't even installed, so I have no real clue what is ...
user avatar
  • 1,708
2 votes
0 answers
1k views

Emscripten fundamentally incompatable with clang on linux

A long time ago I wrote a really crude and primitive shell in C++, and I only just recently discovered asm.js, so I thought it'd be neat to try to compile and run it in a browser, but I can't because ...
user avatar
1 vote
1 answer
599 views

Is it ok to use gcc to compile userspace binaries on FreeBSD 10?

I know that recently FreeBSD 10 dumped gcc in favour of clang due to licensing reasons (Ref). I wanted to understand if this restriction to use clang is limited only to kernel compilation. Can I use ...
user avatar
7 votes
2 answers
8k views

clang-tidy install

I have clang installed from packages on both Ubuntu 14.07, Centos 7 and Fedoara 22. I would like to use clang-tidy but can neither find a package nor how to install it without installing clang from ...
user avatar
0 votes
1 answer
1k views

Fail to install Clang-3.5 due to Clang-3.3

I am trying to install clang-3.5 on Linux Mint 17.2 (Cinnamon) and I dependency errors. Edit: here is the output of apt-cache policy clang clang-3.5 clang-3.3: clang: Installed: (none) Candidate:...
user avatar
2 votes
1 answer
838 views

Building an LFS system using ELLCC

Firstly, this isn't my first attempt at building an LFS system - I've already successfully built LFS 7.8 and LFS 7.8-systemd. I would like to replace GCC+GlibC with ELLCC, which is Clang/LLVM+musl. ...
user avatar
0 votes
2 answers
67 views

does anybody know of a GNU/Linux project which has support for both gcc as well as clang?

Does anybody know of a project (apart from the Linux monolithic kernel) where a/the program can be compiled by both the compilers and can be used to observe their performances, any recommendations ? ...
user avatar
  • 10.9k
1 vote
1 answer
586 views

can i change the name of executable during compilation

I'm compiling LLVM/Clang but want to give a different name to the executable. Is there a special option I need to be using, like --binary-name? The trick is that I want to rename every tool that comes ...
user avatar
  • 521
8 votes
1 answer
16k views

how to install newest clang 3.8 by apt

here I have found instruction how to install clang3.8: http://llvm.org/apt/ so I executed: wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add - result: --2015-09-19 12:53:09-...
user avatar
2 votes
1 answer
4k views

How to build openssl with clang(rather than gcc) on a FreeBSD machine?

I have a 64 bit FreeBSD build machine. I need to add https support in my python3 application code. For that it is advised to build/compile python with openssl support. I do not need any gcc dependency ...
user avatar
3 votes
1 answer
450 views

Can't seem to set environmental variables in fish correctly?

this is my fish configuration: set -x CGO_CPPFLAGS 'llvm-config --cppflags' set -x CGO_LDFLAGS 'llvm-config --ldflags --libs --system-libs all' set -x CGO_CXXFLAGS '-std=c++11' I've tried running ...
user avatar
0 votes
1 answer
427 views

What else is needed to use clang besides "apt-get install clang; clang hw.cpp"?

Installed clang: $~/Projects/clang$ sudo apt-get install clang Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be ...
user avatar