Skip to content

Commit 2b2b0e1

Browse files
Merge branch 'arm' into 'master'
Fix ARM support See merge request nvidia/container-toolkit/libnvidia-container!10
2 parents 8510a4b + 9abb2ac commit 2b2b0e1

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

mk/Dockerfile.centos

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ENV WITH_SECCOMP=${WITH_SECCOMP}
2828
RUN if [ "$WITH_LIBELF" = "no" ]; then \
2929
arch=$(uname -m) && \
3030
cd $(mktemp -d) && \
31-
curl -fsSL -O https://mirrors.kernel.org/mageia/distrib/6/${arch}/media/core/release/pmake-1.45-16.mga6.${arch}.rpm && \
32-
curl -fsSL -O https://mirrors.kernel.org/mageia/distrib/6/${arch}/media/core/release/bmake-20161212-1.mga6.${arch}.rpm && \
31+
curl -fsSL -O https://mirrors.kernel.org/mageia/distrib/7.1/${arch}/media/core/release/pmake-1.45-17.mga7.${arch}.rpm && \
32+
curl -fsSL -O https://mirrors.kernel.org/mageia/distrib/7.1/${arch}/media/core/release/bmake-20181221-1.mga7.${arch}.rpm && \
3333
rpm -i *.rpm && \
3434
rm -rf $PWD \
3535
; fi

mk/common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ getarch = $(shell [ -f /etc/debian_version ] && echo "amd64" || echo "x86_64")
4444
else ifeq ($(PLATFORM),ppc64le)
4545
getarch = $(shell [ -f /etc/debian_version ] && echo "ppc64el" || echo "ppc64le")
4646
else ifeq ($(PLATFORM),aarch64)
47-
getarch = $(shell [ -f /etc/debian_version ] && echo "arm64")
47+
getarch = $(shell [ -f /etc/debian_version ] && echo "arm64" || echo "aarch64")
4848
else
4949
$(error Unsupported architecture)
5050
endif

mk/elftoolchain.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ $(SRCS_DIR)/.download_stamp:
3636
$(MKDIR) -p $(SRCS_DIR)
3737
$(CURL) --progress-bar -fSL $(URL) | \
3838
$(TAR) -C $(SRCS_DIR) --strip-components=1 -xj $(addprefix $(PREFIX)/,mk common libelf)
39+
$(CP) $(MAKE_DIR)/native-elf-format $(COMMON)
3940
@touch $@
4041

4142
$(SRCS_DIR)/.build_stamp: $(SRCS_DIR)/.download_stamp

mk/native-elf-format

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/sh
2+
#
3+
# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $
4+
#
5+
# Find the native ELF format for a host platform by compiling a
6+
# test object and examining the resulting object.
7+
#
8+
# This script is used if there is no easy way to determine this
9+
# information statically at compile time.
10+
11+
program=`basename $0`
12+
tmp_c=`mktemp -u nefXXXXXX`.c
13+
tmp_o=`echo ${tmp_c} | sed -e 's/.c$/.o/'`
14+
15+
trap "rm -f ${tmp_c} ${tmp_o}" 0 1 2 3 15
16+
17+
touch ${tmp_c}
18+
19+
echo "/* Generated by ${program} on `date` */"
20+
21+
cc -c ${tmp_c} -o ${tmp_o}
22+
LC_ALL=C readelf -h ${tmp_o} | awk '
23+
$1 ~ "Class:" {
24+
sub("ELF","",$2); elfclass = $2;
25+
}
26+
$1 ~ "Data:" {
27+
if (match($0, "little")) {
28+
elfdata = "LSB";
29+
} else {
30+
elfdata = "MSB";
31+
}
32+
}
33+
$1 ~ "Machine:" {
34+
if (match($0, "Intel.*386")) {
35+
elfarch = "EM_386";
36+
} else if (match($0, "MIPS")) {
37+
elfarch = "EM_MIPS";
38+
} else if (match($0, ".*[xX]86-64")) {
39+
elfarch = "EM_X86_64";
40+
} else if (match($0, "AArch64")) {
41+
elfarch = "EM_X86_64";
42+
} else {
43+
elfarch = "unknown";
44+
}
45+
}
46+
END {
47+
printf("#define ELFTC_CLASS ELFCLASS%s\n", elfclass);
48+
printf("#define ELFTC_ARCH %s\n", elfarch);
49+
printf("#define ELFTC_BYTEORDER ELFDATA2%s\n", elfdata);
50+
}'
51+

0 commit comments

Comments
 (0)