Sign in Join

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

Mailing lists / fpc-devel / 2013-05

Re: Accepted fpc 2.6.2-1 (source amd64 all)

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

peter green

For those reading this on fpc-devel the context is that the upload of fpc 2.6.2 to debian failed on most architectures and I would like upstream input on sorting it out.

Abou Al Montacir wrote
Many targets are broken: powerpc, sparc, armel, armhf. The error message looks very similar on 3 targets (powerpc, sparc and armel) but not for armhf.

I've sorted the armhf specific issue. As expected it just required some tweaking of ifdefs so that the code in question wasn't used when building the rtl with 2.6.0. After sorting that issue it failed with much the same linker problem with fpmake as other architectures.

Show quoted text 22 lines
/usr/bin/make -C fastcgi smart make[3]: Entering directory `/«PKGBUILDDIR»/fpcsrc/packages/fastcgi' /«PKGBUILDDIR»/fpcsrc/compiler/ppcppc fpmake.pp -n -Fu/«PKGBUILDDIR»/fpcsrc/rtl/units/powerpc-linux -Fu/«PKGBUILDDIR»/fpcsrc/packages/hash/units/powerpc-linux -Fu/«PKGBUILDDIR»/fpcsrc/packages/paszlib/units/powerpc-linux -Fu/«PKGBUILDDIR»/fpcsrc/packages/fcl-process/units/powerpc-linux -Fu/«PKGBUILDDIR»/fpcsrc/packages/fpmkunit/units/powerpc-linux /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/lib/powerpc-linux-gnu/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init': (.text+0x48): undefined reference to `_init' fpmake.pp(30,38) Error: Error while linking fpmake.pp(30,38) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[3]: *** [fpmake] Error 1 make[3]: Leaving directory `/«PKGBUILDDIR»/fpcsrc/packages/fastcgi' make[2]: *** [fastcgi_smart] Error 2 make[2]: Leaving directory `/«PKGBUILDDIR»/fpcsrc/packages' make[1]: *** [packages_smart] Error 2 make[1]: Leaving directory `/«PKGBUILDDIR»/fpcsrc' make: *** [build-arch-stamp] Error 2 dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2 At a first look, it seems related to a particular component (fastcgi), but deeper look shows that this is the first package being compiled using fpmake (new FP make like utility). The error itself happens while compiling fpmake at link stage.

I figured out the cause of this one. To successfully link against libc on many platforms (but NOT i386 and amd64) fpc needs to find certain libraries (/usr/lib/crt?.o iirc). To make things more confusing if it doesn't find them it silently leaves them out of the linker script and the build fails with missing symbol errors. This was discovered some time ago. On debian versions that support multiarch the libraries in question can be found in /usr/lib/<multiarch triplet>

For programs that users build we got arround this some time ago by adding a line to fpc.cfg but that doesn't work for stuff that is built as part of the build process itself like fpmake because the fpc build process (deliberately) ignores fpc.cfg. So the option to make it look int the right place needs to be passed in explicitly. Unfortunately I haven't managed to make the fpc build process pass that in. I vaugely remember an option called something like FPMAKEOPT but I can't seem to find any evidence of it in the 2.6.2 source tree.

Another way of solving the problem would be to add /usr/lib/<multiarch triplet> to the paths that are baked into the compiler (as is done for gcc in debian). IMO this is the best soloution but last time I mentioned this to upstream they didn't seem to keen on the idea.

Yet another option would be to disable threading support in fpmake but i'd rather not go down that road.

Reply by email

Marco van de Voort
to peter green

In our previous episode, peter green said:

I've sorted the armhf specific issue. As expected it just required some tweaking of ifdefs so that the code in question wasn't used when building the rtl with 2.6.0. After sorting that issue it failed with much the same linker problem with fpmake as other architectures.

After some discussion, something to try:

try adding -dNO_THREADING to CROSSOPT (for target) and maybe also to OPT (for host)

It will disable threading inside fpmake by not USESing cthreads, eliminating the need for cross-linking to being said, I don't like FPC simply silently dropping those objectfiles. That should be improved, please file a bug (but I think that is more something long term for trunk, not 2.6.2)

Reply by email

peter green
to Marco van de Voort
Marco van de Voort wrote 6 lines
After some discussion, something to try: try adding -dNO_THREADING to CROSSOPT (for target) and maybe also to OPT (for host)

Unfortunately it seems that at least when building natively (note: debian is and always has been natively built) neither OPT or CROSSOPT is passed to the build of fpmake. I asked about this in the past ( http://bugs.freepascal.org/view.php?id=21547 ) and was told it was by design.

It will disable threading inside fpmake by not USESing cthreads, eliminating the need for cross-linking to work at all.

Disabling threading is the last resort option but really I just want to pass the path to the compiler, I know where it should be looking. The bug report I mentioned above claims there is a FPMAKEOPT variable but I couldn't find any evidence of it in the 2.6.2 source tree. Maybe it appeared after the 2.6 series was branched (last time I ran into this issue I was dealing with trunk)

The good news is I found out I can pass the setting in through the "FPCFPMAKE" variable. fpmake was then built successfully.

I then ran into the same link problem building fpdoc. I was able to work arround that one through the "OPT" variable.

While i've managed to get the debian 2.6.2 package to build I still feel that the best soloution long term is to add the multiarch library paths to the compiler itself. Debian/ubuntu are two of the biggest linux distros, their use of multiarch paths isn't going to go away and while we distro packagers can work arround the fact that the compiler looks there by default end users who use the upstream release directly are likely to be somewhat phased by it (especially because of the way the compiler fails in a non-obvious way). I got a fairly negative response to that last time I suggested it to you guys (don't remember if it was on irc or the mailing list) but since then I notice someone has gone ahead and added the multiarch paths for armel and armhf to the default search path in trunk.

grep -r arm-linux-gnu *
compiler/systems/t_linux.pas:
LibrarySearchPath.AddPath(sysrootpath,'/usr/lib/arm-linux-gnueabihf',true); compiler/systems/t_linux.pas:
LibrarySearchPath.AddPath(sysrootpath,'/usr/lib/arm-linux-gnueabi',true); Binary file tests/test/cg/obj/linux/arm-eabi/tcext6.o matches

If they are going to be added for armel and armhf shouldn't they be added for other ports too?

That being said, I don't like FPC simply silently dropping those objectfiles. That should be improved, please file a bug (but I think that is more something long term for trunk, not 2.6.2

http://bugs.freepascal.org/view.php?id=24518

Reply by email

Abou Al Montacir
to peter green: For those reading this on fpc-devel the context is that the upload of fpc 2.6.2 to debian…

Hi Peter,

I was about committing new changes to fix build issue and saw that you already have fix that.

If you don't mind I'd like to change your patch slightly as follow (cf attached patch)
Please note that fpmake is a build tool which is compiled and ran on host while building the compiler (unless I'm confusing DEB_HOST_TARGET and DEB_BUILD_TARGET). But in any case, doc and fpmake should build for the same target I assume.

Cheers,

Reply by email