Lazarus

Programming => Operating Systems => Linux => Topic started by: stephanweber on March 19, 2019, 08:37:24 am

Title: Lazarus does not Link under RH73
Post by: stephanweber on March 19, 2019, 08:37:24 am
Hi, I am able to work under RH60, Ubuntu 16.04, and Windows, but now having a VMWare with RH73 I cannot link, only compilation works.
I checked the link settings, tried different ones, like smart on/off, but nothing helps. I expected a permission problem too, but I can write to the proj dir, and also running lazarus as su does not enable the linking. I also tried running lazarus compiled programs from RH6 under this RH73 env, but there are no problems.

Has anyone an idea on what could cause such linking problems?

Bye Stephan
Title: Re: Lazarus does not Link under RH73
Post by: marcov on March 19, 2019, 08:50:05 am
Maybe some apparmor thingy that requires a certain signature ?
Title: Re: Lazarus does not Link under RH73
Post by: Cyrax on March 19, 2019, 09:26:35 am
Hi, I am able to work under RH60, Ubuntu 16.04, and Windows, but now having a VMWare with RH73 I cannot link, only compilation works.
I checked the link settings, tried different ones, like smart on/off, but nothing helps. I expected a permission problem too, but I can write to the proj dir, and also running lazarus as su does not enable the linking. I also tried running lazarus compiled programs from RH6 under this RH73 env, but there are no problems.

Has anyone an idea on what could cause such linking problems?

Bye Stephan

Add -va -k--verbose compiler options to your project and attach compiler output to this thread so we can see what error linker gives (and the compiler if there is any, too).

Which version of Lazarus and FPC you are using?
Title: Re: Lazarus does not Link under RH73
Post by: mig-31 on March 19, 2019, 10:30:51 am
I have two installations of CetnOS 7.3 and CetnOS 7.6 (clone of RHEL) with Lazarus 1.6.4 and Lazarus 2.0.0 and I don't have any problem with compilation. SELinux is active.
I think, it is caused by missing library in your RH7.3 installation.
 
Title: Re: Lazarus does not Link under RH73 and Lazarus 1.8.4. and 2.0
Post by: stephanweber on March 28, 2019, 01:05:19 pm
Hi, I am using RH73 and Lazarus 1.8.4 (and 2.0).
Under RH60 I work with Lazarus 1.0, and under Ubuntu 16.04 with Lazarus 1.6. - All is perfect! But not RH73 :(.

The log from RH73+1.8.4 is this:
Compile Project, Target: project1

Compile Reason: Last compile was incomplete.
  State file=/home2/stephan/test_simple/lib/x86_64-linux/project1.compiled


Executable:
/usr/bin/fpc

CurrentDirectory:
/home2/stephan/test_simple/

Parameters:
-MObjFPC
-Scghi
-Cg
-O1
-l
-vewnhibq
-Fi/home2/stephan/test_simple/lib/x86_64-linux
-Fu/usr/lib64/lazarus/lcl/units/x86_64-linux/gtk2
-Fu/usr/lib64/lazarus/lcl/units/x86_64-linux
-Fu/usr/lib64/lazarus/components/lazutils/lib/x86_64-linux
-Fu/usr/lib64/lazarus/packager/units/x86_64-linux
-Fu/home2/stephan/test_simple/
-FU/home2/stephan/test_simple/lib/x86_64-linux/
-dLCL
-dLCLgtk2
project1.lpr

Command Line:
/usr/bin/fpc -MObjFPC -Scghi -Cg -O1 -l -vewnhibq -Fi/home2/stephan/test_simple/lib/x86_64-linux -Fu/usr/lib64/lazarus/lcl/units/x86_64-linux/gtk2 -Fu/usr/lib64/lazarus/lcl/units/x86_64-linux -Fu/usr/lib64/lazarus/components/lazutils/lib/x86_64-linux -Fu/usr/lib64/lazarus/packager/units/x86_64-linux -Fu/home2/stephan/test_simple/ -FU/home2/stephan/test_simple/lib/x86_64-linux/ -dLCL -dLCLgtk2 project1.lpr

ProcessID:
3918

ExitStatus:
256

Error: Exit code 256

Any idea what goes wrong? Now I switched to Lazarus 2.0, but it does not change anything regarding linking.
Title: Re: Lazarus does not Link under RH73
Post by: zeljko on March 28, 2019, 02:53:27 pm
RH 7.3 ? :))))))
Ok, there might be problem with gtk2 version on RH7.3 since some new symbols (lclgtk2) are introduced in between lazarus 1.0 and 1.8 so you should post linker errors so we can see what symbols are missing in distro libgtk2
Title: Re: Lazarus does not Link under RH73
Post by: stephanweber on March 29, 2019, 10:25:22 am
RH 7.3 ? :))))))
...8 so you should post linker errors so we can see what symbols are missing in distro libgtk2

Great finding O:-), but where can I find the linker errors? And how to fix the libgtk2 problems?
Title: Re: Lazarus does not Link under RH73
Post by: zeljko on March 29, 2019, 10:41:42 am
RH 7.3 ? :))))))
...8 so you should post linker errors so we can see what symbols are missing in distro libgtk2

Great finding O:-), but where can I find the linker errors? And how to fix the libgtk2 problems?

As Cyrax said above:
Add -va -k--verbose compiler options to your project and attach compiler output to this thread so we can see what error linker gives (and the compiler if there is any, too).
Title: Re: Lazarus does not Link under RH73
Post by: stephanweber on April 04, 2019, 12:35:06 pm
Hi,

I enabled these additional compiler options, but I still cannot really see more information, which could help me in fixing the linker problems. Please check out the attach png file from my Lazarus "Message" window.
I also inspected the unix directories of my project, but see nothing helpful still.

Thanks a lot for your help so far 8-), Stephan
Title: Re: Lazarus does not Link under RH73
Post by: zeljko on April 04, 2019, 02:38:31 pm
There should be .sh script in project directory leaved by linking stage (if linking fails). Position to that dir via terminal and execute that script so you'll see detailed ld output (cannot remember exact name of script...maybe it's pp.sh or similar).
Title: Re: Lazarus does not Link under RH73
Post by: stephanweber on April 24, 2019, 09:44:53 am
There should be .sh script in project directory leaved by linking stage (if linking fails). ...

Unfortunately there is no sh file in proj dir, only a linker resource file (but this does not contain any error messages).

However, If running another program I also got lib errors!!! So indeed my RH73 has a problem on libs, e.g. gives me:

(gedit:3412): GLib-GIO-CRITICAL **: g_simple_action_set_enabled: assertion 'G_IS_SIMPLE_ACTION (simple)' failed

How can I repair this?

Bye Stephan
Title: Re: Lazarus does not Link under RH73
Post by: stephanweber on April 29, 2019, 03:50:58 pm
Hi,

I still need help: I have executed the command mentioned in the log from shell directly and got a more detailed error message:

/usr/bin/ld -b elf64-x86-64 -m elf_x86_64  --verbose --dynamic-linker=/lib64/ld-linux-x86-64.so.2   -s -L. -o /home2/stephan/test_simple/project1 /home2/stephan/test_simple/link.res

gives:


......
libgraphite2.so.3 needed by /usr/lib64/libharfbuzz.so.0
found libgraphite2.so.3 at /usr/lib64/libgraphite2.so.3
libpcre.so.1 needed by /usr/lib64/libselinux.so.1
found libpcre.so.1 at /usr/lib64/libpcre.so.1
libgcc_s.so.1 needed by /usr/lib64/libgraphite2.so.3
found libgcc_s.so.1 at /usr/lib64/libgcc_s.so.1
/usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value


How can I get rid of this error?

Bye Stephan
Title: Re: Lazarus does not Link under RH73
Post by: marcov on April 29, 2019, 09:58:10 pm
Throwing the error in google yields:

https://stackoverflow.com/questions/46058050/unable-to-compile-unrecognized-relocation

Search for "binutils-config"
TinyPortal © 2005-2018