Skip to content

Commit 6a726cb

Browse files
committed
Merge #20963: gitian-linux: Build binaries for 64-bit POWER (continued)
543bf74 gitian-linux: Extend noexec-stack workaround to powerpc (Wladimir J. van der Laan) 00f67c8 gitian-linux: Build binaries for 64-bit POWER (Luke Dashjr) 63fc2b1 gitian: Properly quote arguments in wrappers (Luke Dashjr) 798bc0b Support glibc-back-compat on 64-bit POWER (Luke Dashjr) Pull request description: Rebase of #14066 by luke-jr. Let's try to get PowerPC support in in the beginning of the 22.0 cycle so that it gets some testing, and is not a last-minute decision this time, like for last … 2 or 3 major versions. The symbol/security tooling-related changes have been dropped since they were part of #20434. Top commit has no ACKs. Tree-SHA512: df0f8cd320c90f359f8b512c5cb8b59bb277516b57a05482cc8923c656106513b7428e315aaa8ab53e0bd6f80556b07d3639c47f6d9913bcfbfe388b39ef47c4
2 parents 80e16ca + 543bf74 commit 6a726cb

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ AX_GCC_FUNC_ATTRIBUTE([dllimport])
813813
if test x$use_glibc_compat != xno; then
814814
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
815815
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
816+
case $host in
817+
powerpc64* | ppc64*)
818+
AX_CHECK_LINK_FLAG([[-Wl,--no-tls-get-addr-optimize]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--no-tls-get-addr-optimize"])
819+
;;
820+
esac
816821
else
817822
AC_SEARCH_LIBS([clock_gettime],[rt])
818823
fi

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ packages:
2727
# - aarch64-linux-gnu
2828
- "binutils-aarch64-linux-gnu"
2929
- "g++-8-aarch64-linux-gnu"
30+
# - powerpc64-linux-gnu
31+
- "binutils-powerpc64-linux-gnu"
32+
- "g++-8-powerpc64-linux-gnu"
33+
# - powerpc64le-linux-gnu
34+
- "binutils-powerpc64le-linux-gnu"
35+
- "g++-8-powerpc64le-linux-gnu"
3036
# - riscv64-linux-gnu
3137
- "binutils-riscv64-linux-gnu"
3238
- "g++-8-riscv64-linux-gnu"
@@ -38,7 +44,7 @@ script: |
3844
set -e -o pipefail
3945
4046
WRAP_DIR=$HOME/wrapped
41-
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
47+
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu riscv64-linux-gnu"
4248
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
4349
FAKETIME_HOST_PROGS="gcc g++"
4450
FAKETIME_PROGS="date ar ranlib nm"
@@ -64,7 +70,7 @@ script: |
6470
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
6571
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
6672
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
67-
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
73+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${prog}
6874
chmod +x ${WRAP_DIR}/${prog}
6975
done
7076
}
@@ -78,7 +84,13 @@ script: |
7884
echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
7985
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
8086
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
81-
echo "\$REAL \"\$@\"" >> $WRAP_DIR/${i}-${prog}
87+
if [ "${i:0:11}" = "powerpc64le" ]; then
88+
echo "exec \"\$REAL\" -mcpu=power8 -mtune=power9 \"\$@\"" >> $WRAP_DIR/${i}-${prog}
89+
elif [ "${i:0:9}" = "powerpc64" ]; then
90+
echo "exec \"\$REAL\" -mcpu=970 -mtune=power9 \"\$@\"" >> $WRAP_DIR/${i}-${prog}
91+
else
92+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
93+
fi
8294
chmod +x ${WRAP_DIR}/${i}-${prog}
8395
fi
8496
done
@@ -118,7 +130,7 @@ script: |
118130
# Extract the git archive into a dir for each host and build
119131
for i in ${HOSTS}; do
120132
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
121-
if [ "${i}" = "riscv64-linux-gnu" ]; then
133+
if [ "${i}" = "riscv64-linux-gnu" ] || [ "${i}" = "powerpc64-linux-gnu" ] || [ "${i}" = "powerpc64le-linux-gnu" ]; then
122134
# Workaround for https://bugs.launchpad.net/ubuntu/+source/gcc-8-cross-ports/+bug/1853740
123135
# TODO: remove this when no longer needed
124136
HOST_LDFLAGS="${HOST_LDFLAGS_BASE} -Wl,-z,noexecstack"

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ script: |
3131
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
3232
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
3333
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
34-
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
34+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${prog}
3535
chmod +x ${WRAP_DIR}/${prog}
3636
done
3737

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ script: |
6363
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
6464
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
6565
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
66-
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
66+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${prog}
6767
chmod +x ${WRAP_DIR}/${prog}
6868
done
6969
}
@@ -75,7 +75,7 @@ script: |
7575
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
7676
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
7777
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
78-
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
78+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
7979
chmod +x ${WRAP_DIR}/${i}-${prog}
8080
done
8181
done

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ script: |
5555
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
5656
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
5757
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
58-
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
58+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${prog}
5959
chmod +x ${WRAP_DIR}/${prog}
6060
done
6161
}
@@ -67,7 +67,7 @@ script: |
6767
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
6868
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
6969
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
70-
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
70+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
7171
chmod +x ${WRAP_DIR}/${i}-${prog}
7272
done
7373
done
@@ -81,7 +81,7 @@ script: |
8181
echo "REAL=\`which -a ${i}-${prog}-posix | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
8282
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
8383
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
84-
echo "\$REAL \"\$@\"" >> $WRAP_DIR/${i}-${prog}
84+
echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
8585
chmod +x ${WRAP_DIR}/${i}-${prog}
8686
done
8787
done

src/compat/glibc_compat.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ __asm(".symver log2f_old,log2f@GLIBC_2.2.5");
5454
__asm(".symver log2f_old,log2f@GLIBC_2.4");
5555
#elif defined(__aarch64__)
5656
__asm(".symver log2f_old,log2f@GLIBC_2.17");
57+
#elif defined(__powerpc64__)
58+
# ifdef WORDS_BIGENDIAN
59+
__asm(".symver log2f_old,log2f@GLIBC_2.3");
60+
# else
61+
__asm(".symver log2f_old,log2f@GLIBC_2.17");
62+
# endif
5763
#elif defined(__riscv)
5864
__asm(".symver log2f_old,log2f@GLIBC_2.27");
5965
#endif

0 commit comments

Comments
 (0)