|
|
 |
 |
 |
 |
Fortran Programming Language
|
 |
 |
 |
 |
 |
 |
 |
 |
how to compile code on linux(32bit) for linux(64bit)
I am trying to create a shared library file of 64bit for linux. but the problem is i have to compile its source on 32 bit linux. i am using option -m64 for the same but it is not workig. can anyone suggest me wht other option are availabe and also wht option should be used for ld flags. please reply soon
On 9 mei, 08:08, isanja@gmail.com wrote: > I am trying to create a shared library file of 64bit for linux. but > the problem is i have to compile its source on 32 bit linux. > i am using option -m64 for the same but it is not workig. > can anyone suggest me wht other option are availabe and also wht > option should be used for ld flags. > please reply soon
You will have to be specific about what cross-compiler you are using as well as what the target platform is. Merely stating that the option -m64 does not work is not enough. Consider this: - A lot of compilers will have no such option (they might call it differently or do not have the facility at all) - When a compiler running on Linux 32-bits does know how to compile for "a" Linux 64-bits system, it will probably need to know what processor this target system has. Regards, Arjen
> I am trying to create a shared library file of 64bit for linux. but > the problem is i have to compile its source on 32 bit linux. > i am using option -m64 for the same but it is not workig.
It would help to know what compiler (or cross-compiler). While most native compilers for x86_64 systems can generate 32bit code by using an appropriate switch (-m32 being the switch for the GCC family), I don't think that the other way around is true. You need either a) a 32bit compiler with a working -m64 or b) a cross-compiler from 32bit to 64bit. As you don't say what your compiler is, I'll just state what the situation is for GCC (including gfortran). Option (b) is known to work very well, but AFAIK there aren't any binaries for such compilers provided, so you'll have to build your own (or find someone who would do that for you). Option (a) was not possible a few months back, but I think it is now working if you build your compiler yourself, and configure it with the --enable-all-targets option. A bit of Google for this option and asking the gcc-h@gcc.gnu.org mailing-list will probably get you there. -- FX
In article <f1rtep$94 @nef.ens.fr>, FX <coud @alussinan.org> wrote: >It would help to know what compiler (or cross-compiler). While most >native compilers for x86_64 systems can generate 32bit code by using an >appropriate switch (-m32 being the switch for the GCC family), I don't >think that the other way around is true. The PathScale compilers can generate 64-bit code on a 32-bit system -- we ship a single 32-bit compiler used for both -- but your binutils on your 32-bit system are unlikely to be up to the task of assembling the resulting output. -- greg
|
 |
 |
 |
 |
|