comp.lang.ada
 help / color / Atom feed
* gtkada: recompile with -fPIC
@ 2020-07-31 10:47 hreba
  2020-09-04 10:14 ` liyan white
  0 siblings, 1 reply; 2+ messages in thread
From: hreba @ 2020-07-31 10:47 UTC (permalink / raw)


Hi,

I am following the plugin scheme from the GNAT examples, using GTK. So I 
need gtkada, and for proper tasking with that, gtkada_contributions. 
 From the Adacore site I grabbed the actual versions (2020) of (binary) 
GNAT and gtkada. From Dmitry's site I took the gtkada_contributions 
source code.

The plugin scheme demands building standalone relocatable libraries 
(loaded at runtime). So for making (on Linux) I call from a terminal:
    gtkada-env.sh
    export GTKADA_BUILD=relocatable
    gprbuild -Pbase
My project file base.gpr withs gtkada_contributions_lib.gpr, which is 
the original project file with the following additions:
    for Library_Name use "gtkada_contributions";
    for Library_Dir use "lib";
    for Library_Kind use "relocatable";

The above gprbuild command now produces:

Build Libraries
    [gprlib]       gtkada_contributions.lexch
    [link library] libgtkada_contributions.so
/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: 
/home/frank/Lib/Ada/gtkada_contributions/gdk-color-ihls.o: relocation 
R_X86_64_32 against `.rodata' can not be used when making a shared 
object; recompile with -fPIC
/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: 
/home/frank/Lib/Ada/gtkada_contributions/gdk-pixbuf-image.o: relocation 
R_X86_64_32 against symbol `gdk__pixbuf__image__rgb_imageT' can not be 
used when making a shared object; recompile with -fPIC
...
and a lot of other, similar lines.

Adding -fPIC to gtkada_contributions_lib.gpr (compiler switches) didn't 
change anything, so I guess it is gtkada or even gtk which has to be 
recompiled. Going ahead alone probably means hours of useless work with 
the possible result of breaking my system.

So how can I compile/link my project?
Will then future projects without relocatable libraries still compile 
and link?
-- 
Frank Hrebabetzky, Kronach	+49 / 9261 / 950 0565

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gtkada: recompile with -fPIC
  2020-07-31 10:47 gtkada: recompile with -fPIC hreba
@ 2020-09-04 10:14 ` liyan white
  0 siblings, 0 replies; 2+ messages in thread
From: liyan white @ 2020-09-04 10:14 UTC (permalink / raw)


On Friday, July 31, 2020 at 4:18:00 PM UTC+5:30, hreba wrote:
> Hi,
> 
> I am following the plugin scheme from the GNAT examples, using GTK. So I 
> need gtkada, and for proper tasking with that, gtkada_contributions. 
>  From the Adacore site I grabbed the actual versions (2020) of (binary) 
> GNAT and gtkada. From Dmitry's site I took the gtkada_contributions 
> source code.
> 
> The plugin scheme demands building standalone relocatable libraries 
> (loaded at runtime). So for making (on Linux) I call from a terminal:
>     gtkada-env.sh
>     export GTKADA_BUILD=relocatable
>     gprbuild -Pbase
> My project file base.gpr withs gtkada_contributions_lib.gpr, which is 
> the original project file with the following additions:
>     for Library_Name use "gtkada_contributions";
>     for Library_Dir use "lib";
>     for Library_Kind use "relocatable";
> 
> The above gprbuild command now produces:
> 
> Build Libraries
>     [gprlib]       gtkada_contributions.lexch
>     [link library] libgtkada_contributions.so
> /opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: 
> /home/frank/Lib/Ada/gtkada_contributions/gdk-color-ihls.o: relocation 
> R_X86_64_32 against `.rodata' can not be used when making a shared 
> object; recompile with -fPIC
> /opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: 
> /home/frank/Lib/Ada/gtkada_contributions/gdk-pixbuf-image.o: relocation 
> R_X86_64_32 against symbol `gdk__pixbuf__image__rgb_imageT' can not be 
> used when making a shared object; recompile with -fPIC
> ...
> and a lot of other, similar lines.
> 
> Adding -fPIC to gtkada_contributions_lib.gpr (compiler switches) didn't 
> change anything, so I guess it is gtkada or even gtk which has to be 
> recompiled. Going ahead alone probably means hours of useless work with 
> the possible result of breaking my system.
> 
> So how can I compile/link my project?
> Will then future projects without relocatable libraries still compile 
> and link?
> -- 
> Frank Hrebabetzky, Kronach	+49 / 9261 / 950 0565

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31 10:47 gtkada: recompile with -fPIC hreba
2020-09-04 10:14 ` liyan white

comp.lang.ada

Archives are clonable: git clone --mirror https://archive.legitdata.co/comp.lang.ada

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git