From: Samuli Piippo <[email protected]>

Fix multilib sdk issue where gcc is unable to find linker. Previous
fix was in cdd86896c8d29135f937968e9aa07f919cf543d3 using real-ld
symlink, but that prevented switching between bfd and gold linkers.

Running compiler with debug arguments shows that collect2 tries and
fails to find linker using the multilib triples:

  $ $CC -v -Wl,-debug
  ...
  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'mips-oemllib32-linux-ld'
  Looking for 'mips-oe-linux-mips-oemllib32-linux-ld'
  ...
  collect2 version 12.2.0
  ld_file_name        = not found
  ...
  collect2: fatal error: cannot find ‘ld’

Using --with-plugin-ld=ld in gcc-cross-canadian builds to set default
linker name for collect2, lets it find the linker correctly:

  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'ld'
  ...
  collect2 version 12.2.0
  ld_file_name        = 
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/mips-oe-linux/gcc/mips-oe-linux/12.2.0/ld

Swith between bfd and gold linker works as expected now:

  $ $CC -v -Wl,-debug -fuse-ld=gold
  ...
  Looking for 'real-ld'
  Looking for 'collect-ld'
  Looking for 'ld.gold'
  ...
  collect2 version 12.2.0
  ld_file_name        = 
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/i686-oe-linux/gcc/i686-oe-linux/12.2.0/ld.gold

Signed-off-by: Samuli Piippo <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
(cherry picked from commit cf1bb16b7f9f81514feaf1e4ecffd9039387bb89)
Signed-off-by: Steve Sakoman <[email protected]>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc 
b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 38c972aa7c..c36e4cba81 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -9,6 +9,7 @@ GCCMULTILIB = "--enable-multilib"
 
 require gcc-configure-common.inc
 
+EXTRA_OECONF += "--with-plugin-ld=ld"
 EXTRA_OECONF_PATHS = "\
     --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
     
--with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin 
\
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171042): 
https://lists.openembedded.org/g/openembedded-core/message/171042
Mute This Topic: https://lists.openembedded.org/mt/93913045/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to