开发者

How to build old source code with latest GCC?

I am trying to build the OSKit source code. It is orginally written against gcc 2.95.2, but on my box I got gcc 4.3.2. And 4.3.2 doesn't allow the following syntax:

 asm volatile("
  pushfl
  popl %0" : "=r" (eflags));
 return eflags;

4.3.2 always complains that:

error: missing terminating " character

There're so many syntax like this, is there a way to let the 4.3.2 accept this? Or is there a more general way to let the 4.3.2 behave like 2.95.2? Or where could I download the 2.95.2 version of gcc?

Thanks!

Update

My real aim is to build the OSKit. OSKit claims to be compilabe with GCC 2.7.x or 2.95.2. My Ubuntu开发者_如何学C 8.10 is installed with GCC 4.3.2.

I tried the following compiling sequences:

4.3.2 build 2.95.2 --- failed

4.3.2->3.3.6->2.7.2.3 --- success.

4.3.2 -> 2.7.2.3 --- success

3.3.6 -> 2.95.2 --- failed

Though I still don't have 2.95.2, I got 2.7.2.3 at least.

But the OSKit is still broken with 2.7.2.3...

Currently I don't know what to do... :(

Could anyone give me some advice? @_@


You could download here: http://ftp.gnu.org/gnu/gcc/

The most correct way is to download the old version and install in a directory outside of your PATH.

The GCC has changed much from version 2 to 4 ...


I believe that you need something like:

 asm volatile("pushfl\n\t"
              "popl %0"
              : "=r" (eflags)
             );
 return eflags;

Ref: GCC-Inline-Assembly-HOWTO

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜