clang

【Java】macOS下编译JDK8

北战南征 提交于 2020-02-05 10:03:22
安装mercurial brew install mercurial 下载源码 1234 hg clone http://hg.openjdk.java.net/jdk8/jdk8 java-sourcecd java-sourcechmod +x get_source.sh./get_source.sh 安装依赖 brew install freetype 修改源代码 1. 修改relocInfo.hpp的367行(hotspot/src/share/vm/code/relocInfo.hpp) 修改前: 1 inline friend relocInfo prefix_relocInfo(int datalen=0); 修改后: 1 inline friend relocInfo prefix_relocInfo(int datalen); 2. 修改generated-configure.sh的20061和21640行(common/autoconf/generated-configure.sh),解决 configure: error: GCC compiler is required 错误 修改前为: 1 as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5

XCode 4.2 clang seg fault

余生颓废 提交于 2020-02-03 09:06:31
问题 Just upgraded to Lion and xcode 4.2. Now when I recompile my program I getting these errors: /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';' /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:' /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}') /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}') /Users

XCode 4.2 clang seg fault

亡梦爱人 提交于 2020-02-03 09:06:09
问题 Just upgraded to Lion and xcode 4.2. Now when I recompile my program I getting these errors: /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';' /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:' /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}') /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}') /Users

Configure CMake in windows to use clang from command line to get modern OpenMP support

末鹿安然 提交于 2020-02-03 04:07:45
问题 I have a small test project that uses OpenMP for parallelization. My target is to compile it so it produces .dll and .lib for libraries (because my real project links to external libraries distributed using these types), with support for OpenMP 4.5 or newer and do it from the command line so it can be done on a docker for testing and checking (the docker part is out of the scope of this question, it is just for reference on why I need it to work from the command line). I can compile this

在Ubuntu18.04编译OpenJDK12

笑着哭i 提交于 2020-01-26 18:50:30
目录 1、所需软件 1.1 OpenJDK12 1.2 Ubuntu 18.04 LTS 1.3 Workstation 14 Pro(14.1.0 build-7370693) 2、构建编译环境 2.1 构建编译环境GCC 2.2 OpenJDK编译依赖库 2.3 OpenJDK11 2.4 提醒 3、进行编译 3.1 依赖检查 3.2 编译 4、参考 1、所需软件 1.1 OpenJDK12 直接访问准备下载的JDK版本的仓库页面(https://hg.openjdk.java.net/jdk/jdk12/),然后点击左边菜单中的“Browse”,将显示如下图的源码根目录页面。此时点击左边的“zip”链接即可下载当前版本打包好的源码,到本地直接解压即可。在Ubuntu下载的OpenJDK 12源码包大小为180.3MB,解压之后约为675.6MB。 1.2 Ubuntu 18.04 LTS 网址: https://ubuntu.com/download/desktop 1.3 Workstation 14 Pro(14.1.0 build-7370693) 2、构建编译环境 2.1 构建编译环境GCC Ubuntu里用户可以自行选择安装GCC或CLang来进行编译,但必须确保最低的版本为GCC 4.8或者CLang 3.2以上,官方推荐使用GCC 7.8或者CLang 9

loop_apply.o: file not recognized: File format not recognized

余生颓废 提交于 2020-01-24 22:12:07
问题 I am trying to install R ’s plyr package. Here is the error message: * installing *source* package ‘plyr’ ... ** package ‘plyr’ successfully unpacked and MD5 sums checked ** libs clang++ -I/opt/R-3.4.1/include -DNDEBUG -I"/home/isomorphismes/R/i686-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -I/opt/boost_1_61_0/boost -c RcppExports.cpp -o RcppExports.o clang -I/opt/R-3.4.1/include -DNDEBUG -I"/home/cd/R/i686-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include

Filtering directories when parsing cpp files in get-includes in python bindings/clang

时光怂恿深爱的人放手 提交于 2020-01-24 16:36:25
问题 I should write a python-clang parser which returns all the inclusions in cpp files. So I use sth like the following code: def _main(): from clang.cindex import Index from optparse import OptionParser filter=['/usr/lib','usr/include'] p=OptionParser() (o,a)=p.parse_args() i=Index.create() t=i.parse(None,a) for i in t.get_includes(): print i.include if __name__=='__main__': _main() Now i need to filter just some of inclusions like specific directories: filter=['/usr/lib','usr/include'] Question

Is it possible to compile & link Clang/LLVM using the gold linker?

半腔热情 提交于 2020-01-24 05:42:05
问题 I'm writing a custom pass for LLVM/Clang, and recompiling tends to take a while and use a lot of memory. I've heard that the gold linker (1) takes less time and (2) uses less memory than the standard ld linker. Is there a way to pass flags into the LLVM/Clang build process and change to the gold linker? As per this answer, I've been attempting to use an override file, but I don't seem to be having a lot of success. I'll also note that I'm compiling the latest Clang/LLVM build (4.0) using

Why GCC does not report uninitialized variable?

亡梦爱人 提交于 2020-01-24 03:23:26
问题 #include <ios> #include <iostream> #include <map> using namespace std; int main() { ios_base::sync_with_stdio(false); map<int, int> v; int i; int t; while (cin >> i) { v[i] = t++; } auto mi = i; auto mt = t; for (const auto p : v) { if (p.second < mt) { mi = p.first; mt = p.second; } } cout << mi << '\n'; return 0; } The abovementioned program makes heavy use of an uninitialized variable t , but GCC does not report it with -Wall or -Wuninitialized. Why is it so? It is worth noting that Clang

Can't see Windows program's stdout in console (compiled with Clang on Windows)

人盡茶涼 提交于 2020-01-23 17:35:02
问题 When I build a simple console app with clang, it works fine: void main() { puts("HELLO"); } But when I create a Windows app with WinMain , I can't see stdout. There must be a flag that fixes it, like MinGW's -mconsole 回答1: A quick stdout-enabler for otherwise GUI apps: if (AllocConsole()) { FILE* fi = 0; freopen_s(&fi, "CONOUT$", "w", stdout); } and then std::cout and printf work. 回答2: WinMain is a custom microsoft entry function for a windows graphical application (with windows and menus etc