From owner-freebsd-ports-bugs@freebsd.org Tue Sep 1 11:16:21 2020 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 902053C29B1 for ; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bgkz93KgTz4M2Y for ; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 723C53C29B0; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) Delivered-To: ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 720753C27E6 for ; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bgkz92VSSz4LlN for ; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39283180D3 for ; Tue, 1 Sep 2020 11:16:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 081BGLjQ015227 for ; Tue, 1 Sep 2020 11:16:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 081BGLRR015226 for ports-bugs@FreeBSD.org; Tue, 1 Sep 2020 11:16:21 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 249049] amd64-binutils: ld.bfd searches amd64 paths when linking i386 Date: Tue, 01 Sep 2020 11:16:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: arichardson@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2020 11:16:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249049 Bug ID: 249049 Summary: amd64-binutils: ld.bfd searches amd64 paths when linking i386 Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: arichardson@FreeBSD.org I was trying to run the llvm compiler-rt testsuite and noticed that I was getting lots of linker failures like this:=20 /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: warning: libelf.so.2, nee= ded by /usr/lib32/libexecinfo.so, not found (try using -rpath or -rpath-link) /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `gelf_getshdr@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `gelf_getsym@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_errmsg@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_nextscn@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_end@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_strptr@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_begin@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_errno@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_version@R1.0' /usr/local/bin/x86_64-unknown-freebsd12.1-ld.bfd: /usr/lib32/libexecinfo.so: undefined reference to `elf_getdata@R1.0' Linking with --verbose gives the following interesting output: attempt to open /usr/lib32/crtn.o succeeded /usr/lib32/crtn.o libelf.so.2 needed by /usr/lib32/libexecinfo.so attempt to open /usr/lib/libelf.so.2 failed attempt to open /usr/lib/compat/libelf.so.2 failed attempt to open /usr/local/lib/libelf.so.2 failed attempt to open /usr/local/lib/compat/pkg/libelf.so.2 failed attempt to open /usr/local/lib/compat/libelf.so.2 failed attempt to open /usr/local/lib/gcc9/libelf.so.2 failed attempt to open /usr/local/lib/perl5/5.28/mach/CORE/libelf.so.2 failed attempt to open /usr/local/lib/perl5/5.32/mach/CORE/libelf.so.2 failed attempt to open /usr/local/lib/samba4/libelf.so.2 failed attempt to open /usr/local/llvm-devel/lib/libelf.so.2 failed attempt to open /usr/local/llvm10/lib/libelf.so.2 failed attempt to open /usr/local/llvm80/lib/libelf.so.2 failed attempt to open /usr/local/llvm90/lib/libelf.so.2 failed attempt to open /usr/local/i386-unknown-freebsd12.1/lib/libelf.so.2 failed attempt to open /usr/lib/libelf.so.2 failed attempt to open /usr/local/lib/libelf.so.2 failed attempt to open /usr/lib/libelf.so.2 failed attempt to open /usr/lib/compat/libelf.so.2 failed attempt to open /usr/local/lib/libelf.so.2 failed attempt to open /usr/local/lib/compat/pkg/libelf.so.2 failed attempt to open /usr/local/lib/compat/libelf.so.2 failed attempt to open /usr/local/lib/gcc9/libelf.so.2 failed attempt to open /usr/local/lib/perl5/5.28/mach/CORE/libelf.so.2 failed attempt to open /usr/local/lib/perl5/5.32/mach/CORE/libelf.so.2 failed attempt to open /usr/local/lib/samba4/libelf.so.2 failed attempt to open /usr/local/llvm-devel/lib/libelf.so.2 failed attempt to open /usr/local/llvm10/lib/libelf.so.2 failed attempt to open /usr/local/llvm80/lib/libelf.so.2 failed attempt to open /usr/local/llvm90/lib/libelf.so.2 failed attempt to open /usr/local/i386-unknown-freebsd12.1/lib/libelf.so.2 failed attempt to open /usr/lib/libelf.so.2 failed attempt to open /usr/local/lib/libelf.so.2 failed Running ktrace+kdump showed me that ld.bfd was reading /var/run/ld-elf.so.h= ints instead of /var/run/ld-elf32.so.hints when resolving DT_NEEDED entries, whi= ch explains this rather odd path list that does not include the -L directories. Adding -lelf works around this linker error but is IMO not the correct fix since it also affects all other implicit dependencies. BFD should be reading /var/run/ld-elf32.so.hints for i386 targets on amd64 and/or also looking in the SEARCH_DIR() entries. Example command: /home/alr48/obj/build/upstream-llvm-project-build/./bin/clang -gline-tables-only -fsanitize=3Dundefined -m32 /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/test/sanitiz= er_common/TestCases/wcrtomb.c -o /home/alr48/obj/build/upstream-llvm-project-build/projects/compiler-rt/test= /sanitizer_common/ubsan-i386-FreeBSD/Output/wcrtomb.c.tmp -v --=20 You are receiving this mail because: You are the assignee for the bug.=