64-Bit gcc Compilation


 
Thread Tools Search this Thread
Top Forums Programming 64-Bit gcc Compilation
# 1  
Old 06-26-2008
64-Bit gcc Compilation

Hi All
I have a question on the compilation

Assume i am working on 64 bit Linux OS.

i am making shared objects and libraries required for our project.
Can i compile 32 bit libraries using gcc of 64 -bit OS?

Or
Is there any restriction in the 32-bit or 64-bit compilers when trying to link 32-bit libraries.

Let me know if i am not clear.

Regards
Dhana
# 2  
Old 07-01-2008
it depends on M/c Arch.
# 3  
Old 07-01-2008
Yes. -m32.
But let linker know a location of 32-bits libraries (you even might not have them installed yet).
# 4  
Old 07-04-2008
I doubt how will you run a 32 bit file in 64 bit arch ?
or is this just compiling ?
# 5  
Old 07-04-2008
Once you have all required 32-bit libraries you can run 32-bits executable on 64-bit OS.
Well-know example is skype.
# 6  
Old 07-08-2008
How to dynamically modify the Library path in that case ?
# 7  
Old 07-09-2008
Depends on your OS.

For Linux the simplests way is to set LD_LIBRARY_PATH.
For example
export LD_LIBRARY_PATH=/lib32:/usr/lib32
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Gcc compilation problem on AIX 6.1

Hi, I have to compile a program on my server, runs on AIX 6.1. On my test server the compilation is ok (AIX 6.1); but when I try it on production server, I have this gcc prog.c -o prog_out In file included from resmon.c:111: /usr/include/unistd.h:924: error: expected ')' before ' I noticed... (1 Reply)
Discussion started by: tnjulius
1 Replies

2. Programming

Header file compilation using gcc in Sparc Solaris

I am facing problem while migrating the c++ code from Linux to Solaris. In linux the code is absolutly compiled fine with GCC compiler but when i am using the same in Solaris it coomplains bash-3.1$ gcc LibSip.h gcc: Compilation of header file requested The same command is working fine in... (2 Replies)
Discussion started by: mrupesh74
2 Replies

3. Solaris

Solaris 10 and 64 bit apache/openssl/gcc

I installed Solaris 10 on a v440. I installed v3.4.6 gcc from Sun Freeware. I was considering installing 64 bit Apache/Openssl and wondered if people encountered any problems with it. What config parameters did you have to compile openssl and apache? Thank you (3 Replies)
Discussion started by: csross
3 Replies

4. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

5. Solaris

Compilation on SunOs5.7 using gcc 3.3.5

I have the following declaration in file named vx_solaris.h (Path : /usr/share/src/tpkgs/veritas/solaris_sparc/include/sys/fs/vx_solaris.h) typedef (*vx_creatfptr_t)(struct vnode *, char *, struct vattr *, vcexcl_t, int, struct vnode **, vx_cred_t *, int); I include vx_solaris.h in one of... (5 Replies)
Discussion started by: amitc
5 Replies

6. Programming

compilation error in gcc

Hi, Should be too simple... I wrote a sample c++ program like #include <iostream.h> int main() {$ int ab=455; cout << ab << endl; return 1; } I am getting error like $ gcc u1.cpp Undefined first referenced ... (9 Replies)
Discussion started by: ls1429
9 Replies

7. Programming

gcc compilation

how can i do static compilation in gcc my gcc version is # gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u sr/share/info --enable-shared --enable-threads=posix --disable-checking... (3 Replies)
Discussion started by: collins
3 Replies

8. Programming

32-bit code with gcc

I want to create a 32 bit shared library. I am using following commands 1. gcc -c test1.c 2. ld -b test1.o -o test1.sl But this creates 64 bit shared library. Unix version of the server on which I am working is HP-UX 11.11 (1 Reply)
Discussion started by: amol.chavan
1 Replies

9. UNIX for Advanced & Expert Users

64 bit file using gcc

Hi, I am compiling a C program using gcc. gcc -c test.c The OS is Solaris 2.8 (64 bit). We dont have cc compiler on the box. When I do a file test.o , I get this: test.o: ELF 32-bit MSB relocatable SPARC Version 1 In one of my scripts I need a 64 bit object file. Is it... (1 Reply)
Discussion started by: nattynatty
1 Replies
Login or Register to Ask a Question