clang

Run-Time Check Failure #0: Using C-exports from MinGW dll in VC++ (or: Using libclang MinGW build in VC++ application)

依然范特西╮ 提交于 2020-01-17 04:54:05
问题 This question is about using C-Functions from a MinGW dll in a VC++ project, which fails with the following error: Run-Time Check Failure #0 . I successfully build clang and more importantly libclang using MinGW (to have a libclang.dll that uses the MinGW standard library). My application previously used a VC++-build of libclang, that I now want to exchange with the MinGW build. To do that, I created a def-file and afterwards an import library from the MinGW dll file: dlltool -z libclang.def

Linking against third-party libraries when doing cross-platform build in Visual Studio 2015

若如初见. 提交于 2020-01-17 01:26:08
问题 I am trying to compile a Shared Object (.so) with Visual Studio 2015 RC. I am linking against the Opus Codec libs in my stdafx.h: #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\VS2010\\Win32\\Debug\\celt.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\VS2010\\Win32\\Debug\\opus.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\VS2010\\Win32\\Debug\\silk_common.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\VS2010\\Win32\\Debug\\silk_fixed.lib") #pragma

Where is the complete documentation of clang flags?

岁酱吖の 提交于 2020-01-15 04:10:26
问题 The references I know are here: http://clang.llvm.org/docs/ClangCommandLineReference.html http://clang.llvm.org/docs/DiagnosticsReference.html but I can't find flags like -msse4.1,so are there complete list of supported flags on clang.llvm.org,or we need external documentation? 来源: https://stackoverflow.com/questions/55348280/where-is-the-complete-documentation-of-clang-flags

Does Clang lack CRC32 for ARMv8/Aarch64?

怎甘沉沦 提交于 2020-01-15 03:50:06
问题 I'm attempting to set-up CI for our Xcode cross-compiles. The cross-compiles test both ARMv7 and ARMv8. Things look good except when it comes time to link for ARMv8: clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \ -stdlib=libc++ -c cryptlib.cpp clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \ -isysroot

Using OpenMP with Clang and CMake in Visual Studio

假装没事ソ 提交于 2020-01-15 03:11:50
问题 I'm trying to compile a simple app to test a few libraries I might be using in the future. Because of some problems I had with msvc I tried Clang, which made a strange error I got disappear. The problem I have now is that the libraries I want to test use OpenMP. They import it using the FindOpenMP module CMake privides. However the module doesn't find it with Clang. cmake_minimum_required(VERSION 3.14.0) project(blaze-test VERSION 0.1.0) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD

Interoperability between Clang, GCC and LTO

帅比萌擦擦* 提交于 2020-01-14 16:46:26
问题 I know that Clang and GCC are more or less compatible C/C++ compilers as long as one takes care of things like architecture flags, predefines and linking the right libraries. Creating libraries with one compiler and linking them with objects created by the other is actually pretty easy (at least on x86). Here is a little test project doing exactly that: https://gitlab.com/higaski/Interoperability I was wondering however if Link Time Optimization (LTO) could somehow work across compilers? I

how to write a clang plugin to inject some code to the original code while compiling

蹲街弑〆低调 提交于 2020-01-14 14:20:10
问题 i got a problem about how to write a clang plugin that will change the code. i want inject some code to the program,just like this:enter code here //the original code //the filename is user_code.cpp int f1(){ return 1; } int f2(){ return 2; } int f3(){ return 3; } int main(){ for(int i=0;i<1000;i++)f1(); for(int i=0;i<10000;i++)f2(); for(int i=0;i<100000;i++)f3(); return 0; } //the injected code int function_counter[3]; int f1(){ function_counter[0]++; return 1; } int f2(){ function_counter[1

how to write a clang plugin to inject some code to the original code while compiling

杀马特。学长 韩版系。学妹 提交于 2020-01-14 14:20:06
问题 i got a problem about how to write a clang plugin that will change the code. i want inject some code to the program,just like this:enter code here //the original code //the filename is user_code.cpp int f1(){ return 1; } int f2(){ return 2; } int f3(){ return 3; } int main(){ for(int i=0;i<1000;i++)f1(); for(int i=0;i<10000;i++)f2(); for(int i=0;i<100000;i++)f3(); return 0; } //the injected code int function_counter[3]; int f1(){ function_counter[0]++; return 1; } int f2(){ function_counter[1

Why does this simple assembly program work in AT&T syntax but not Intel syntax?

我怕爱的太早我们不能终老 提交于 2020-01-14 14:12:06
问题 What's wrong with this code (Running on x86_64 Linux)? .intel_syntax .text .globl _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, 14 syscall mov rax, 60 mov rdi, 0 syscall .data msg: .ascii "Hello, world!\n" When I run it: $ clang -o hello_intel hello_intel.s -nostdlib && ./hello_intel No output. Let's strace it: $ strace ./hello_intel execve("./hello_intel", ["./hello_intel"], [/* 96 vars */]) = 0 write(1, 0x77202c6f6c6c6548, 14) = -1 EFAULT (Bad address) exit(0) = ? +++ exited

Why does this simple assembly program work in AT&T syntax but not Intel syntax?

耗尽温柔 提交于 2020-01-14 14:09:27
问题 What's wrong with this code (Running on x86_64 Linux)? .intel_syntax .text .globl _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, 14 syscall mov rax, 60 mov rdi, 0 syscall .data msg: .ascii "Hello, world!\n" When I run it: $ clang -o hello_intel hello_intel.s -nostdlib && ./hello_intel No output. Let's strace it: $ strace ./hello_intel execve("./hello_intel", ["./hello_intel"], [/* 96 vars */]) = 0 write(1, 0x77202c6f6c6c6548, 14) = -1 EFAULT (Bad address) exit(0) = ? +++ exited