Bug 239934 - lang/fpc linking failure /usr/bin/ld.bfd not found
Summary: lang/fpc linking failure /usr/bin/ld.bfd not found
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks: 240280
  Show dependency treegraph
 
Reported: 2019-08-18 00:25 UTC by Trev
Modified: 2019-09-03 15:57 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trev 2019-08-18 00:25:01 UTC
FreeBSD ghost 12.0-STABLE FreeBSD 12.0-STABLE #4 r350672: Wed Aug  7 19:37:10 AEST 2019

$ ls -l /usr/bin/ld*
lrwxr-xr-x  1 root  wheel         6  7 Aug 20:31 /usr/bin/ld -> ld.lld
-r-xr-xr-x  1 root  wheel  37783512  7 Aug 20:31 /usr/bin/ld.lld
-r-xr-xr-x  1 root  wheel     19472  7 Aug 20:31 /usr/bin/ldd
-r-xr-xr-x  1 root  wheel     27008  7 Aug 20:32 /usr/bin/ldd32

$ locate ld.bfd
/usr/local/bin/ld.bfd
/usr/local/x86_64-portbld-freebsd12.0/bin/ld.bfd

Build error below:

/bin/mkdir -p x86_64/units/x86_64-freebsd
/usr/ports/lang/fpc/work/fpc-3.0.4/compiler/ppc1 -Fux86_64 -Fusystems -Fu../rtl/units/x86_64-freebsd -Fix86_64 -FE. -FUx86_64/units/x86_64-freebsd -Cg     -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew pp.pas
/bin/sh: /usr/bin/ld.bfd: not found
pp.pas(247,1) Error: Error while linking
pp.pas(247,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Comment 1 Graham Perrin 2019-08-29 05:54:26 UTC
Similarly, with poudriere on CURRENT:

grahamperrin@momh167-gjp4-8570p:~ % date ; uname -v
#Thu 29 Aug 2019 06:43:18 BST
FreeBSD 13.0-CURRENT r351180 GENERIC 
grahamperrin@momh167-gjp4-8570p:~ % ls -l /usr/bin/ld*
lrwxr-xr-x  1 root  wheel         6 18 Aug 11:05 /usr/bin/ld -> ld.lld
-r-xr-xr-x  1 root  wheel  30774976 18 Aug 11:05 /usr/bin/ld.lld
-r-xr-xr-x  1 root  wheel     19712 18 Aug 11:04 /usr/bin/ldd
-r-xr-xr-x  1 root  wheel     27200 18 Aug 11:06 /usr/bin/ldd32
grahamperrin@momh167-gjp4-8570p:~ % locate ld.bfd | grep -v iocage
/usr/local/bin/ld.bfd
/usr/local/x86_64-portbld-freebsd13.0/bin/ld.bfd
grahamperrin@momh167-gjp4-8570p:~ % 

Below, the tail of 
/usr/local/poudriere/data/logs/bulk/head-default/latest/logs/fpc-3.0.4_1.log

----

…
/bin/mkdir -p x86_64/units/x86_64-freebsd
/wrkdirs/usr/ports/lang/fpc/work/fpc-3.0.4/compiler/ppc1 -Fux86_64 -Fusystems -Fu../rtl/units/x86_64-freebsd -Fix86_64 -FE. -FUx86_64/units/x86_64-freebsd -Cg     -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew pp.pas
/bin/sh: /usr/bin/ld.bfd: not found
pp.pas(247,1) Error: Error while linking
pp.pas(247,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
gmake[4]: *** [Makefile:3928: ppcx64] Error 1
gmake[4]: Leaving directory '/wrkdirs/usr/ports/lang/fpc/work/fpc-3.0.4/compiler'
gmake[3]: *** [Makefile:3971: next] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/fpc/work/fpc-3.0.4/compiler'
gmake[2]: *** [Makefile:3979: ppc2] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/fpc/work/fpc-3.0.4/compiler'
gmake[1]: *** [Makefile:3987: cycle] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/fpc/work/fpc-3.0.4/compiler'
*** Error code 2

Stop.
make: stopped in /usr/ports/lang/fpc
=>> Cleaning up wrkdir
===>  Cleaning for fpc-3.0.4_1
build of lang/fpc | fpc-3.0.4_1 ended at Thu Aug 29 05:38:22 BST 2019
build time: 00:02:15
!!! build failure encountered !!!
Comment 2 Jose Alonso Cardenas Marquez freebsd_committer 2019-08-30 02:33:03 UTC
Could you try this patch to ports/lang/fpc/Makefile?

--- Makefile       2019-08-29 21:30:45.621463000 -0500
+++ Makefile    2019-08-29 21:31:13.753560000 -0500
@@ -24,10 +24,11 @@
 ONLY_FOR_ARCHS=        amd64 i386

 USES+=         gmake iconv
+USE_BINUTILS=  yes
 BOOTVER=       3.0.4
 MANVER=                3.0.4

-LDPATH=                "/usr/bin/ld.bfd"
+LDPATH=                "${LOCALBASE}/bin/ld.bfd"

 #USE_GITHUB=   yes
 #GH_ACCOUNT=   fpc-svn
Comment 3 Kurt Jaeger freebsd_committer 2019-09-02 19:12:07 UTC
testbuild of lang/fpc with the patch works!
Comment 4 Kurt Jaeger freebsd_committer 2019-09-02 19:59:35 UTC
To be more precise. Works on current-amd64. Still fails on current-i386.
Comment 5 Trev 2019-09-03 01:35:09 UTC
The patch resolves my issue on FreeBSD-12.0-STABLE amd64.
Comment 6 Jose Alonso Cardenas Marquez freebsd_committer 2019-09-03 05:52:31 UTC
Please, look at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240293. It fixes build on i386. I'll commit changes after of exp-run passed without problems
Comment 7 commit-hook freebsd_committer 2019-09-03 15:53:00 UTC
A commit references this bug:

Author: acm
Date: Tue Sep  3 15:52:00 UTC 2019
New revision: 510956
URL: https://svnweb.freebsd.org/changeset/ports/510956

Log:
  - Rebuild bootstrap (ppcx64 and ppc386) with ld patches
  - Fix build on 12-STABLE and CURRENT (amd64 and i386)
  - Bump PORTREVISION for all ports that depends of lang/fpc
  - Add USE_BINUTILS to fpc and lazarus based ports
  - Add binutils dependency to Uses/fpc.mk and Uses/lazarus.mk

  PR:		240293 239934 233413 214864
  Exp-run by:	antoine

Changes:
  head/Mk/Uses/fpc.mk
  head/Mk/Uses/lazarus.mk
  head/archivers/peazip/Makefile
  head/archivers/peazip/pkg-plist
  head/cad/zcad/Makefile
  head/comms/cqrlog/Makefile
  head/databases/fpc-fpindexer/Makefile
  head/databases/fpc-gdbm/Makefile
  head/databases/fpc-ibase/Makefile
  head/databases/fpc-postgres/Makefile
  head/devel/fpc-fcl-db/Makefile
  head/devel/fpc-fcl-js/Makefile
  head/devel/fpc-fcl-json/Makefile
  head/devel/fpc-fcl-passrc/Makefile
  head/devel/fpc-fcl-pdf/Makefile
  head/devel/fpc-fcl-sdo/Makefile
  head/devel/fpc-fcl-stl/Makefile
  head/devel/fpc-fcl-web/Makefile
  head/devel/fpc-fppkg/Makefile
  head/devel/fpc-sdl/Makefile
  head/editors/cudatext/Makefile
  head/editors/lazarus/Makefile
  head/editors/picpas/Makefile
  head/games/hedgewars/Makefile
  head/graphics/fpc-imagemagick/Makefile
  head/graphics/lazpaint/Makefile
  head/lang/fpc/Makefile
  head/lang/fpc/distinfo
  head/lang/fpc/files/patch-compiler_systems_t__bsd.pas
  head/lang/fpc-base/Makefile
  head/lang/fpc-rtl-objpas/Makefile
  head/lang/fpc-source/Makefile
  head/lang/fpc-utils/Makefile
  head/lang/nbc/Makefile
  head/multimedia/fpc-libvlc/Makefile
  head/multimedia/winff/Makefile
  head/net-p2p/awgg/Makefile
  head/net-p2p/transmission-remote-gui/Makefile
  head/russian/emkatic/Makefile
  head/science/checkmol/Makefile
  head/science/mol2ps/Makefile
  head/www/fpc-googleapi/Makefile
  head/x11/fpc-x11/Makefile
  head/x11-fm/doublecmd/Makefile
Comment 8 Jose Alonso Cardenas Marquez freebsd_committer 2019-09-03 15:57:45 UTC
fpc/lazarus ports will use binutils from ports. I think that lld will not supported in short time but now we can set LDPATH if it is supported later