Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 684262f

Browse files
Revert "turn on objcopy by default for all targets"
This reverts commit e9f08e5. ClangBuiltLinux/linux#480 #164
1 parent b55baf4 commit 684262f

File tree

2 files changed

+3
-37
lines changed

2 files changed

+3
-37
lines changed

driver.sh

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
setup_variables() {
66
while [[ ${#} -ge 1 ]]; do
77
case ${1} in
8-
"AR="*|"ARCH="*|"CC="*|"LD="*|"NM"=*|"OBJCOPY"=*|"OBJDUMP"=*|"REPO="*) export "${1?}" ;;
8+
"AR="*|"ARCH="*|"CC="*|"LD="*|"NM"=*|"OBJDUMP"=*|"REPO="*) export "${1?}" ;;
99
"-c"|"--clean") cleanup=true ;;
1010
"-j"|"--jobs") shift; jobs=$1 ;;
1111
"-j"*) jobs=${1/-j} ;;
@@ -145,7 +145,7 @@ check_dependencies() {
145145
command -v ${readelf} &>/dev/null && break
146146
done
147147

148-
# Check for LD, CC, OBJCOPY, and AR environmental variables
148+
# Check for LD, CC, and AR environmental variables
149149
# and print the version string of each. If CC and AR
150150
# don't exist, try to find them.
151151
# lld isn't ready for all architectures so it's just
@@ -184,14 +184,6 @@ check_dependencies() {
184184
check_ar_version
185185
${AR} --version
186186

187-
if [[ -z "${OBJCOPY:-}" ]]; then
188-
for OBJCOPY in llvm-objcopy-9 llvm-objcopy-8 llvm-objcopy-7 llvm-objcopy "${CROSS_COMPILE:-}"objcopy; do
189-
command -v ${OBJCOPY} 2>/dev/null && break
190-
done
191-
fi
192-
check_ar_version
193-
${OBJCOPY} --version
194-
195187
if [[ -z "${NM:-}" ]]; then
196188
for NM in llvm-nm-9 llvm-nm-8 llvm-nm-7 llvm-nm "${CROSS_COMPILE:-}"nm; do
197189
command -v ${NM} 2>/dev/null && break
@@ -226,36 +218,14 @@ check_ar_version() {
226218
fi
227219
}
228220

229-
# Optimistically check to see that the user has a llvm-objcopy
230-
# with https://reviews.llvm.org/rL357017. If they don't,
231-
# fall back to GNU objcopy and let them know.
232-
check_objcopy_version() {
233-
if ${OBJCOPY} --version | grep -q "LLVM" && \
234-
[[ $(${OBJCOPY} --version | grep version | sed -e 's/.*LLVM version //g' -e 's/[[:blank:]]*$//' -e 's/\.//g' -e 's/svn//' ) -lt 900 ]]; then
235-
set +x
236-
echo
237-
echo "${OBJCOPY} found but appears to be too old to build the kernel (needs to be at least 9.0.0)."
238-
echo
239-
echo "Please either update llvm-objcopy from your distro or build it from source!"
240-
echo
241-
echo "See https://github.com/ClangBuiltLinux/linux/issues/418 for more info."
242-
echo
243-
echo "Falling back to GNU objcopy..."
244-
echo
245-
OBJCOPY=${CROSS_COMPILE:-}objcopy
246-
set -x
247-
fi
248-
}
249-
250221
mako_reactor() {
251222
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kbuild.txt
252223
time \
253224
KBUILD_BUILD_TIMESTAMP="Thu Jan 1 00:00:00 UTC 1970" \
254225
KBUILD_BUILD_USER=driver \
255226
KBUILD_BUILD_HOST=clangbuiltlinux \
256227
make -j"${jobs:-$(nproc)}" CC="${CC}" HOSTCC="${CC}" LD="${LD}" \
257-
HOSTLD="${HOSTLD:-ld}" AR="${AR}" NM="${NM}" OBJCOPY="${OBJCOPY}" \
258-
OBJDUMP="${OBJDUMP}" "${@}"
228+
HOSTLD="${HOSTLD:-ld}" AR="${AR}" NM="${NM}" OBJDUMP="${OBJDUMP}" "${@}"
259229
}
260230

261231
apply_patches() {

usage.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ Environment variables:
2121
clang-9, clang-8, clang-7, then clang if they are found in PATH.
2222
LD:
2323
If no LD value is specified, ${CROSS_COMPILE}ld is used. arm64 only.
24-
OBJCOPY:
25-
If no OBJCOPY value is specified, the script will attempt to set OBJCOPY
26-
to llvm-objcopy-9, llvm-objcopy-8, llvm-objcopy-7, llvm-objcopy, then
27-
${CROSS_COMPILE}objcopy if they are found in PATH.
2824
REPO:
2925
Nicknames for trees:
3026
linux (default)

0 commit comments

Comments
 (0)