Thread: 64Bit Solaris Compile

64Bit Solaris Compile

From
Rod Taylor
Date:
Our local admin tried compiling a 64bit PostgreSQL on Solaris 9 using
the below environment:
       export
PATH=:/usr/bin/sparcv9:/usr/ccs/bin/sparcv9:/usr/sfw/bin/sparcv9:/usr/local/bin/sparcv9:/usr/bin:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin
     export       LD_LIBRARY_PATH=/usr/lib/sparcv9:/usr/ccs/lib/sparcv9:/usr/local/lib/sparcv9:/usr/sfw/lib/sparcv9
 export CFLAGS='-m64'       export CXXFLAGS=$CFLAGS       export CPPFLAGS="-I/usr/include -I/usr/include/ncurses"

This resulted in:              make[3]: Entering directory
`/export/home/rbt/postgresql-8.0.0beta4/src/backend/utils/mb/conversion_procs/ascii_and_mic'      gcc -shared -h
libascii_and_mic.so.0 ascii_and_mic.o       -L../../../../../../src/port   -o libascii_and_mic.so.0.0       ld: fatal:
fileascii_and_mic.o: wrong ELF class: ELFCLASS64       ld: fatal: File processing errors. No output written to
libascii_and_mic.so.0.0

Making a modification to src/Makefile.shlib to include -m64 on the
LINK.shared line fixes the problem:
       ifeq ($(PORTNAME), solaris)         shlib                 := lib
$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)        ifeq ($(GCC), yes)           LINK.shared         =
$(CC)-m64 -shared   # -m64         else           LINK.shared         = $(CC) -G         endif
 


Can we somehow modify configure to pick up the CFLAGS settings and
inject them into the correct place itself? Or should we be doing this
another way?


-- 



Re: 64Bit Solaris Compile

From
Oliver Jowett
Date:
Rod Taylor wrote:
> Our local admin tried compiling a 64bit PostgreSQL on Solaris 9 using
> the below environment:
> 
>         export
>
PATH=:/usr/bin/sparcv9:/usr/ccs/bin/sparcv9:/usr/sfw/bin/sparcv9:/usr/local/bin/sparcv9:/usr/bin:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin
>         export
>         LD_LIBRARY_PATH=/usr/lib/sparcv9:/usr/ccs/lib/sparcv9:/usr/local/lib/sparcv9:/usr/sfw/lib/sparcv9
>         export CFLAGS='-m64'

I seem to remember building with CC='gcc -m64' without any pain (haven't 
tried it recently though).

-O


Re: 64Bit Solaris Compile

From
Tom Lane
Date:
Rod Taylor <pg@rbt.ca> writes:
> Our local admin tried compiling a 64bit PostgreSQL on Solaris 9 using
> the below environment:
> ...
>         export CFLAGS='-m64'

In 8.0 you'd want to also         export LDFLAGS_SL='-m64'
        regards, tom lane