On my Gentoo box I got the following error every time I try to build the 3.2.2 version of FreePascal (FPC): /usr/bin/ld: error: ./link178.res:292:8: syntax error, unexpected STRING /usr/bin/ld: fatal error: unable to parse script file ./link178.res pp.pas(266,1) Error: Error while linking pp.pas(266,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Reproducible: Always Steps to Reproduce: 1. emerge dev-lang/fpc
Created attachment 719604 [details] fpc 3.2.2 build failure log
Just a guess given haven't tested yet, but do you have USE=default-gold on binutils? I don't see your emerge --info, but in the build.log I see: * Forcing usage of the BFD linker This may have been partially my fault because of a suggestion I made in the PR (ebuild was telling people to use binutils-config to switch back to bfd and die otherwise, however that's something that's no longer offered by binutils-config and did need a change) But then seems this package ignores the exported LD and uses /usr/bin/ld directly (so tc-ld-disable-gold is only a partial solution), and last I know of this still fails with gold. Telling users to re-emerge binutils isn't great, so I guess Makefiles may need patching if want to keep using USE=default-gold
*** This bug has been marked as a duplicate of bug 475210 ***
(In reply to Ionen Wolkens from comment #3) > > *** This bug has been marked as a duplicate of bug 475210 *** The proposed patch doesn't work... it cannot be applied emerge -q --newuse --update --deep --with-bdeps=y --backtrack=100 --verbose-conflicts --keep-going=y --exclude="gcc gentoo-sources linux-headers nvidia-drivers wine-staging virtual/rust dev-lang/rust" @world >>> Verifying ebuild manifests >>> Emerging (1 of 1) dev-lang/fpc-3.2.2::gentoo >>> Failed to emerge dev-lang/fpc-3.2.2, Log file: >>> '/tmp/portage/dev-lang/fpc-3.2.2/temp/build.log' * Package: dev-lang/fpc-3.2.2 * Repository: gentoo * Maintainer: amynka@gentoo.org * USE: abi_x86_64 amd64 elibc_glibc kernel_linux source userland_GNU * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox * Applying 0001-dev-lang-fpc-never-link-with-gcc-s-ld.gold.patch ... can't find file to patch at input line 33 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From 3f6e982fcbb517768ed0b6c4ab8ee26ab14e22d2 Mon Sep 17 00:00:00 2001 |From: "Gregory M. Turner" <gmt@be-evil.net> |Date: Fri, 25 Sep 2015 22:30:06 -0700 |Subject: [PATCH] dev-lang/fpc: never link with gcc's ld.gold | |Drops the premerge barf-out and replaces with |a working solution. | |Only takes action when the portage environment is |configured such that tc-getLD returns a GNU gold linker. | |Mostly I just follow the recipe in |toolchain-functions.eclass's tc-ld-disable-gold; however, |we gain nothing from that in fpc because tc-ld-disable-gold |does not modify the PATH and hence we would need to duplicate |all of the work it did privately anyhow. | |It might be nice to fix this in tc-ld-disable-gold. I |know packages that hard code "ld" invocations hardly |deserve a gold star for flexibility, but that doesn't |mean gentoo shouldn't support them (case-in-commit imo). | |Fixes: #475210 |Signed-off-by: Gregory M. Turner <gmt@be-evil.net> |--- | dev-lang/fpc/fpc-2.6.4.ebuild | 23 ++++++++++++----------- | 1 file changed, 12 insertions(+), 11 deletions(-) | |diff --git a/dev-lang/fpc/fpc-2.6.4.ebuild b/dev-lang/fpc/fpc-2.6.4.ebuild |index eff2e5a..a1b7661 100644 |--- a/dev-lang/fpc/fpc-2.6.4.ebuild |+++ b/dev-lang/fpc/fpc-2.6.4.ebuild -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored [ !! ] * ERROR: dev-lang/fpc-3.2.2::gentoo failed (prepare phase): * patch -p1 failed with /etc/portage/patches/dev-lang/fpc/0001-dev-lang-fpc-never-link-with-gcc-s-ld.gold.patch * * Call stack: * ebuild.sh, line 127: Called src_prepare * environment, line 1298: Called default * phase-functions.sh, line 858: Called default_src_prepare * phase-functions.sh, line 923: Called __eapi6_src_prepare * environment, line 224: Called eapply_user * environment, line 520: Called eapply '/etc/portage/patches/dev-lang/fpc/0001-dev-lang-fpc-never-link-with-gcc-s-ld.gold.patch' * environment, line 490: Called _eapply_patch '/etc/portage/patches/dev-lang/fpc/0001-dev-lang-fpc-never-link-with-gcc-s-ld.gold.patch' * environment, line 428: Called __helpers_die 'patch -p1 failed with /etc/portage/patches/dev-lang/fpc/0001-dev-lang-fpc-never-link-with-gcc-s-ld.gold.patch' * isolated-functions.sh, line 112: Called die * The specific snippet of code: * die "$@" * * If you need support, post the output of `emerge --info '=dev-lang/fpc-3.2.2::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-lang/fpc-3.2.2::gentoo'`. * The complete build log is located at '/tmp/portage/dev-lang/fpc-3.2.2/temp/build.log'. * The ebuild environment file is located at '/tmp/portage/dev-lang/fpc-3.2.2/temp/environment'. * Working directory: '/tmp/portage/dev-lang/fpc-3.2.2/work/fpcbuild-3.2.2/fpcsrc' * S: '/tmp/portage/dev-lang/fpc-3.2.2/work/fpcbuild-3.2.2/fpcsrc' * * The following package has failed to build, install, or execute postinst: * * (dev-lang/fpc-3.2.2:0/0::gentoo, ebuild scheduled for merge), Log file: * '/tmp/portage/dev-lang/fpc-3.2.2/temp/build.log' *
That patch is very old and not meant to be used as-is I outlined possible gentoo-side solutions in the other bug, but when it comes down to it, you need to disable USE=default-gold on binutils (I do assume you have that enabled)