🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53263

Re: On SunOS4, how to avoid _dlclose, etc?

#53263
From: david d 'zoo' zuhn
Date: Sat, 22 Feb 1992 05:13
46 lines
2315 bytes
>> I am trying to compile a program using gcc.  The -static option
>> seems not be working for me.  I get the message "Undefined symbol:
>> _dlclose, _dlopen, _dlsym".  These symbols are used in libc.a.

>> Anybody knows how I can avoid this problem? Thanks in advance.

This is a bug in SunOS.  There is a standard fix in the MIT X11R5
source tree as mit/util/misc/dlsym.c, which I appended to this
message.  Just compile and link against this file and all will be well
(at least this bug will be fixed, no comment on any other bugs you
might have).

david d [zoo] zuhn		Univ. of Minnesota Dept. of Astronomy
zoo@aps1.spa.umn.edu		      Automated Plate Scanner Project
 -- member of the League for Programming Freedom -- email me for info


------ slice 'n dice ----------
/*
 * Stub interface to dynamic linker routines
 * that SunOS uses but didn't ship with 4.1.
 *
 * The C library routine wcstombs in SunOS 4.1 tries to dynamically
 * load some routines using the dlsym interface, described in dlsym(3x).
 * Unfortunately SunOS 4.1 does not include the necessary library, libdl.
 *
 * The R5 Xlib uses wcstombs.  If you link dynamcally, your program can
 * run even with the unresolved reference to dlsym.  However, if you
 * link statically, you will encounter this bug.  One workaround
 * is to include these stub routines when you link.
 */

void *dlopen()
{
    return 0;
}

void *dlsym()
{
    return 0;
}

int dlclose()
{
    return -1;
}
Technical Details
Message-ID: <ZOO.92Feb21231324@lynx.spa.umn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!aps1.spa.umn.edu!zoo
References: <DXZ.92Feb21162429@bishop.ics.hawaii.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,c2892d3e4634777c
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-02-21 23:18:14 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!aps1.spa.umn.edu!zoo
From: zoo@aps1.spa.umn.edu (david d 'zoo' zuhn)
Newsgroups: gnu.gcc.help
Subject: Re: On SunOS4, how to avoid _dlclose, etc?
Message-ID: <ZOO.92Feb21231324@lynx.spa.umn.edu>
Date: 22 Feb 92 05:13:24 GMT
Article-I.D.: lynx.ZOO.92Feb21231324
References: <DXZ.92Feb21162429@bishop.ics.hawaii.edu>
Sender: news@news2.cis.umn.edu (Usenet News Administration)
Distribution: gnu
Organization: Hackers 'R' Us
Lines: 46
In-Reply-To: dxz@bishop.ics.hawaii.edu's message of 22 Feb 92 02:24:29 GMT
X-Md4-Signature: b0ee5dbabf48a87423a8b5839423aeb2
Nntp-Posting-Host: lynx.spa.umn.edu