Cygwin平台 编译QFS

来源:互联网 发布:9.20版本907工程数据 编辑:程序博客网 时间:2024/06/07 17:59

QFS是一个开源分布式文件系统 基于Google File System的实现KFS

文档中写明支持Cygwin 所以打算在cygwin下使用

由于之前在公司机器上编译成功(cygwin32) 想当然认为64位下也没什么问题


于是按照正确顺序:安装cygwin 64位, JDK,

修改~/.bashrc 添加

export JAVA_HOME=/cygdrive/d/app/JDK

export JAVA_AWT_LIBRARY=/cygdrive/d/app/JDK/jawt.lib

export JAVA_JVM_LIBRARY=/cygdrive/d/app/JDK/jvm.lib

不加这些也行,但是就不能支持java了


修改默认的CMakeLists.txt :

IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
    find_package(Boost COMPONENTS regex system REQUIRED)
ELSE (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
    find_package(Boost COMPONENTS regex system REQUIRED) #这一行添加system,默认的配置文件有误,将不会正确链接libboost_system-mt.dll.a
ENDIF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")

进入qfs目录
cmake .

一切正常

make... 就出状况啦

[ 18%] Building CXX object src/cc/meta/CMakeFiles/kfsMeta.dir/MetaRequest.o
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/as: CMakeFiles/kfsMeta.dir/MetaRequest.o: too many sections (33439)
/tmp/ccAOJfOA.s: Assembler messages:
/tmp/ccAOJfOA.s: Fatal error: can't write CMakeFiles/kfsMeta.dir/MetaRequest.o: ▒ļ▒▒▒▒▒
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/as: CMakeFiles/kfsMeta.dir/MetaRequest.o: too many sections (33439)
/tmp/ccAOJfOA.s: Fatal error: can't close CMakeFiles/kfsMeta.dir/MetaRequest.o: ▒ļ▒▒▒▒▒
src/cc/meta/CMakeFiles/kfsMeta.dir/build.make:310: recipe for target 'src/cc/meta/CMakeFiles/kfsMeta.dir/MetaRequest.o' failed
make[2]: *** [src/cc/meta/CMakeFiles/kfsMeta.dir/MetaRequest.o] Error 1
CMakeFiles/Makefile2:250: recipe for target 'src/cc/meta/CMakeFiles/kfsMeta.dir/all' failed
make[1]: *** [src/cc/meta/CMakeFiles/kfsMeta.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2


网上一查"too many sections" 结果令人绝望:

http://stackoverflow.com/questions/16596876/object-file-has-too-many-sections

The error "%B: too many sections (%d)" comes from the function coff_compute_section_file_positions() located in bfd/coffcode.h. It's produced when the output.obj file (in COFF format) contains more than 32766 sections. There is no way to avoid this error, at least not if you want to use Windows' PE/COFF object format; COFF files use onlytwo bytes for "NumberOfSections" in the file header.

It's not clear to me why as (the GNU assembler) caps the number of sections at 32768-minus-2, instead of 65536-minus-1 (section 0 is reserved); but either way, that might not be enough if you're making heavy use of templatesand your compiler implements templates via COMDAT sections.

As you've already noticed, passing /bigobj to Microsoft's compiler causes it to output a munged COFF format with up to 231 sections, which "should be enough for anybody." However, the munged format is formally undocumented, and I don't see any informal documentation (blog posts or what-have-you) on the subject, so until someone with a copy of MSVC can write up a specification for/bigobj, it doesn't stand much chance of getting into the GNU tools.

IMHO, if you're trying to make a Windows build, you should just bite the bullet and use MSVC. Nobody besides Microsoft is particularly motivated to waste time wrestling with the PE/COFF format.


暂时这个问题就没法解决了 最终换回了cygwin 32位版本 顺利编译

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 仵作掌中娇 世子爷她不可能是女的 穿进红楼后,我成了人生赢家 假死后夫人她称霸黑莲界 奶萌小团宠她觉醒了种田系统 巨星的大佬青梅 总裁的小撩精又生气了 开荒种田:农门辣妻有空间 签到后,小白花她在娱乐圈翻红了 江月照 魂飞魄散的上古大仙在修真界诈尸 快穿:大佬她又抢了反派剧本 夫人她总想逃 穿成阴戾反派未来嫂嫂 上神大人他偏甜系啊 咸鱼后妈带崽在综艺当对照组 系统BUG让我成了舔包专业户 快穿:系统有的是力气和手段 当我的霸总老公有了读心术 穿成炮灰渣妻后我和反派开农场 前任小姐姐帅又飒 弄潮1990从厂长开始 光阴之外 心动侵占 重回逃荒开端,手握空间来逆袭 重生之网红教父 蛮荒求生:反派大佬被迫种田 玄学大佬在星际重建地府 总裁又惹火夫人了 农门空间:重生娇娘撩糙汉 重生后我弃了天运之子 快穿:绑定系统后我疯狂崩人设 慕爷你虐错了夫人就是白月光 欢乐班 快穿之反派今天也在求负责 喜提娇夫:快穿作精她被迫崛起了 修真大佬都是我 唐人的餐桌 重生之大小姐她换了黑莲花剧本 重回九零做学霸 穿越星际之直播探险生活