macos上如何ubuntu编译cm12.1源码源码

问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
我在程序中使用了linux kernel的.h文件定义的内核链表。我的gcc是用brew默认参数安装的。kernel的代码我放在了/WorkSpace/LinuxKernel/4.4.2目录下。我应该用gcc的什么参数,告诉编译器到/WorkSpace/LinuxKernel/4.4.2目录下找.h文件呢?
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
-I /WorkSpace/LinuxKernel/4.4.2
同步到新浪微博
分享到微博?
Hi,欢迎来到 SegmentFault 技术社区!⊙▽⊙ 在这里,你可以提出编程相关的疑惑,关注感兴趣的问题,对认可的回答投赞同票;大家会帮你解决编程的问题,和你探讨技术更新,为你的回答投上赞同票。
明天提醒我
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
扫扫下载 App
SegmentFault
一起探索更多未知2536人阅读
Android(101)
参考资料:
Initializing a Build Environment
Building android AOSP on Mac OS X Mountain Lion
Setting Up A Build Environment on OS X 10.9 Mavericks
1. 如果安装的是Xcode 5,那可以会出现cpp编译错误,请使用Xcode 4.6.3版本。
2. 如果你安装的perl版本高于5.10,那么会出现这个错误:
Can't locate Switch.pm in @INC (@INC contains:
通过安装switch这个perl module可解决。
3. 如果Android源代码是曾经拷贝到非case-sensitive分区,则已经丢失某些c/cpp/h文件,会提示找不到这些代码文件。
解决方法是在case-sensitive分区中重新更新补齐丢失的文件。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:408522次
积分:5075
积分:5075
排名:第4027名
原创:97篇
转载:95篇
评论:35条
(1)(1)(3)(1)(1)(1)(1)(4)(3)(5)(1)(7)(2)(5)(9)(4)(3)(5)(1)(4)(1)(1)(1)(2)(11)(7)(3)(1)(1)(1)(2)(2)(3)(3)(3)(3)(6)(4)(5)(8)(11)(4)(2)(3)(5)(4)(8)(10)(2)(3)(2)(1)(1)(10)(1)(3)(2)(1)(2)(3)查看: 14098|回复: 4
在mac os x上进行嵌入式linux开发[编译linux kernel]
N多年就一直努力着在linux上完成100%的工作,后面果真成功了,还是在一台很菜的PC上用了两年左右,直到后来非得要仿真才回到了MS。最近这几年又开始慢慢地转到MAC下,当然不是工作,而是业余,在家里用,不过也是做和工作很类似的事情,也正朝着可以在MAC上很高效地完成100%的事情。(到目前为止,可能就只有FPGA的活暂时没办法在MAC下用)为什么是linux?为什么是MAC?那是因为喜欢UNIX,喜欢OPEN SOURCE,喜欢MAC,她们都有这样的特点:简单但高效,简单但艺术,也就是KISS。言归正转既然android都可以在MAC上从源码级构建和开发,那么嵌入式linux的构建和开发应该也是OK的吧。好,开工。
环境: mac os x 10.7.5 (macbook pro)
1, sudo port install libelf2, sudo port install gsed3, sudo port install arm-elf-binutils arm-elf-gcc4, sudo port install powerpc-rtems-binutils powerpc-rtems-gcc
如果3,4出错,还可能需要做以下这几步:如果报与libintl.h有头的,就运行以下命令:sudo ln -s /opt/local/include/libintl.h /usr/include/libintl.h此参考:如果报如下所显与toplev.c有关的:toplev.c:574:1: error: redefinition of a 'extern inline' function 'exact_log2' is not supported in C99 mode就使用类似以下命令进行构建安装:sudo port clean powerpc-rtems-gccsudo port install powerpc-rtems-piler=llvm-gcc-4.2参考:
当然你也可以从头开始,自己下载binutils and gcc的源代码进行自己构建【其实port也就是下载源码进行构建的,只是它构建的参数是已经定义好的了】
下来链接一下gcc的命令:sudo ln -s /opt/local/bin/arm-elf-gcc-4.6 /opt/local/bin/arm-elf-gccsudo ln -s /opt/local/bin/powerpc-rtems-gcc-4.2.3 /opt/local/bin/powerpc-rtems-gcc
好,可以开始编译linux kernel了:make ARCH=arm CROSS_COMPILE=arm-elf- menuconfig然后就看到了熟悉的画面了:
Q4.jpg (120.68 KB, 下载次数: 7)
19:10 上传
下来将以TI的DM6467和Freescale的mpc8349itx为例进行编译并测试make ARCH=powerpc CROSS_COMPILE=powerpc-rtems- mpc834x_itx_defconfigmake ARCH=powerpc CROSS_COMPILE=powerpc-rtems-& &(这里不加像uImage的参数是为了得到带dtb的uImage)
编译时会报错:scripts/mod/mk_elfconfig.c:4:17: error: elf.h: No such file or directory这是由于/usr/include目录少了elf.h可以到: 下载下来,然后放到/usr/include下参考:
make ARCH=powerpc CROSS_COMPILE=powerpc-rtems-会出现以下错误:stat: illegal option -- cusage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]make[1]: *** [arch/powerpc/boot/uImage] Error 1make: *** [zImage] Error 2
通过命令grep -nR 'stat -c' * 找到:arch/arm/boot/compressed/Makefile:102:LDFLAGS_vmlinux = --defsym _image_size=$(shell stat -c &%s& $(obj)/../Image)和arch/powerpc/boot/wrapper:265:& & strip_size=$(stat -c %s $vmz.$$)arch/powerpc/boot/wrapper:279:& & strip_size=$(stat -c %s $vmz.$$)这主要是由于linux的stat命令与bsd的stat命令参数不一样,这里主要是得到文件的size编辑上面的文件,把stat -c %s改为stat -f &%z&
然后就是出现如下的错:&mkimage& command not found - U-Boot images will not be builtmake[1]: *** [arch/powerpc/boot/uImage] Error 1make: *** [zImage] Error 2这个就是没有mkimage命令,这个在u-boot里的tools里有编译uboot时使用命令:make tools然后就会在tools下出现了mkimage,把它放到/opt/local/bin就OK了
Oh, Year! powerpc的编译完全通过
ARM的报这样的错:arm-elf-ld: error: arch/arm/boot/compressed/misc.o uses VFP instructions, whereas arch/arm/boot/compressed/vmlinux does notarm-elf-ld: error: arch/arm/boot/compressed/decompress.o uses VFP instructions, whereas arch/arm/boot/compressed/vmlinux does not这个应该是与VFP有关,也就是float了(这个还有待继续研究)
不过vmlinux和Image已经编译通过,那基本没有问题了
[linux-2.6.10_mvl401_LSP_01_30_00_082]make ARCH=arm CROSS_COMPILE=arm-elf- uImage&&CHK& &&&include/linux/version.h&&UPD& &&&include/linux/version.h&&SYMLINK include/asm -& include/asm-arm&&SPLIT& &include/linux/autoconf.h -& include/config/*&&HOSTCC&&scripts/genksyms/genksyms.o&&SHIPPED scripts/genksyms/lex.c&&SHIPPED scripts/genksyms/parse.h&&SHIPPED scripts/genksyms/keywords.c&&HOSTCC&&scripts/genksyms/lex.o&&SHIPPED scripts/genksyms/parse.c&&HOSTCC&&scripts/genksyms/parse.oscripts/genksyms/parse.y:27:20: error: malloc.h: No such file or directory/usr/lib/bison.simple: In function 'yyparse':/usr/lib/bison.simple:361: warning: implicit declaration of function 'free'make[2]: *** [scripts/genksyms/parse.o] Error 1make[1]: *** [scripts/genksyms] Error 2make: *** [scripts] Error 2
编译ubootmake cleanmake ARCH=arm CROSS_COMPILE=arm-elf- davinci_dm646x_configmake ARCH=arm CROSS_COMPILE=arm-elf-
报以下的错,应该是编译.S汇编文件时没通过,这个也有待研究arm-elf-gcc&&-D__ASSEMBLY__ -g&&-Os& &-fno-strict-aliasing&&-fno-common -ffixed-r8 -msoft-float&&-D__KERNEL__ -DTEXT_BASE=0x&&-I/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/local/lib/gcc/arm-elf/4.6.0/include -pipe&&-DCONFIG_ARM -D__ARM__&&-c -o start.o start.S/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include/version_autogenerated.h: Assembler messages:/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include/version_autogenerated.h:1: Error: junk at end of line, first unrecognized character is `-'/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include/version_autogenerated.h:2: Error: junk at end of line, first unrecognized character is `-'/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include/version_autogenerated.h:3: Error: junk at end of line, first unrecognized character is `-'/Users/fi9/my-projects/linux/dm6467/u-boot-1.2.0_dvs/include/version_autogenerated.h:4: Error: junk at end of line, first unrecognized character is `&'make[1]: *** [start.o] Error 1make: *** [cpu/arm926ejs/start.o] Error 2
打开tftpd服务:sudo netstat -a | grep tftpsudo launchctl load -wF /System/Library/LaunchDaemons/tftp.plist sudo netstat -a | grep tftp参考:
把文件放到/priveta/tftpboot然后板子就可以通过tftp下载了
安装minicom
sudo port install minicom
如此就可以使用minicom了,哈,很像ubuntu或debian吧?
到此为止,powerpc的板子经过编译的kernel,然后再经过tftpd server和minicom,完全可以在mac os x上进行所有相关工作了,而且让powerpc跑起了2.6.3x和3.5.x的linux kernel,比原来的2.6.13高级了很多,现在可以用V4L2进行一些相关的工作了,以前的可是V4L1,版本太低了
除了linux kernel外,还有通用的uboot, busybox,这下一步补充完成吧,当然还有很我的其它软件移植和应用程序的开发(仿真器就算了吧)
 大哥,你解决了我一个很大的问题,我一直在想如何在mac下编译出elf,开始还以为可以通过gcc参数来配置,现在才知道得用arm elf&&gcc
 按照你的步骤,我 make menuconfig的时候出现了&&HOSTLD&&scripts/kconfig/mconf Undefined symbols for architecture x86_64:& &的错误
HOSTLD&&scripts/kconfig/mconf
Undefined symbols for architecture x86_64:
&&&_acs_map&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_print_arrows in checklist.o
& && &_dialog_clear in util.o
& && &_draw_box in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_dialog_yesno in yesno.o
&&&_cbreak&, referenced from:
& && &_init_dialog in util.o
&&&_delwin&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_dialog_yesno in yesno.o
& && &_dialog_menu in menubox.o
&&&_doupdate&, referenced from:
& && &_dialog_checklist in checklist.o
&&&_endwin&, referenced from:
& && &_init_dialog in util.o
& && &_end_dialog in util.o
&&&_flash&, referenced from:
& && &_dialog_inputbox in inputbox.o
&&&_getcurx&, referenced from:
& && &_init_dialog in util.o
& && &_print_autowrap in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_print_arrows in menubox.o
&&&_getcury&, referenced from:
& && &_init_dialog in util.o
& && &_print_autowrap in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_print_arrows in menubox.o
&&&_getmaxx&, referenced from:
& && &_conf in mconf.o
& && &_dialog_checklist in checklist.o
& && &_dialog_clear in util.o
& && &_init_dialog in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_refresh_text_box in textbox.o
&&&_getmaxy&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_attr_clear in util.o
& && &_dialog_clear in util.o
& && &_init_dialog in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_refresh_text_box in textbox.o
&&&_has_colors&, referenced from:
& && &_init_dialog in util.o
& && &_draw_shadow in util.o
&&&_init_pair&, referenced from:
& && &_init_dialog in util.o
&&&_initscr&, referenced from:
& && &_init_dialog in util.o
&&&_keypad&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_init_dialog in util.o
& && &_on_key_esc in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_dialog_yesno in yesno.o
& && &_dialog_menu in menubox.o
&&&_newwin&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_dialog_yesno in yesno.o
& && &_dialog_menu in menubox.o
&&&_nodelay&, referenced from:
& && &_on_key_esc in util.o
&&&_noecho&, referenced from:
& && &_init_dialog in util.o
&&&_scrollok&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_menu in menubox.o
&&&_start_color&, referenced from:
& && &_init_dialog in util.o
&&&_stdscr&, referenced from:
& && &_conf in mconf.o
& && &_dialog_checklist in checklist.o
& && &_dialog_clear in util.o
& && &_init_dialog in util.o
& && &_end_dialog in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
&&&_subwin&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_textbox in textbox.o
& && &_dialog_menu in menubox.o
&&&_ungetch&, referenced from:
& && &_on_key_esc in util.o
&&&_waddch&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_print_item in checklist.o
& && &_print_arrows in checklist.o
& && &_attr_clear in util.o
& && &_dialog_clear in util.o
& && &_print_title in util.o
& && &_print_button in util.o
&&&_waddnstr&, referenced from:
& && &_print_item in checklist.o
& && &_print_arrows in checklist.o
& && &_dialog_clear in util.o
& && &_print_title in util.o
& && &_print_autowrap in util.o
& && &_print_button in util.o
& && &_dialog_inputbox in inputbox.o
&&&_wattrset&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_print_item in checklist.o
& && &_print_arrows in checklist.o
& && &_attr_clear in util.o
& && &_dialog_clear in util.o
& && &_print_title in util.o
& && &_print_button in util.o
&&&_wbkgdset&, referenced from:
& && &_dialog_textbox in textbox.o
& && &_refresh_text_box in textbox.o
& && &_dialog_menu in menubox.o
&&&_wclrtoeol&, referenced from:
& && &_refresh_text_box in textbox.o
& && &_do_print_item in menubox.o
&&&_wgetch&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_on_key_esc in util.o
& && &_dialog_inputbox in inputbox.o
& && &_dialog_textbox in textbox.o
& && &_dialog_yesno in yesno.o
& && &_dialog_menu in menubox.o
&&&_winch&, referenced from:
& && &_draw_shadow in util.o
&&&_wmove&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_print_item in checklist.o
& && &_print_arrows in checklist.o
& && &_attr_clear in util.o
& && &_dialog_clear in util.o
& && &_end_dialog in util.o
& && &_print_title in util.o
&&&_wnoutrefresh&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_clear in util.o
& && &_draw_shadow in util.o
& && &_dialog_textbox in textbox.o
& && &_refresh_text_box in textbox.o
& && &_dialog_menu in menubox.o
&&&_wprintw&, referenced from:
& && &_print_item in checklist.o
& && &_refresh_text_box in textbox.o
&&&_wrefresh&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_print_item in checklist.o
& && &_end_dialog in util.o
& && &_dialog_inputbox in inputbox.o
& && &_refresh_text_box in textbox.o
& && &_dialog_yesno in yesno.o
& && &_dialog_menu in menubox.o
&&&_wscrl&, referenced from:
& && &_dialog_checklist in checklist.o
& && &_dialog_menu in menubox.o
&&&_wtouchln&, referenced from:
& && &_attr_clear in util.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2
HOSTLD&&scripts/kconfig/mconf
Undefined symbols for architecture x86_64:
&&&_acs_map&, referenced ...
首先删除 scripts/kconfig/mconf.o
修改 scripts/kconfig/lxdialog/check-lxdialog.sh 中 ldflags 如下:
# What library to link
& && &&&for lib in ncur do
& && && && &$cc -print-file-name=lib${lib}.${ext} | grep -q /
& && && && &if [ $? -eq 0 ]; then
& && && && && & echo &-l${lib}&
& && && && && & exit
& && && && &fi
& && &&&done
& && &&&# ===== fix start =====
& && &&&for lib in ncur do
& && && && &if [ -f /usr/lib/lib${lib}.${ext} ]; then
& && && && && & echo &-l${lib}&
& && && && && & exit
& && && && &fi
& && &&&done
& && &&&# ===== fix end =====
& & exit 1
最后,重新 make menuconfig
如果上述方法不行,可以用 make nconfig
Powered byCoreCLR登陆GitHub之后,体验CoreCLR首当其冲的方式就是在自己的电脑上编译它,昨天分别在Windows与Linux上成功编译了CoreCLR,详见:
Windows与Linux上编译成功之后,有一个挡不住的冲动&&在Mac上编译CoreCLR。虽然微软目前优先考虑的是Windows与Linux两个平台,CoreCLR的编译暂时不支持Mac OS X,但我最期待的却是在Mac OS X上编译CoreCLR,而且编译CoreCLR所需要的CMake与LLVM在Mac OS X上都有,尝试一下是必须的。
于是,心动不如行动,开始了Mac OS X编译CoreCLR之旅。
Build操作步骤如下:
1)签出github上的CoreCLR代码库:&git clone /dotnet/coreclr.git&
2)安装cmake:&brew install cmake&
3)运行build命令:&sh build.sh&
3)build结果-失败,错误信息如下:
Unable to locate llvm-ar
Failed to generate native component build project!
错误信息显示找不到llvm-ar命令。
运行命令&clang --version&,确认LLVM 3.5已安装:
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
运行命令&ls /usr/bin/llvm*&,的确没有llvm-ar:
/usr/bin/llvm-g++ /usr/bin/llvm-gcc
后来发现原来藏在&/usr/local/opt/llvm/bin/ 文件夹中:
ls /usr/local/opt/llvm/bin/llvm-ar
/usr/local/opt/llvm/bin/llvm-ar
但环境变量$PATH中没有这个路径,于是加上这个路径:
export PATH=/usr/local/opt/llvm/bin:$PATH
(补充:持久添加到$PATH,sudo vi /etc/paths.d/llvm,添加内容/usr/local/opt/llvm/bin,保存并重新打开Terminal)
添加之后,继续build,&Unable to locate llvm-ar&错误消失。
但出现了新的错误:
-- The C compiler identification is AppleClang 6.0.0.6000056
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:317 (message):
Not Implemented!
查看CMakeLists.txt中的代码:
if (IS_64BIT_BUILD EQUAL 1)
if (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
add_definitions(-DDBG_TARGET_AMD64_UNIX)
endif (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
add_definitions(-D_TARGET_AMD64_=1)
add_definitions(-DDBG_TARGET_AMD64)
else (IS_64BIT_BUILD EQUAL 1)
# TODO: Support this
message(FATAL_ERROR "Not Implemented!") #line 317
endif (IS_64BIT_BUILD EQUAL 1)
第317代码是&message(FATAL_ERROR "Not Implemented!")&。分析这段if代码块,可以知道当操作系统是Mac OS X时,IS_64BIT_BUILD的值不为1,如果将之设置为1就可以避开这个错误。
于是顺藤摸瓜,在CMakeLists.txt的第128行找到了设置IS_64BIT_BUILD的代码:
elseif (CLR_CMAKE_PLATFORM_UNIX)
# Set flag to indicate if this will be a 64bit Linux build
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(IS_64BIT_BUILD 1)
endif (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
当CLR_CMAKE_PLATFORM_UNIX为true的时候,会将IS_64BIT_BUILD的值设置为1。
继续顺藤摸瓜,在CMakeLists.txt的第7行找到了设置CLR_CMAKE_PLATFORM_UNIX的代码:
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CLR_CMAKE_PLATFORM_UNIX 1)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
endif(CMAKE_SYSTEM_NAME STREQUAL Linux)
然后依葫芦画瓢,添加了针对Mac OS X的代码:
# Mac OS X
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CLR_CMAKE_PLATFORM_UNIX 1)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
然后运行./build.sh编译CoreCLR,终于将build.sh跑起来了。虽然也有一些报错,但是build的执行没有中断:
Commencing CoreCLR Repo build
Checking pre-requisites...
Commencing build of native components for amd64/debug
Invoking cmake with arguments: /git/dotnet/coreclr DEBUG
Detected Linux x86_64
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.
Run "cmake
--help-policy CMP0042" for policy details.
Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
mscordaccore
This warning is for project developers.
Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /git/dotnet/coreclr/binaries/CMake
Executing make
./build.sh: line 84: nproc: command not found
0%] Building C object src/pal/tools/cppmunge/CMakeFiles/cppmunge.dir/cppmunge.c.o
1%] Built target palrt
1%] Built target mdhotdata_full
Built target gcinfo
/git/dotnet/coreclr/src/pal/tools/cppmunge/cppmunge.c:38:10: fatal error: 'linux/limits.h' file not found
#include &linux/limits.h&
1%] Built target ildbsymlib
Built target dbgutil
2%] Built target corguids
3%] Built target ceefgen
满怀期望地等待着build的结果。。。
但是在build过程中,MacBook的CPU风扇突然呼呼作响,接着OS X系统停止响应,只能强制关机。
开机后再尝试,在build过程中依然会让Mac挂掉。接着进行多次尝试,只要build,Mac必挂。
Mac OS X上编译CoreCLR之旅因为这个暂时无法解决的问题而中断。
虽然这次尝试失败了,但是在Mac OS X上编译CoreCLR的痴心不改,在Mac OS X上开发.NET程序的期待不变!
&CPU风扇突然呼呼作响,OS X停止响应&可能与&nproc: command not found&这个错误有关,很可能是只用了一个CPU核在编译。
果然是这个原因,将build.sh中的&make install -j `nproc` $__UnprocessedBuildArgs&改为下面的代码,&CPU风扇突然呼呼作响,OS X停止响应&的问题解决:&
if [[ "$OSTYPE" == "linux-gnu" ]]; then
make install -j `nproc` $__UnprocessedBuildArgs
elif [[ "$OSTYPE" == "darwin"* ]]; then
make install -j `sysctl -n hw.ncpu` $__UnprocessedBuildArgs
后来,微软的提供了更好的:getconf _NPROCESSORS_ONLN(既支持Linux,又支持Mac OS X),&并且已经将修改提交至coreclr的代码库:
后来,在Issue的回复中得知已经修改出了一个可在Mac OS X上编译的版(详见),于是git签出这个试了一下:
git clone -b osx --single-branch /kangaroo/coreclr.git
./build.sh
结果成功了!
[100%] Built target corerun
Install the project...
-- Install configuration: "DEBUG"
-- Installing: /git/dotnet/coreclr-osx/coreclr/binaries/Product/amd64/debug/./corerun
-- Installing: /git/dotnet/coreclr-osx/coreclr/binaries/Product/amd64/debug/./libmscordaccore.dylib
-- Installing: /git/dotnet/coreclr-osx/coreclr/binaries/Product/amd64/debug/./libcoreclr.dylib
Repo successfully built.
Product binaries are available at /git/dotnet/coreclr-osx/coreclr/binaries/Product/amd64/debug
2月7日下午发现,惊喜地发现可在Mac OS X上编译的版本已经合并到主分支,详见& 。
编译这个版本时出现"ld: symbol(s) not found for architecture x86_64"错误,删除binaries文件夹之后重新编译,问题解决。
【相关链接】
阅读(...) 评论()

我要回帖

更多关于 cm12.1源码编译 的文章

 

随机推荐