32-bit code with gcc


 
Thread Tools Search this Thread
Top Forums Programming 32-bit code with gcc
# 1  
Old 06-22-2004
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
# 2  
Old 06-22-2004
Looking at the gcc man page, I see
Code:
      -m32
      -m64
          Generate code for a 32-bit or 64-bit environment.  The 32-bit
          environment sets int, long and pointer to 32 bits.  The 64-bit
          environment sets int to 32 bits and long and pointer to 64 bits.

So maybe -m32 is needed. But I don't use gcc so I'm not sure.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

64 bit code debugging using gdb and ddd

Hello I have built our application on AIX 7.1 as a 64 bit application. My queries are as follows: Can a 32bit gdb (v7.6) and ddd (data display debugger - v3.3.12), debug a 64bit executable ? If I have a small 64bit a.exe executable that seems to work. If I have a more complicated executable... (4 Replies)
Discussion started by: biju64
4 Replies

2. Programming

C code 1ULL and bit calculation

I found this block of C code to create combinations of A, T, C & G characters (DNA bases). Can anybody explain this code for me, especially with 1ULL<< and ? 16 for (x = 0; x < 1ULL << (2 * k); ++x) 17 { 18 for (i = 0, y = x; i < k; ++i, y >>= 2) 19 putchar ("ACGT"); 20 }... (3 Replies)
Discussion started by: yifangt
3 Replies

3. UNIX for Dummies Questions & Answers

Trying to understand a complex bit of code

Hi, To re-introduce myself, I'm a router guy trying to learn some scripting from the examples in my work place... In a ksh script, one of the script guys wrote the following and I am trying to understand it. I'm hoping someone can explain it to me. The script flow enters a case structure.... (5 Replies)
Discussion started by: Marc G
5 Replies

4. Shell Programming and Scripting

Learning - Why does this bit of code fail

In bash: for i in 1 2 3 4 5 do tmp_${i}=$i echo $i done It gives error on executing tmp_1=1, and so on... Why? If I executed this in prompt, not from script, it shouldn't make a subshell should it? please use "code" tags! thanks... (2 Replies)
Discussion started by: StuartH
2 Replies

5. Solaris

Porting C++ 32-bit code on 64-bit Solaris

Hi, I am trying to convert 32-bit code to 64-bit. I have defined function int main() { int* l; size_t len1; fun(len1); return 0; } void fun(int* ptr) { cout<<"\nsizeof(ptr)"<<sizeof(ptr); } However while compiling getting error as : Error: Formal argument ptr... (2 Replies)
Discussion started by: amit_27
2 Replies

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

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

8. Programming

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... (6 Replies)
Discussion started by: dhanamurthy
6 Replies

9. UNIX for Advanced & Expert Users

Migrating perl code from 32 to 64 bit OS

Hello all, I am migrating perl code from 32-bit Solaris 2.5 to 64-bit Solaris 9. On which part of code should I concentrate? And please suggest if there is any checklist for the same. Thanks in advance, Devesh. (3 Replies)
Discussion started by: devesh
3 Replies

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