SUMMARY: compiling ghostview AND the missing alloca problem

From: Larry Chin (
Date: Wed Oct 27 1993 - 06:42:05 CDT


Well at long last I have managed to compile ghostview under SunOs 4.1.3 and
I have also solved the problem of the missing alloca in the libc that is
stock with SunOs.

Okay so first:


Problems compiling ghostview under SunOs


The problem with compiling ghostview was that there were certain
required functions that were not contained in SunOs X libraries, but
were contained in the X11R5 libraries.

Hence, to compile ghostview required a mix of /usr/openwin/lib
libraries and the X11R5 libraries. The libraries from the X11R5
release that are needed are the Xt and Xmu libraries.

To get around the problem of different programs needing different
libraries ( ie: X11R5 programs and openwin programs ) I simply linked
all the libraries into /usr/local/lib as suggested by question #8 of
the sun-managers.faq.

The only caveat being that both X11 and openwindows have certain
libraries with the same major.minor number.

In these cases I decided to give openwin libraries preference UNLESS
programs required something that was not present in them but that was
present in the X11 libraries, in which case I linked the latter to

After all that is said and done, I then changed my LD_LIBRARY_PATH to

This, so that when the program starts, will find the X11
libraries as well as openwindows libraries ( the ones that do not
conflict in major.minor numbers ) AS WELL AS any other libraries that
it might need from openwindows or SunOs. Failing to do this causes to complain about not finding the correct version of a library
and then the program bombs.

Thanks for inut into the ghostview problem go to:

Andy Mitchell <>
"Michael (M.A.) Meystel" <MEYSTMA%DUVM.BITNET@pucc.Princeton.EDU>
"John Strupp" <> (V.Sander) (V.Sander) (Ian Daniel)
David Fetrow <>
bill@hopless (Bill McSephney ) (Irene Bermiso) (Frank 'Scruffy' Miller) (Perry Hutchison) (Steve_Kilbane) (Eckhard Rueggeberg) (Ted Whitely) (Mike Kail) (Gary Richardson)
Mike D. Kail <>
Mike D. Kail <> (Jim Poland) (Lisa Isaacs) (Brian Decker)
Mike D. Kail <> (Peter Gross)
msteed@tfs.COM (Martin N. Steed)
Paul Mickel <> (George Pallas) (John Louie)
Duane.Mun@EBay.Sun.COM (Duane T. Mun)
Juergen Rothenanger <> (Sandeep Cariapa) (Carl Brewer) (BOESSENKOOL) (John Justin Hough) (Dick St.Peters)
raoul@MIT.EDU (Nico Garcia)
Snowman <>


To the problem of the missing alloca in libc.


There is a workaround for this which is to put the line:

        #include <alloca.h>

into your program source. Apparently

        "the compiler plays tricks with alloc() to deal with RISC
        architecture and redefines alloca to be __builtin_alloca"
        - Guntram Wolski.

However after trying this ( and finding it did not work ) I discovered
that the source for ghostview was not responsible for calling alloca,
but it was libXt.a from the X11R5 that was calling it.

Hence the solution was simply in the libXt makefile, to put in a
-DINCLUDE_ALLOCA_H which is picked up by the Xtos.h and the alloca.h is
compiled into the libXt library.

So basically to get around the problem of ld complaining about a
missing alloca symbol simply put the above include line into the proper
source file.

Thanks for input to the alloca problem go to: (Kevin Sheehan {Consulting Poster Child})
Mitchum DSouza <>
Dan Stromberg - OAC-DCS <> (Guntram Wolski) (Glenn Satchell - Uniq Professional Services)
David Comay <dsc@seismo.CSS.GOV> (Bill Randle)
jonathan ross <cjross@BBN.COM> (Russ Poffenberger)
Mei.Fan@Corp.Sun.COM (Mei Fan)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:26 CDT