Subject: link problem

From: [email-masked] (Thomas Esser)
Date: Thu, 13 May 93 11:14:12 -0700

Hallo everybody,

I recently tried to compile postgres version 4.1 from scratch,
as I wanted to use non-standard pathnames. I tried this on
a SUN sparc-startion 10 runnung SunOS 4.1.3. I used "cc" as
compiler and "ld" as linker. The problem I have is the following:

When I did "bmake all install" in src, a lot of object-files were
not rebuilt. So I removed all existing *.o files. Then I could not
recompile. The error was : "ld: PARSER.o: _yys: multiply defined",
when linking "postmaster".

So I looked to the object-files and saw that my ones and the ones
that came with the distribution, had different symbol-tables:

An example: "nm BOOTSTRAP.o | grep _yys"

        BOOTSTRAP.o (from distribution) BOOTSTRAP.o (my version)

        00000400 C _Int_yysbuf          00000400 C _Int_yysbuf
        00009498 D _Int_yysptr          00009188 D _Int_yysptr
        00008af8 D _Int_yysvec          000087e8 D _Int_yysvec
                                        00000258 C _yy_yys
        0000b9c0 b _yys                 000059f0 D _yys
        0000b9cc b _yystate             00000004 C _yystate
                                        00000004 C _yystate

I would be happy if someone could help me.

Many thanks in advance,

-Thomas

PS: I am not in the mailing-list. Please send any answers directly to
    [email-masked]

---

From: Marc Teitelbaum <[email-masked]>
Date: Thu, 13 May 93 14:37:05 PDT

If you want to change definitions in header files, you need to
do a "bmake depend" to make header file dependencies.  This will
take as long as recompiling the whole system (doing a 
"bmake cleandir; bmake all install") but once it's done you don't
have to remake the dependencies unless you change the source or
headers so that the header dependencies would be changed.  Then
you could do postgres develpoment and avoid remaking the whole
tree whenever you change one file or one header.  I suupose
we could ship the source with dependencies already made, but for the
most part this would be a waste and make the build take longer, and
most people don't do postgres develpoment.
If you make changes in the Makefiles (like global defines) you
should remake everything (again, "bmake cleandir; bmake all install")
since no dependencies are created for the information set in the Makefiles.
Of course if you're really crafty you can deduce which files would be affected
and just remake those.

Marc