Re: fixing Makefile.shlib for solaris/gcc with -m64 flag

Lists: pgsql-hackers
From: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
To: pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 12:34:22
Message-ID: 45AE17CE.6080904@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello All,

When I compile with gcc on Solaris with -m64 flags, all shared lbiraries fail.

Can someone fix the following in Makefile.shlib

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

It should be

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

Thanks.
Regards,
Jignesh


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 15:07:36
Message-ID: 9438.1169046456@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM> writes:
> It should be
> LINK.shared = $(COMPILER) -shared

Why? What's the difference, and why is it appropriate to fix it that
way instead of by changing CFLAGS?

regards, tom lane


From: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 16:01:19
Message-ID: 45AE484F.6030007@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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..

I just tested it out.

-Jignesh

Tom Lane wrote:
> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM> writes:
>> It should be
>> LINK.shared = $(COMPILER) -shared
>
> Why? What's the difference, and why is it appropriate to fix it that
> way instead of by changing CFLAGS?
>
> regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 16:12:53
Message-ID: 11524.1169050373@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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?

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)sun(dot)com>, Robert Lor <Robert(dot)Lor(at)sun(dot)com>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 16:24:36
Message-ID: 200701171724.38068.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Am Mittwoch, 17. Januar 2007 17:12 schrieb Tom Lane:
> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-17 17:46:14
Message-ID: 45AE60E6.2090307@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I tried that but it didn't work.

Also on Solaris it typically uses the ld in /usr/ccs/bin/ld which uses "-64" as its flag for 64 bit
and if you put LDFLAGS out there it will fail as unrecognized unless gcc parses -64 to -m64.

Putting -m64 in CC will do the workaround but then I guess that's what CFLAGS is for..

Regards,
Jignesh

Tom Lane wrote:
> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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?
>
> regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)sun(dot)com>, Robert Lor <Robert(dot)Lor(at)sun(dot)com>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-01-31 18:42:43
Message-ID: 11482.1170268963@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Am Mittwoch, 17. Januar 2007 17:12 schrieb Tom Lane:
>> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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


From: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-02-01 09:54:24
Message-ID: 45C1B8D0.6030600@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)gmx(dot)net> writes:
>> Am Mittwoch, 17. Januar 2007 17:12 schrieb Tom Lane:
>>> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Subject: Re: fixing Makefile.shlib for solaris/gcc with -m64 flag
Date: 2007-02-20 22:46:01
Message-ID: 200702202246.l1KMk1R19192@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(at)gmx(dot)net> writes:
> >> Am Mittwoch, 17. Januar 2007 17:12 schrieb Tom Lane:
> >>> "Jignesh K. Shah" <J(dot)K(dot)Shah(at)Sun(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 728 bytes