Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Porting issue: 32 to 64 bit pointer conversions
@ 2000-10-06 12:45 Robert Williams
  2000-10-06 15:26 ` Niki W. Waibel
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Williams @ 2000-10-06 12:45 UTC (permalink / raw)
  To: axp-list

I'm trying to port malsync ( http://www.tomw.org/malsync/ )
to the alpha.  There appear to be some 64 bit issues.
The distributed code doesn't work on alpha.

My question:
What is the best way to handle
64 bit pointer to 32 bit integer conversions:

The complaint:

MAL31DBConfig.c: In function `MAL31DBConfigWriteData':
MAL31DBConfig.c:68: warning: cast from pointer to integer of different
size

The code:

65       count = AGArrayCount(dbconfig->newids);
66        AGWriteCompactInt(w, count);
67        for(i = 0; i < count; i++)
68              AGWriteInt32(w, (uint32)(this is a
long)AGArrayElementAt(dbconfig->newids, i));

Bob Williams





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

* RE: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 12:45 Porting issue: 32 to 64 bit pointer conversions Robert Williams
@ 2000-10-06 15:26 ` Niki W. Waibel
  2000-10-06 16:01   ` Robert Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Niki W. Waibel @ 2000-10-06 15:26 UTC (permalink / raw)
  To: Robert Williams; +Cc: axp-list

hi,

i am currently porting glidev2.
there are also a lot of troubles with pointer <-> int conversions.
i defined
  __64BIT_POINTER
and
  __64BIT_LONG
for the compilation on alpha.
(you have to pass -D__64BIT_POINTER and -D__64BIT_LONG to gcc).

then i compiled - checked where the warnings came from and inserted
#ifndef __64BIT_POINTER
   /* old (32bit) code */
#else
   /* new (64bit) code */
#endif
this way the programm compiles normal on 32bit cpus and with the new code
on 64bit cpus.
the __64BIT_LONG is defined because for example on sparc cpus
long is 32 bit and 'long long' is 64bit.
on alpha: long = 64bit and 'long long' is also 64bit.

hope this helps, niki


On 06-Oct-00 Robert Williams wrote:
> I'm trying to port malsync ( http://www.tomw.org/malsync/ )
> to the alpha.  There appear to be some 64 bit issues.
> The distributed code doesn't work on alpha.
> 
> My question:
> What is the best way to handle
> 64 bit pointer to 32 bit integer conversions:
> 
> The complaint:
> 
> MAL31DBConfig.c: In function `MAL31DBConfigWriteData':
> MAL31DBConfig.c:68: warning: cast from pointer to integer of different
> size
> 
> The code:
> 
> 65       count = AGArrayCount(dbconfig->newids);
> 66        AGWriteCompactInt(w, count);
> 67        for(i = 0; i < count; i++)
> 68              AGWriteInt32(w, (uint32)(this is a
> long)AGArrayElementAt(dbconfig->newids, i));
> 
> Bob Williams




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 15:26 ` Niki W. Waibel
@ 2000-10-06 16:01   ` Robert Williams
  2000-10-06 16:12     ` Chris Eleveld (Sector 7 Group)
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Williams @ 2000-10-06 16:01 UTC (permalink / raw)
  To: Niki W. Waibel; +Cc: axp-list

What about the -taso option
using the Compaq ccc compiler?
Does anyone have experience using
-taso to port 32 bit code?

            " The -taso option, however, in addition  to  setting
              default  addresses for text and data segments, also
              causes shared libraries linked outside  the  31-bit
              address  space to be appropriately relocated by the
              loader. "

Bob Williams

"Niki W. Waibel" wrote:

> hi,
>
> i am currently porting glidev2.
> there are also a lot of troubles with pointer <-> int conversions.
> i defined
>   __64BIT_POINTER
> and
>   __64BIT_LONG
>
>
> On 06-Oct-00 Robert Williams wrote:
>
> > What is the best way to handle
> > 64 bit pointer to 32 bit integer conversions:
>




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 16:01   ` Robert Williams
@ 2000-10-06 16:12     ` Chris Eleveld (Sector 7 Group)
  2000-10-06 17:09       ` Michal Jaegermann
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Eleveld (Sector 7 Group) @ 2000-10-06 16:12 UTC (permalink / raw)
  To: axp-list

	In my employment we have relied heavilly on the taso option to port
code from 32bit VMS to tru64.  It works great, However my understanding was
that ccc on alpha linux does not support -taso.  Even if it does what you
really need support for is the -xtaso and -xtaso_short to force 32 bit
pointers and to allow a 32bit pointer to make it easy otherwise you have
to deal with alignments and structure sizing issues.

On Fri, Oct 06, 2000 at 11:01:07AM -0500, Robert Williams wrote:
> What about the -taso option
> using the Compaq ccc compiler?
> Does anyone have experience using
> -taso to port 32 bit code?
> 
>             " The -taso option, however, in addition  to  setting
>               default  addresses for text and data segments, also
>               causes shared libraries linked outside  the  31-bit
>               address  space to be appropriately relocated by the
>               loader. "
> 
> Bob Williams
> 
> "Niki W. Waibel" wrote:
> 
> > hi,
> >
> > i am currently porting glidev2.
> > there are also a lot of troubles with pointer <-> int conversions.
> > i defined
> >   __64BIT_POINTER
> > and
> >   __64BIT_LONG
> >
> >
> > On 06-Oct-00 Robert Williams wrote:
> >
> > > What is the best way to handle
> > > 64 bit pointer to 32 bit integer conversions:
> >
> 
> 
> 
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 16:12     ` Chris Eleveld (Sector 7 Group)
@ 2000-10-06 17:09       ` Michal Jaegermann
  2000-10-06 18:31         ` Matt Wilson
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Michal Jaegermann @ 2000-10-06 17:09 UTC (permalink / raw)
  To: axp-list

"Chris Eleveld (Sector 7 Group)" wrote:
> 
> 	In my employment we have relied heavilly on the taso option to port
> code from 32bit VMS to tru64.  It works great,

It is a hack which provides a workaround for a broken code.

> However my understanding was
> that ccc on alpha linux does not support -taso.

The current versions of binutils (I mean the current, not old stuff
from Red Hat releases) do have a -taso switch for a loader so you can
probably make it work with any compiler.  I did not try that myself.

  Michal




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 17:09       ` Michal Jaegermann
@ 2000-10-06 18:31         ` Matt Wilson
  2000-10-06 20:20         ` Robert Williams
  2000-10-07 16:15         ` Brad Lucier
  2 siblings, 0 replies; 10+ messages in thread
From: Matt Wilson @ 2000-10-06 18:31 UTC (permalink / raw)
  To: axp-list

Red Hat Linux 7/Alpha will have binutils-2.10.0.18, which includes
-taso.

Matt

On Fri, Oct 06, 2000 at 11:09:57AM -0600, Michal Jaegermann wrote:
> 
> The current versions of binutils (I mean the current, not old stuff
> from Red Hat releases) do have a -taso switch for a loader so you can
> probably make it work with any compiler.  I did not try that myself.




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 17:09       ` Michal Jaegermann
  2000-10-06 18:31         ` Matt Wilson
@ 2000-10-06 20:20         ` Robert Williams
  2000-10-06 21:28           ` Matt Wilson
  2000-10-06 21:47           ` Michal Jaegermann
  2000-10-07 16:15         ` Brad Lucier
  2 siblings, 2 replies; 10+ messages in thread
From: Robert Williams @ 2000-10-06 20:20 UTC (permalink / raw)
  To: axp-list

Michal Jaegermann wrote:

>
> The current versions of binutils (I mean the current, not old stuff
> from Red Hat releases) do have a -taso switch for a loader so you can
> probably make it work with any compiler.  I did not try that myself.

Are you sure?
"info ld", "man ld", etc don't show a -taso switch.  I have:
binutils-2.9.5.0.22-8
The most recent is 2.10.
A search of the ld docs for 2.10 doesn't turn up a -taso:
http://sources.redhat.com/binutils/docs-2.10/ld_2.html#IDX58

Bob Williams





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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 20:20         ` Robert Williams
@ 2000-10-06 21:28           ` Matt Wilson
  2000-10-06 21:47           ` Michal Jaegermann
  1 sibling, 0 replies; 10+ messages in thread
From: Matt Wilson @ 2000-10-06 21:28 UTC (permalink / raw)
  To: axp-list

[msw@pitr msw]$ ld -v
GNU ld version 2.10.90 (with BFD 2.10.0.18)
[msw@pitr msw]$ ld --help | grep taso
  -taso		   Load executable in the lower 31-bit addressable

Cheers,

Matt

On Fri, Oct 06, 2000 at 03:20:19PM -0500, Robert Williams wrote:
> Michal Jaegermann wrote:
> 
> >
> > The current versions of binutils (I mean the current, not old stuff
> > from Red Hat releases) do have a -taso switch for a loader so you can
> > probably make it work with any compiler.  I did not try that myself.
> 
> Are you sure?
> "info ld", "man ld", etc don't show a -taso switch.  I have:
> binutils-2.9.5.0.22-8
> The most recent is 2.10.
> A search of the ld docs for 2.10 doesn't turn up a -taso:
> http://sources.redhat.com/binutils/docs-2.10/ld_2.html#IDX58




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 20:20         ` Robert Williams
  2000-10-06 21:28           ` Matt Wilson
@ 2000-10-06 21:47           ` Michal Jaegermann
  1 sibling, 0 replies; 10+ messages in thread
From: Michal Jaegermann @ 2000-10-06 21:47 UTC (permalink / raw)
  To: axp-list

Robert Williams wrote:
> 
> Michal Jaegermann wrote:
> 
> >
> > The current versions of binutils (I mean the current, not old stuff
> > from Red Hat releases) do have a -taso switch for a loader so you can
> > probably make it work with any compiler.  I did not try that myself.
> 
> Are you sure?
> "info ld", "man ld", etc don't show a -taso switch.  I have:
> binutils-2.9.5.0.22-8

Which, obviously, is quite old.  Quoting myself from the above
"not old stuff from Red Hat releases".

> The most recent is 2.10.

2.10.0.26 to be more precise.

As Matt Wilson mentioned in this thread 2.10.0.18, which will
show up in Red Hat 7, will have this switch.  But you may, obviously,
grab even newer sources from the net.

   Michal




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

* Re: Porting issue: 32 to 64 bit pointer conversions
  2000-10-06 17:09       ` Michal Jaegermann
  2000-10-06 18:31         ` Matt Wilson
  2000-10-06 20:20         ` Robert Williams
@ 2000-10-07 16:15         ` Brad Lucier
  2 siblings, 0 replies; 10+ messages in thread
From: Brad Lucier @ 2000-10-07 16:15 UTC (permalink / raw)
  To: axp-list

> 
> "Chris Eleveld (Sector 7 Group)" wrote:
> > 
> > 	In my employment we have relied heavilly on the taso option to port
> > code from 32bit VMS to tru64.  It works great,
> 
> It is a hack which provides a workaround for a broken code.
> 
> > However my understanding was
> > that ccc on alpha linux does not support -taso.
> 
> The current versions of binutils (I mean the current, not old stuff
> from Red Hat releases) do have a -taso switch for a loader so you can
> probably make it work with any compiler.  I did not try that myself.

A few months ago I submitted some patches to the development gcc
that implemented an -mtaso switch for alpha (architecture-specific options
in gcc begin with -m); this relied, of course, on -taso support in -ld.
For me, it was a way to have a lisp heap take 1/2 the space it would
otherwise take, so it wasn't quite "a hack which provides a workaround for
broken code".

It worked, but was ugly.  It was so ugly that it wasn't incorporated into
the sources.  Perhaps someone else would like to try to improve it.

Brad Lucier




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

end of thread, other threads:[~2000-10-07 16:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-06 12:45 Porting issue: 32 to 64 bit pointer conversions Robert Williams
2000-10-06 15:26 ` Niki W. Waibel
2000-10-06 16:01   ` Robert Williams
2000-10-06 16:12     ` Chris Eleveld (Sector 7 Group)
2000-10-06 17:09       ` Michal Jaegermann
2000-10-06 18:31         ` Matt Wilson
2000-10-06 20:20         ` Robert Williams
2000-10-06 21:28           ` Matt Wilson
2000-10-06 21:47           ` Michal Jaegermann
2000-10-07 16:15         ` Brad Lucier

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