Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Joe Mario <mario>
To: rep@icd.ab.com
Subject: Re: Help with migrate flag...
Date: 1996/01/25	[thread overview]
Message-ID: <4e92u0$1ef@zk2nws.zko.dec.com> (raw)
In-Reply-To: 4e0m7a$ajl@news1.cle.ab.com

> Ok back in Digital OSF1 2.0 I found a bug in the compiler...
> The workaround was to use the -migrate flag... (Its really a different
> compiler) so now I'm at 3.2d and the compiler is still broken...
> and now the -migrate flag produces objects that are version 3.12
> and ld is at version 3.11 and it complains and no longer builds
> my share able object...

Since cc -migrate really is a different compiler than cc, we began
marking the objects differently in order to tell which compiler built
a given object file.  Beginning with Digital UNIX 3.2c, -migrate
began producing objects with a file version of 3.12.

This has no impact on building shared libraries.  You can build shared
libraries with 3.11 or 3.12 objects.  If you specify -v to the linker it
does inform you that the object version is 3.12 but that is informational
only.  Also note that any file produced by the linker has a 3.11 version
stamp on it, regardless of the versions of the input files.

You don't mention how you tried building the shared library.  If you're
using "cc -shared" then that is probably your shared library problem.  
For all releases of Digital UNIX shipped to date, shared libraries can 
only be created by calling ld directly (ie: ld -shared ...).
Trying to create a shared library with "cc -shared ..." will not work.

We've fixed this in the soon-to-be-released Digital UNIX V4.0.  In 4.0
you can use "cc -shared" to create shared libraries.

Concerning the compiler bug you mention, the wrong output comes from the
fact that the program has short pointers pointing to unaligned short data.
Some options to try are:

        1) Use the __unaligned keyword.  This tells the compiler to
           assume the pointer is pointing to unaligned data.
           In your program the source would change to
                 unsigned __unaligned short *sptr;
           See the Digital UNIX Programmer's Guide for more on this.

        2) Compile with the -misalign command line switch.  This is like
           using a sledge hammer.  It will work but since it tells the
           compiler to not trust the alignment of any of the pointers
           performance will really suffer.  See the cc(1) manpage for
           more on this.

Joe Mario
DEC C compiler.




      reply	other threads:[~1996-01-25  5:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-22  5:00 Help with migrate flag Robert E. Pappenhagen
1996-01-25  5:00 ` Joe Mario [this message]
read-only archive

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