Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-08

Library does not compile on freeBSD

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

fredvs

Hello.

I have a library-code who compiles perfectly on Linux 32/64 and Windows 32/64 with fpc 2.7 trunk.

Sadly, when i try to compile same code on freeBSD with fpc 2.7 trunk too, i get that error message :

Show quoted text 8 lines
> /usr/bin/ld: /usr/home/fred/fpGUI-develop/lib/x86_64-freebsd/fpg_base.o: > relocation R_X86_64_32S > against `RESSTR_$FPG_CONSTANTS_$$_RSKEYCTRL' can not be used when making > a shared object; > recompile with -fPIC > /usr/home/fred/fpGUI-develop/lib/x86_64-freebsd/fpg_base.o: could not > read symbols: Bad value

Compilation was done with -fPIC parameter...

What is wrong ?

Thanks.

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Library-does-not-compile-on-freeBSD-tp5719852.html Sent from the Free Pascal - General mailing list .
Graeme Geldenhuys
to fredvs
fredvs wrote 5 lines
>> >> /usr/home/fred/fpGUI-develop/lib/x86_64-freebsd/fpg_base.o: could not >> >> read symbols: Bad value Compilation was done with -fPIC parameter... What is wrong ?

The classic down side of using Lazarus Packages (*.lpk files). You applied a new compiler option to your project, but Lazarus doesn't apply that to any packages you are using. Same goes for enabling/disabling debug info etc. Hence I am moving away from Lazarus Packages and using path macros like Maximus IDE and MSEide does. I think with newer Lazarus IDE you can somehow do it, but I find the new build modes dialog too confusing, so haven't bothered figuring it out yet.

To solve you problem, define all fpGUI Toolkit paths in your project - removing the fpgui_toolkit.lpk dependency. Or add -fPIC to the fpgui_toolkit.lpk compiler options and recompile that as well.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
fredvs
to fredvs: Hello. I have a library-code who compiles perfectly on Linux 32/64 and Windows 32/64 with…

Hello.

Thanks to Graeme, it is possible to compile libraries on freeBSD ;-)

The solution :=>
>>>>>>>>>>>>>>>>>>>>>>
Implementation
{$IFDEF FREEBSD}
// These are missing for FreeBSD in FPC's RTL
const
    S_IRWXU =  S_IRUSR or S_IWUSR or S_IXUSR;
    S_IRWXG =  S_IRGRP or S_IWGRP or S_IXGRP;
    S_IRWXO =  S_IROTH or S_IWOTH or S_IXOTH;
{$ENDIF}
>>>>>>>>>>>>>>>>>>>>>>

Not yet tested with fpc 2.7.1 but works with fpc 2.6.4

Many, many, many, many thanks Graeme.

Fred

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Library-does-not-compile-on-freeBSD-tp5719852p5719856.html Sent from the Free Pascal - General mailing list .
fredvs
to fredvs

Hello.

A other issue comes from lpk packages.
Here answer from Super-Graeme that solve my problems... =>

>>>>>

...
The classic down side of using Lazarus Packages (*.lpk files). You applied a new compiler option to your project, but Lazarus doesn't apply that to any packages you are using. Same goes for enabling/disabling debug info etc. Hence I am moving away from Lazarus Packages and using path macros like Maximus IDE and MSEide does. I think with newer Lazarus IDE you can somehow do it, but I find the new build modes dialog too confusing, so haven't bothered figuring it out yet.

To solve you problem, define all fpGUI Toolkit paths in your project - removing the fpgui_toolkit.lpk dependency. Or add -fPIC to the fpgui_toolkit.lpk compiler options and recompile that as well.

Regards,
- Graeme -

>>>>>>>>>>>>>

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Library-does-not-compile-on-freeBSD-tp5719852p5719858.html Sent from the Free Pascal - General mailing list .