diff --git a/base/Dockerfile b/base/Dockerfile index 87a5379..f85b0d0 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -255,7 +255,7 @@ RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$BINUTILS_CFLAGS" CXXFLAGS="$BINUT tar xf binutils-${BINUTILS_VERSION}.tar.gz && \ cd binutils-${BINUTILS_VERSION} && \ for f in ../patches/*; do patch -p1 < $f; done && \ - ./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETDUPLE=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib $BINUTILS_CONFIG && \ + ./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETPAIR=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib $BINUTILS_CONFIG && \ make -j $(nproc) && \ make install && \ cd .. && rm -rf binutils-${BINUTILS_VERSION} && \ @@ -269,7 +269,7 @@ ARG LD_TARGET ARG LD_CFLAGS="-Wl,-s -Os" # BINUTILS_CONFIG defines extra options passed to binutils configure script ARG BINUTILS_CONFIG= -RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$LD_CFLAGS --static" CXXFLAGS="$LD_CFLAGS" LD_TARGET=$(TARGETPLATFORM= TARGETDUPLE=$LD_TARGET xx-info) && \ +RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$LD_CFLAGS --static" CXXFLAGS="$LD_CFLAGS" LD_TARGET=$(TARGETPLATFORM= TARGETPAIR=$LD_TARGET xx-info) && \ tar xf binutils-${BINUTILS_VERSION}.tar.gz && \ cd binutils-${BINUTILS_VERSION} && \ for f in ../patches/*; do patch -p1 < $f; done && \ diff --git a/base/test-info-common.bats b/base/test-info-common.bats index 4247c88..05d325b 100755 --- a/base/test-info-common.bats +++ b/base/test-info-common.bats @@ -76,28 +76,28 @@ load 'assert' assert_equal "ppc64le" "$(TARGETPLATFORM=linux/ppc64le xx-info march)" } -@test "parse duple" { - TARGETDUPLE=linux-amd64 run xx-info os +@test "parse pair" { + TARGETPAIR=linux-amd64 run xx-info os assert_success assert_output "linux" - TARGETDUPLE=linux-arm64 run xx-info arch + TARGETPAIR=linux-arm64 run xx-info arch assert_success assert_output "arm64" - TARGETDUPLE=linux-armv7 run xx-info arch + TARGETPAIR=linux-armv7 run xx-info arch assert_success assert_output "arm" - TARGETDUPLE=linux-armv7 run xx-info + TARGETPAIR=linux-armv7 run xx-info assert_success assert_output "$(TARGETPLATFORM=linux/arm xx-info)" - TARGETDUPLE=linux-armv5 run xx-info + TARGETPAIR=linux-armv5 run xx-info assert_success assert_output "$(TARGETPLATFORM=linux/arm/v5 xx-info)" - TARGETDUPLE=linux-ppc64le run xx-info + TARGETPAIR=linux-ppc64le run xx-info assert_success assert_output "$(TARGETPLATFORM=linux/ppc64le xx-info)" } diff --git a/base/xx-info b/base/xx-info index 2dc0492..26b4a78 100755 --- a/base/xx-info +++ b/base/xx-info @@ -39,12 +39,12 @@ EOT set -e -# TARGETDUPLE is an optional alternative format $TARGETOS-$TARGETARCH$TARGETVARIANT, eg linux-amd64, linux-armv7 +# TARGETPAIR is an optional alternative format $TARGETOS-$TARGETARCH$TARGETVARIANT, eg linux-amd64, linux-armv7 # This format is recommended to be used in image and binary names where slashes are not allowed. # Architecture and variant component are not separated with a dash to automatically handle empty value. -if [ -n "$TARGETDUPLE" ]; then - os="$(echo $TARGETDUPLE | cut -d"-" -f1)" - arch="$(echo $TARGETDUPLE | cut -d"-" -f2)" +if [ -n "$TARGETPAIR" ]; then + os="$(echo $TARGETPAIR | cut -d"-" -f1)" + arch="$(echo $TARGETPAIR | cut -d"-" -f2)" if [ "${arch#armv}" != "${arch}" ]; then variant="${arch#arm}" arch="arm"