[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8811.0. "ld -L generatin error "mmap failure no such device" ?" by BACHUS::SABLON (Mich�le Sablon, TP/IM Support Belgium 856-7238) Wed Feb 12 1997 12:18

OSF V3.2-D

A customer reports me that, while building a C/Oracle application, the link
fails with error "mmap failre no such device". The link of programs not using
Oracle is also failing this way.

I looked for such link of error and didn't find a lot that would be applicable
in such context. But I've found a small remark in a problem description telling
that the customer identifies the cause of such problem to be the -L option
(without directory specification).

I asked the customer to check the link command (it is generated in a Makefile
using all kinds of flags) for such. The link command effectively contains
several time this option. By removing it, the link runs successfully.

Is this a known problem ? Bad usage of the switch ?

Also, while trying to find out at which stage the link was failing, I found
notes referring to the option -Wl. This seems not to be known or improperly
used. It is also not documented. Any hint about it ?

Thanks in advance,
Mich�le.
T.RTitleUserPersonal
Name
DateLines
8811.1Read cc man page for -W optionSUBPAC::FARICELLIWed Feb 12 1997 13:139
   Look in the cc man page for the -W option. It can be used to pass
   arguments to specific phases of the compilation. -Wl is used to
   pass arguments to the linker (ld) from the cc command.

   -Wc[c...],arg1,[arg2...]
      Pass the argument, or arguments, argi to the compiler pass, or passes...

   -- John Faricelli
8811.2QUARRY::nethCraig NethWed Feb 12 1997 13:1540
>Is this a known problem ? 

No.  The linker uses mmap to read in the libraries and objects that are being
linked.  If one of them cannot be opened (because of a bad path specification, 
for instance), then you may get an error that mentions 'mmap failure' as part 
of the error text.   Without more details (like the exact link command line
and the exact error text) it is not possible to determine whether or not
there is a possible linker bug or just improper usage of the tool.

>Bad usage of the switch ?

The -L switch (with no following directory specification) has the following
description (from the ld(1) man page):

  -L  Change the library directory search order for shared object and archive
      libraries (libx.{so|a}) and ucode object libraries (libx.b) so that ld
      never looks for them in the default library directories.  Use this
      option when the default library directories should not be searched and
      only the directories specified by -Ldir are to be searched.

Since we don't know how the customer is using the switch it is impossible
to know whether or not the usage is correct.    However, I guess it would
be fair to say that it is 'unusual' to need to use this switch in most
circumstances - generally you want to link with the default libraries.

>Also, while trying to find out at which stage the link was failing, I found
>notes referring to the option -Wl. This seems not to be known or improperly
>used. It is also not documented. Any hint about it ?

The -W options are documented (somewhat) on the cc(1) man page.  Basically,
the cc(1) command is a 'driver' that coordinates the actions of other tools
(like the actual compiler image, and the linker, etc).   The -W switches are
used to pass options directly to the underlying tools.  In particular, -Wl is 
used to pass options directly to the linker (i.e. no other tools on the 
command line will get passed this option, nor will the cc driver try to 
interpret it).

Hope this helps,

Craig
8811.3Thanks, I'll look furtherBACHUS::SABLONMich�le Sablon, TP/IM Support Belgium 856-7238Fri Feb 14 1997 04:2611
Thanks to both of you.

About the -Wl I probably misunderstood the note. I though it was a ld switch
which would give me details about what the linker was doing. More that what -v
was giving, i.e. nothing.

About the problem it-self, I'll take contact back with the customer and try to
have more complete information about what he is doing.

May be back sometimes,
Mich�le.