Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* gcc/egcs flags to turn off 64bit code generation?
@ 1999-01-13  5:00 Sanjay Lal
  1999-01-13  5:00 ` Serguei Patchkovskii
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sanjay Lal @ 1999-01-13  5:00 UTC (permalink / raw)


I have several large pieces of code that are not 64 bit clean.
Unfortunately, I do not have
the time to do a proper port.  I was wondering if gcc or egcs supported a 32
bit mode
similar to Digital's C/C++ compilers?

Regards and thanks
Sanjay
sanjayl@home.com






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcc/egcs flags to turn off 64bit code generation?
  1999-01-13  5:00 gcc/egcs flags to turn off 64bit code generation? Sanjay Lal
  1999-01-13  5:00 ` Serguei Patchkovskii
@ 1999-01-13  5:00 ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
  1999-01-14  5:00 ` Georg Acher
  2 siblings, 0 replies; 5+ messages in thread
From: His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated @ 1999-01-13  5:00 UTC (permalink / raw)


>>>>> "SL" == Sanjay Lal <sanjayl@home.com> writes:

    SL> I was wondering if gcc or egcs supported a 32 bit mode similar
    SL> to Digital's C/C++ compilers?

Nope.  As annoying as it it sometimes, this was done on purpose.  In
fact, if I recall correctly, the linker automatically puts everything
in the upper half of the address space (above 7FFF FFFF FFFF FFFF?),
so clobbered pointers and whatnot should segfault immediately.

If you don't get a better answer here, ask on axp-list@redhat.com.
The gurus there (like Richard Henderson) should be able to give you a
better response.

-- 
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
"When I was a kid, I used to think that Dammit was God's last name, just like
Christ is Jesus' last name." - Kimberly Chapman in rec.humor.oracle.d



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcc/egcs flags to turn off 64bit code generation?
  1999-01-13  5:00 gcc/egcs flags to turn off 64bit code generation? Sanjay Lal
@ 1999-01-13  5:00 ` Serguei Patchkovskii
  1999-01-17  5:00   ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
  1999-01-13  5:00 ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
  1999-01-14  5:00 ` Georg Acher
  2 siblings, 1 reply; 5+ messages in thread
From: Serguei Patchkovskii @ 1999-01-13  5:00 UTC (permalink / raw)


Sanjay Lal (sanjayl@home.com) wrote:
: the time to do a proper port.  I was wondering if gcc or egcs supported a 32
: bit mode similar to Digital's C/C++ compilers?

The -taso mode supported by Digital C is not really a 32-bit mode. The
only thing it does is to force all your code and data segments (including
anything coming from shared libs) to be located in the lower 31 bits of
the address space, which hides pointer truncation errors upon conversion
to an integer. Apart from this, it is identical to the regular 64-bit
compilation. At least for statically linked executables, you should be
able to achieve a similar effect using appropriately small settings for 
-T{bss|data|text} ld options.

/Serge.P



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcc/egcs flags to turn off 64bit code generation?
  1999-01-13  5:00 gcc/egcs flags to turn off 64bit code generation? Sanjay Lal
  1999-01-13  5:00 ` Serguei Patchkovskii
  1999-01-13  5:00 ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
@ 1999-01-14  5:00 ` Georg Acher
  2 siblings, 0 replies; 5+ messages in thread
From: Georg Acher @ 1999-01-14  5:00 UTC (permalink / raw)



In article <3H1n2.562$B21.116@news.rdc1.nj.home.com>, "Sanjay Lal" <sanjayl@home.com> writes:
|> I have several large pieces of code that are not 64 bit clean.
|> Unfortunately, I do not have
|> the time to do a proper port.  I was wondering if gcc or egcs supported a 32
|> bit mode
|> similar to Digital's C/C++ compilers?

Depending on the portability problems, some adaptions can be made very quickly:
If there are any long-declarations in the source, you should change them to int,
that fixes most inter-architecture-communication problems. If there are
data structures for callbacks/function pointers and they are declared as
an int, you can change them to long (64bit). I've managed to port some bigger
programs (eg. gimp<0.99.12) with these simple rules and some manual work...

-- 
	Bye
         Georg Acher, acher@in.tum.de         
         http://www.in.tum.de/~acher/
          "Oh no, not again !" The bowl of petunias          



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcc/egcs flags to turn off 64bit code generation?
  1999-01-13  5:00 ` Serguei Patchkovskii
@ 1999-01-17  5:00   ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
  0 siblings, 0 replies; 5+ messages in thread
From: His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated @ 1999-01-17  5:00 UTC (permalink / raw)


>>>>> "SP" == Serguei Patchkovskii <patchkov@acs1.acs.ucalgary.ca> writes:

    SP> At least for statically linked executables, you should be able
    SP> to achieve a similar effect using appropriately small settings
    SP> for -T{bss|data|text} ld options.

What about pointers and whatnot returned from library or system calls,
such as malloc(3) or sbrk(2)?  I was under the impression that DEC
CC's -taso did funky stuff with the return values from the system
libraries, in addition to relocating the executable.

-- 
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
"When I was a kid, I used to think that Dammit was God's last name, just like
Christ is Jesus' last name." - Kimberly Chapman in rec.humor.oracle.d



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-01-17  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-13  5:00 gcc/egcs flags to turn off 64bit code generation? Sanjay Lal
1999-01-13  5:00 ` Serguei Patchkovskii
1999-01-17  5:00   ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
1999-01-13  5:00 ` His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
1999-01-14  5:00 ` Georg Acher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox