惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
S
Securelist
P
Proofpoint News Feed
H
Help Net Security
S
Schneier on Security
T
Tenable Blog
C
Cisco Blogs
S
Security @ Cisco Blogs
博客园 - 司徒正美
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
Google Online Security Blog
Google Online Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
腾讯CDC
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
Vercel News
Vercel News
小众软件
小众软件
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
博客园 - 聂微东
F
Full Disclosure
量子位
Scott Helme
Scott Helme
宝玉的分享
宝玉的分享
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Schneier on Security
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
Kaspersky official blog
AI
AI
SecWiki News
SecWiki News
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler

博客园 - lbq1221119

时间同步算法与Simple Ring-based election algorithm算法分析 SSCLI中GC垃圾回收源码分析(3) - GarbageCollectGeneration()与SuspendEE SSCLI中GC垃圾回收源码分析(2) - GarbageCollect()与Spin Lock SSCLI中GC源码分析(1) - EE与BCL之间的调用接口FCall (北京宇思信德科技公司)诚聘C#软件工程师 , Middle及Senior Level .Net Micro framework在开发过程中的bugs/problems及解决方案。 MF中使用GPRS:如何通过一个串口终端实现GPRS Modem拨号上网 博客园北京俱乐部第三次活动讲义PPT ValueType.Equals(null)的底层实现及CLR虚拟机对其结构支持 WebService传输数据流及数据交互解析 托管线程退出之后Dump文件特征 国外精品研究论文(持续更新) Random()中具体实现(含种子数组的实现) From double Click to Main: PAL initialization - lbq1221119 From double Click to Main: The initialization of Process in OS Microsoft Micro Framework 3.0对Serial Peripheral Interface 的支持 使用CorDbg进行托管调试 CLR内核调试之:Malloc函数实现 MethodTable内存空间分配中加法运算算法解析
Build SSCLI20 under VS2008 full Document (完全手册)
lbq1221119 · 2008-11-12 · via 博客园 - lbq1221119

以前build过几次sscli2都成功了,这次换了个新的环境,没想到出了一大堆的问题。折腾了半天,最终搞定,把解决问题的过程和方法都记录下来。

首先说说build的过程中参考过的链接和资源。

1.         首先就是sscli自带的文档:Building the Shared Source CLI 2.0 and C# 2.0 Source Tree

\sscli20\docs\buildtools\building_sscli.html),这里详细介绍了build的过程,build中需要用到的工具和方法,等。

2.         Shared Source CLI 2.0 Build Environment Variable Scripts(env.bat, env.csh, env.sh)sscli20\docs\buildtools\env.html),详细介绍了设置环境变量和buildall等工具的参数设置。Build中用到的其它工具的参考说明可以到sscli20\docs\buildtools这个目录下找到。

3.         张羿的“.NET / Rotor 源码研究1 - Building Rotor”,链接地址为:

http://blog.csdn.net/ATField/archive/2006/12/31/1471465.aspx

4.         Jeremy Kuhne's “SSCLI 2.0 and Visual Studio 2008”,URL:

http://blogs.msdn.com/jeremykuhne/archive/2008/02/19/sscli-2-0-and-visual-studio-2008.aspx

5.         XwangVisual Studio 2008的环境下Build SSCLI 2.0(ROTOR),URL:

http://www.cnblogs.com/zhzkl/archive/2008/05/13/1194258.html

6.         Building SSCLI20 (Rotor) in VS2008,URL:

http://code.msdn.microsoft.com/BuildRotorInVS2008,by codekaizen

还有就是发现问题和解决问题的过程了.

首先,如果是需要再AMD的系列CPU上面Build,最好参考codekaizen提供的源码修改包。其正对AMDcpu再上面的4上面做了一些小的修改:

l  In the modified win.env.bat file, I added @set PROCESSOR_ARCHITECTURE=x86 to line 106 to get it to build under AMD64. The build environment was X86 already, but apparently it wasn't enough.

l  On line 144 of the modified tools\nmake\def.mak file, comment out #CFLAGS = $(CFLAGS) -Wp64, since the flag is deprecated.

l  This one didn't seem right, but it was the most expedient: comment out lines 73 to 79 in pal\exception.c, which is the declaration of a function RtlUnwind which is apparently never used or defined. It could be some platform specific call, which works on a Windows machine.

其中如果是再intelcpu上面,按照他说的commentTrlUnwind,会出现:

d:\rotor\sscli20\pal\win32\exception.c(143) : error C2094: label 'RtlUnwind' was undefined

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'

         这样的错误,这个时候,把他再pal\win32exception.c73行对

/*

WINBASEAPI

VOID

WINAPI

RtlUnwind(PVOID TargetFrame,

        PVOID TargetIp,

        PVOID ExceptionRecord,

        PVOID ReturnValue);

*/

的注释,去掉即可。

另外说说VC开发环境变量设置的问题。

修改sscli源码让其在VS2008下面运行的第一步,就是要修改MSVCDIRMSDEVDIR两个环境变量。在sscli20\docs\buildtools\env.html这个地方,可以看到MSVCDir的定义,指向的是:%VCINSTALLDIR%\VC,指向的是Microsoft Visual C++ 2005 root directory

如果不修改msvcdir变量,在env debug的时候,就会报出msvcdir没有设置的错误。

修改\sscli20\win.env.bat

1.         change %VS80COMNTOOLS% on line 37 to %VS90COMNTOOLS%

2.         after line 42, insert the following:

REM Set the SDK path

if "%ROTOR_WINSDKDIR%"=="" set ROTOR_WINSDKDIR=%WindowsSdkDir%

if "%ROTOR_WINSDKDIR%"=="" set ROTOR_WINSDKDIR=%MSVCDIR%\PlatformSDK

call :ShortName "%ROTOR_WINSDKDIR%"

set ROTOR_WINSDKDIR=%RESULT%

想这样因为环境变量引起的问题还挺多,可以参考Jeremy Kuhne的文章一一修改。另外,也可以看看上面的几个链接中他们在build的时候遇到的问题与解决方法。

Xwangblog上面把他的那个包给下载下来,然后直接覆盖到sscli,如果你出现code编码的保存方式不同造成的错误,请参考zhangyi的文章修改OSlocation。如果你出现不能正确识别操作系统的错误,也请参考zhangyi的那篇文章。如果你出现一些环境变量的莫名其妙的问题,请参考xwang的解决方法。

运行env debugbuildall

十分钟之后,build完成好了,就可以运行:

D:\Rotor\sscli20>cd binaries.x86dbg.rotor

D:\Rotor\sscli20\binaries.x86dbg.rotor>csc ..\samples\hello\hello.cs

Microsoft (R) Shared Source CLI C# Compiler version 2.0.0001

for Microsoft (R) Shared Source CLI version 2.0.0

Copyright (C) Microsoft Corporation. All rights reserved.

D:\Rotor\sscli20\binaries.x86dbg.rotor>clix hellp.exe

hellp.exe: The system cannot find the file specified.

D:\Rotor\sscli20\binaries.x86dbg.rotor>clix hello.exe

Hello World!

Enjoy Rotor, Enjoy Code, and Enjoy research! Have fun!

Lbq1221119@cnblogs, first post at http://sscli.cnblogs.com

11/11/2008 9:42 PM