Re: fixing Makefile.shlib for solaris/gcc with -m64 flag - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date
Msg-id 200702202246.l1KMk1R19192@momjian.us
Whole thread Raw
In response to Re: fixing Makefile.shlib for solaris/gcc with -m64 flag  ("Jignesh K. Shah" <J.K.Shah@Sun.COM>)
List pgsql-hackers
OK, I have made Solaris gcc the same as Linux in Makefile.shlib, patch
attached.

I am not backpatching this.  We will get this tested for 8.3.

---------------------------------------------------------------------------

Jignesh K. Shah wrote:
> I dont think we solved this.. But I think the way to put -m64 should be same as in Linux and Solaris
> and not different.
>
> Thanks.
> Regards,
> Jignesh
>
>
> Tom Lane wrote:
> > Peter Eisentraut <peter_e@gmx.net> writes:
> >> Am Mittwoch, 17. Januar 2007 17:12 schrieb Tom Lane:
> >>> "Jignesh K. Shah" <J.K.Shah@Sun.COM> writes:
> >>>> simple if I use -m64 for 64 bit then all end binaries are generated
> >>>> 64-bit and the shared libraries are generated 32-bit and the compilation
> >>>> fails (ONLY ON SOLARIS) since that particular line is only for the
> >>>> condition Solaris AND gcc.
> >>>>
> >>>> If I use the COMPILER which is CC + CFLAGS it passes -m64 properly to it
> >>>> and generates shared libraries 64-bit and the compile continues..
> >>> Hmm ... I see we're doing it that way already for some other platforms,
> >>> but I can't help thinking it's a kluge.  Wouldn't the correct answer be
> >>> that -m64 needs to be in LDFLAGS?
> >
> >> The correct answer may be to put -m64 into CC.
> >
> > Did we conclude that that was a satisfactory solution, or is this still
> > a live patch proposal?
> >
> > If -m64 in CC is the right solution, it should probably be mentioned in
> > FAQ_Solaris.
> >
> >             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/Makefile.shlib
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.108
diff -c -c -r1.108 Makefile.shlib
*** src/Makefile.shlib    11 Feb 2007 19:31:45 -0000    1.108
--- src/Makefile.shlib    20 Feb 2007 22:45:06 -0000
***************
*** 191,197 ****

  ifeq ($(PORTNAME), solaris)
    ifeq ($(GCC), yes)
!     LINK.shared        = $(CC) -shared
    else
  # CFLAGS added for X86_64
      LINK.shared        = $(CC) -G $(CFLAGS)
--- 191,197 ----

  ifeq ($(PORTNAME), solaris)
    ifeq ($(GCC), yes)
!     LINK.shared        = $(COMPILER) -shared # $(COMPILER) needed for -m64
    else
  # CFLAGS added for X86_64
      LINK.shared        = $(CC) -G $(CFLAGS)

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [pgsql-patches] pg_get_domaindef
Next
From: Bruce Momjian
Date:
Subject: Re: PrivateRefCount (for 8.3)