fpc3.0.4 fails durink linking on Centos 7 lazarus / 1-Linux ---------------------------------------------------------------------- tomsi42 · 2018-02-26 12:57 Hi, I installed lazarus 1.8.0 woth fpc& fpc-src 3.0.4 on CentOS 7. There I get an error during linking; which comes from fpc. I created a simple pascal program and tried to compile it with fpc and I get the same error. /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized relocation (0x2a) in section `.text' /usr/bin/ld: final link failed: Bad value hello.pas(4,4) Error: Error while linking hello.pas(4,4) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode I f I uninstall 3.0.4 and install fpc 3.0.2 instead, it works fine. Also, using the fpc found in fpc-3.0.4.x86_64-linux.tar works fine. Is this a known issue? ---------------------------------------------------------------------- marcov · 2018-02-26 13:07 Yes, https://bugs.freepascal.org/view.php?id=32251 In short, the FPC RPMs were built on a system with newer binutils. ---------------------------------------------------------------------- tomsi42 · 2018-02-27 07:55 Thanks for the reply - I am thinking that this is unfortunate. The rpms should be compatible with CentOS 7 at least. Unfortunately, I am not able to build the RPM's my self as I get an error when I try to build the fpc source rpm: make[1]: Leaving directory `/home/cpt3tsi/rpmbuild/BUILD/fpc-3.0.4/utils' + '[' -z ']' + make -C fpcdocs pdf FPC=/home/cpt3tsi/rpmbuild/BUILD/fpc-3.0.4/compiler/ppcx64 make: *** fpcdocs: No such file or directory.  Stop. ---------------------------------------------------------------------- Thaddy · 2018-02-27 08:31 If you already have a working starting compiler: fpc3.0.0 or 3.0.2 you can svn checkout the source tree and from the root of the checkout directory do make clean all install. After that you need to edit /etc/fpc.cfg to point to the new version. I suppose you know how to do that. Otherwise ask again. Note if you insist on using old binutils you will get the "did you forget -T?" warning every time, which you can ignore. Better to upgrade. ---------------------------------------------------------------------- marcov · 2018-02-27 09:11 Probably you need a "fpcbuild" checkout or archive, not a "fpc" source. fpcbuild is a release engineering repository that pulls in the fpcdocs and fpc repos as externals. ---------------------------------------------------------------------- tomsi42 · 2018-02-27 09:31 Thanks for the tips. I will look into building from a fpcbuild archive. Also, the  compiler in the fpc 3.0.4 standalone  tar package works fine, I can use that. ---------------------------------------------------------------------- marcov · 2018-02-27 10:08 I always use either the .tar or self build. Never the deb/rpm, usually they cause more problems and the only thing they fix is easy deinstall. I avoid the deinstall problem by installing in a special dir as prefix, and symlinking the relevant binaries to my ~/bin This also allows easy switching branches. ---------------------------------------------------------------------- tomsi42 · 2018-02-27 11:05 Quote from: marcov on February 27, 2018, 11:08:33 amI always use either the .tar or self build. Never the deb/rpm, usually they cause more problems and the only thing they fix is easy deinstall. I am coming to the same conclusion myself. Quote from: marcov on February 27, 2018, 11:08:33 amI avoid the deinstall problem by installing in a special dir as prefix, and symlinking the relevant binaries to my ~/bin This also allows easy switching branches. Do you do the same with lazarus? How do toy set up the fpc source for lazarus in that case? ---------------------------------------------------------------------- marcov · 2018-02-27 11:14 Quote from: tomsi42 on February 27, 2018, 12:05:23 pmQuote from: marcov on February 27, 2018, 11:08:33 amI avoid the deinstall problem by installing in a special dir as prefix, and symlinking the relevant binaries to my ~/bin This also allows easy switching branches. Do you do the same with lazarus? How do toy set up the fpc source for lazarus in that case? I just have a lazarus repo somewhere. But that usually only uses (FPC-) trunk. I only use Lazarus for source editing on *nix, not really for major application development. ---------------------------------------------------------------------- tomsi42 · 2018-02-27 11:56 I have now a working setup I am happy with. I installed the fpc tar file in /opt/fpc, added my newly-built lazarus package in the same directory and placed the fpc source in a suitable directory. I had to ad /opt/fpc/bin to my path, otherwise lazarus would complain that it couldn't find fpcres. Which makes sense, I think. (I didn't want to install in /usr/lcoal as I expect I will be upgrading once in a while  ) Thanks for the help.