Closed Bug 1758741 Opened 3 years ago Closed 3 years ago

direct usage of 'ld' in Makefile causes cross-platform builds to fail

Categories

(NSS :: Build, defect, P3)

3.68

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lziest, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; CrOS x86_64 14388.61.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.107 Safari/537.36

Steps to reproduce:

In a ChromiumOS chroot developement environment, do
emerge dev-libs/nss with one of the latest nss version.

Actual results:

Build failures:

  • ld: ERROR: Do not call unprefixed tools directly.
  • ld: ERROR: For board tools, use tc-export LD (or ${CHOST}-ld).
  • ld: ERROR: For build-time-only tools, tc-export BUILD_LD (or ${CBUILD}-ld).
  • cros_sdk/307868
  • `-python3 /usr/local/google/home/lziest/chromiumos/chromite/bin/cros_sdk
  •   `-bash
    
  •       `-emerge -b /usr/lib/python-exec/python3.6/emerge dev-libs/nss
    
  •           `-sandbox /usr/lib/portage/python3.6/ebuild.sh compile
    
  •               `-ebuild.sh /usr/lib/portage/python3.6/ebuild.sh compile
    
  •                   `-ebuild.sh /usr/lib/portage/python3.6/ebuild.sh compile
    
  •                       `-emake /usr/lib/portage/python3.6/ebuild-helpers/emake -j1 CC=x86_64-pc-linux-gnu-clang CCC=x86_64-pc-linux-gnu-clang++ LD=x86_64-pc-linux-gnu-ld.lld AR=llvm-ar rc $@ RANLIB=llvm-ranlib OPTIMIZER= USE_64=1 NSINSTALL=/var/tmp/portage/dev-libs/nss-3.68.2/work/nss-3.68.2/nss-abi_x86_64.amd64/./coreconf/nsinstall/Linux5.14_x86_64_clang-14_glibc_PTH_64_OPT.OBJ/nsinstall -C . OS_TEST=x86_64
    
  •                           `-make -j48 -j1 CC=x86_64-pc-linux-gnu-clang CCC=x86_64-pc-linux-gnu-clang++ LD=x86_64-pc-linux-gnu-ld.lld AR=llvm-ar rc $@ RANLIB=llvm-ranlib OPTIMIZER= USE_64=1 NSINSTALL=/var/tmp/portage/dev-libs/nss-3.68.2/work/nss-3.68.2/nss-abi_x86_64.amd64/./coreconf/nsinstall/Linux5.14_x86_64_clang-14_glibc_PTH_64_OPT.OBJ/nsinstall -C . OS_TEST=x86_64
    
  •                               `-make all
    
  •                                   `-make libs
    
  •                                       `-sh -c if [ "lib" != "." ]; then \
    
  •  make -C lib libs ; \
    
  • else \
  •  IGNORE_DIRS=1 make -C lib libs ; \
    
  • fi
  •                                           `-make -C lib libs
    
  •                                               `-sh -c if [ "util" != "." ]; then \
    
  •  make -C util libs ; \
    
  • else \
  •  IGNORE_DIRS=1 make -C util libs ; \
    
  • fi
  •                                                   `-make -C util libs
    
  •                                                       `-ld /var/tmp/portage/dev-libs/nss-3.68.2/temp/build-toolchain-wrappers/ld -v
    
  •                                                           `-pstree -a -A -s -l 33926
    
  • ERROR: dev-libs/nss-3.68.2::chromiumos failed (compile phase):
  • Bad ld [-v] invocation

Expected results:

Build succeed without error.

Related gentoo bug: https://bugs.gentoo.org/834846

I have a simple patch that works for me.

Thanks for the patch Zi Lin! LGTM and I've submitted it to Phab on your behalf.

Note: The mercurial commit author field is correct but Phab doesn't have a user account for you. If you login to Phab with your Bugzilla account, I can correct the metadata.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Severity: -- → S4
Priority: -- → P3

Dennis and Takanori, thank you very much!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: