#!/bin/sh
#
# sunld-kernel.sh — invoke the illumos native linker for kernel builds
# with LD_ALTEXEC cleared.
#
# On self-hosted Hammerhead, LD_ALTEXEC is set by env/hammerhead.sh to
# /usr/bin/gnu-ld-wrapper so user-space gcc/collect2 uses GNU ld with
# flag translation.  The kernel must use sunld directly and honor
# LOAD_SEGMENT mapfiles (which the wrapper drops).  `unexport` alone
# doesn't reliably remove the variable from recipe subshells, so we
# clear it here explicitly before exec'ing sunld.
#
unset LD_ALTEXEC
exec /usr/bin/sunld "$@"
