简体   繁体   中英

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 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? @_@

I believe that you need something like:

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

Ref: GCC-Inline-Assembly-HOWTO

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 ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM