Hi GPC crew,
I am trying to build shared objects with gp on SUN Sparc Solaris 10 using gpc 20070904 based on gcc-4.1.2.
I tried many options of gp with no success. It looks like gp does not pass the --shared and -fPIC command line options to gpc so it produces only regular objects.
So, is there a way to benefit from gp's great features to generate shared objects?
Thanks
Pascal Viandier
Pascal Viandier wrote:
Hi GPC crew,
I am trying to build shared objects with gp on SUN Sparc Solaris 10 using gpc 20070904 based on gcc-4.1.2.
I tried many options of gp with no success. It looks like gp does not pass the --shared and -fPIC command line options to gpc so it produces only regular objects.
So, is there a way to benefit from gp's great features to generate shared objects?
I can't speak for Solaris, but on Mac OS X it works. Note that you have to build libgpc.a as position independent code also, unless it's the default on the platform (like it is on Mac OS X).
Regards,
Adriaan van Os
<SNIP>
So, is there a way to benefit from gp's great features to generate shared objects?
I can't speak for Solaris, but on Mac OS X it works. Note that you
have to build libgpc.a as
position independent code also, unless it's the default on the
platform (like it is on Mac OS X).
Regards,
Adriaan van Os
For sure I did. In fact, I use the shares object version of libgpc for my programs. The problem is not to produce shared objects with gpc (You gave me the way to do it on this mailing liste long time ago). My question was about using gp on top of gpc to produce shared objects.
Regards,
Pascal Viandier
Pascal Viandier wrote:
The problem is not to produce shared objects with gpc (You gave me the way to do it on this mailing liste long time ago). My question was about using gp on top of gpc to produce shared objects.
What's the output of gp with -v ?
Regards,
Adriaan van Os
<snip>
What's the output of gp with -v ?
Regards,
Adriaan van Os
Here it is.
Regards,
Pascal Viandier
<gnu-pascal> gp -v --shared -fPIC -o mod1.so mod1.pas gpc -dumpmachine gpc -dumpversion gpc -print-file-name=units gpc --print-needed-options -x Preprocessed-Pascal /var/tmp/GPaaa24970 gpc -E -H /mnt/gnu-port/tests/mod1.pas --shared --PIC -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ gpc -E -H /mnt/gnu-port/tests/stat.pas --shared --PIC -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ gpc --gpi-destination-path=/mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ --no-automake -c -o /mnt/gnu-port/tests/stat.o /mnt/gnu-port/tests/stat.pas -v --shared --PIC -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ Using built-in specs. Configured with: ../gcc-4.1.2/configure --prefix=/usr/local/compilers --enable-languages=pascal,c,c++ Thread model: posix gpc version 20070904, based on gcc-4.1.2 /usr/local/compilers/libexec/gcc/sparc-sun-solaris2.10/4.1.2/gpc1 -quiet -v -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ /mnt/gnu-port/tests/stat.pas -quiet -dumpbase stat.pas -mcpu=v7 -famtmpfile=/var/tmp//ccOvqSrk.gpa -fgpi-destination-path=/mnt/gnu-port/tests/ -funit-path=/mnt/gnu-port/tests/ -fno-automake -fPIC -funit-path=/mnt/gnu-port/tests/ -version -o /var/tmp//ccYtSkZu.s GNU Pascal version 20070904, based on gcc-4.1.2 (sparc-sun-solaris2.10) compiled by GNU C version 3.4.4. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Pascal Compiler PreProcessor version 20070904, based on gcc-4.1.2
{$include "..."} search starts here: {$include <...>} search starts here: /mnt/gnu-port/tests/ /mnt/gnu-port/tests/ . /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units /mnt/gnu-port/tests/ End of search list. /usr/ccs/bin/as -V -Qy -s -K PIC -xarch=v8 -o /mnt/gnu-port/tests/stat.o /var/tmp//ccYtSkZu.s /usr/ccs/bin/as: Sun Compiler Common 10 Patch 05/06/2005 gpc --gpi-destination-path=/mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ --no-automake -c -o /mnt/gnu-port/tests/mod1.o /mnt/gnu-port/tests/mod1.pas -v --shared --PIC -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ --unit-path=/mnt/gnu-port/tests/ Using built-in specs. Configured with: ../gcc-4.1.2/configure --prefix=/usr/local/compilers --enable-languages=pascal,c,c++ Thread model: posix gpc version 20070904, based on gcc-4.1.2 /usr/local/compilers/libexec/gcc/sparc-sun-solaris2.10/4.1.2/gpc1 -quiet -v -I /mnt/gnu-port/tests/ -I /mnt/gnu-port/tests/ -I . -I /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units -I /mnt/gnu-port/tests/ /mnt/gnu-port/tests/mod1.pas -quiet -dumpbase mod1.pas -mcpu=v7 -famtmpfile=/var/tmp//ccELMgrt.gpa -fgpi-destination-path=/mnt/gnu-port/tests/ -funit-path=/mnt/gnu-port/tests/ -fno-automake -fPIC -funit-path=/mnt/gnu-port/tests/ -version -o /var/tmp//cc4gbJkN.s GNU Pascal version 20070904, based on gcc-4.1.2 (sparc-sun-solaris2.10) compiled by GNU C version 3.4.4. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Pascal Compiler PreProcessor version 20070904, based on gcc-4.1.2
{$include "..."} search starts here: {$include <...>} search starts here: /mnt/gnu-port/tests/ /mnt/gnu-port/tests/ . /usr/local/compilers/lib/gcc/sparc-sun-solaris2.10/4.1.2/units /mnt/gnu-port/tests/ End of search list. /usr/ccs/bin/as -V -Qy -s -K PIC -xarch=v8 -o /mnt/gnu-port/tests/mod1.o /var/tmp//cc4gbJkN.s /usr/ccs/bin/as: Sun Compiler Common 10 Patch 05/06/2005 gp: warning: ignoring `-o' when not linking
Pascal Viandier wrote:
<snip> > What's the output of gp with -v ? <snip> /usr/ccs/bin/as -V -Qy -s -K PIC -xarch=v8 -o /mnt/gnu-port/tests/mod1.o /var/tmp//cc4gbJkN.s /usr/ccs/bin/as: Sun Compiler Common 10 Patch 05/06/2005 gp: warning: ignoring `-o' when not linking
Hm, could the problem be that no linking is occuring ? I think that's the default for gp when compiling a unit into a shared library. I have a patch for gp that adds --compile-and-link. When passing that option, linking will occur.
Regards,
Adriaan van Os
<snip>
Hm, could the problem be that no linking is occuring ? I think that's
the default for gp when
compiling a unit into a shared library. I have a patch for gp that
adds --compile-and-link. When
passing that option, linking will occur.
Regards,
Adriaan van Os
Yeah! Your patch works perfectly. I can now generate shared object with gp.
Thank you very much for your continuous and invaluable help!
Kind regards,
Pascal Viandier
On Feb 12, 2008, at 8:16 AM, Pascal Viandier wrote:
Hi GPC crew,
I am trying to build shared objects with gp on SUN Sparc Solaris 10 using gpc 20070904 based on gcc-4.1.2.
I tried many options of gp with no success. It looks like gp does not pass the --shared and -fPIC command line options to gpc so it produces only regular objects.
So, is there a way to benefit from gp's great features to generate shared objects?
Have you tried using gp's --Pascal=OPTION parameter form to tell gp to pass the --shared and -fPIC options onto each invocation of gpc?
Gale Paeper gpaeper@empirenet.com
<snip>
Have you tried using gp's --Pascal=OPTION parameter form to tell gp to pass the --shared and -fPIC options onto each invocation of gpc?
Gale Paeper gpaeper@empirenet.com
Yes I did - with no success however.
I tried: --executable-file-name=mod1.so -o mod1.so --Pascal=--shared --Pascal=fPIC
and some combinations of the above but gp never generates a shared object.
Regards,
Pascal Viandier