common: add ppc64 build profiles and other ppc64 bits

This adds the build profiles for ppc64 targets as well as
modifications in other parts of the infra.

These targets are supported:

- ppc64le (glibc little endian elfv2)
- ppc64le-musl (musl little endian)
- ppc64-musl (musl big endian)

ELFv1 targets are explicitly not supported at this point.

Big endian musl supports ppc 970 or newer, while little endian
targets are set to a generic powerpc64le which effectively means
POWER8 and newer. Tuning is always set for POWER9, which is the
most likely target hardware. We also make sure AltiVec is always
on, because it is supported on all hardware we target.

[ci skip]
This commit is contained in:
q66 2019-01-01 00:24:00 +01:00 committed by Enno Boland
parent b1b1bb2905
commit 151f876627
13 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,5 @@
XBPS_TARGET_CFLAGS="-mcpu=970 -mtune=power9 -maltivec -mlong-double-64 -mabi=elfv2"
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
XBPS_TARGET_FFLAGS=""
XBPS_TRIPLET="powerpc64-unknown-linux-musl"
XBPS_RUST_TARGET="$XBPS_TRIPLET"

View File

@ -0,0 +1,5 @@
XBPS_TARGET_CFLAGS="-mcpu=powerpc64le -mtune=power9 -maltivec -mlong-double-64 -mabi=elfv2"
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
XBPS_TARGET_FFLAGS=""
XBPS_TRIPLET="powerpc64le-unknown-linux-musl"
XBPS_RUST_TARGET="$XBPS_TRIPLET"

View File

@ -0,0 +1,5 @@
XBPS_TARGET_CFLAGS="-mcpu=powerpc64le -mtune=power9 -maltivec -mabi=elfv2"
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
XBPS_TARGET_FFLAGS=""
XBPS_TRIPLET="powerpc64le-unknown-linux-gnu"
XBPS_RUST_TARGET="$XBPS_TRIPLET"

View File

@ -13,6 +13,8 @@ do_configure() {
aarch64*) _CMAKE_SYSTEM_PROCESSOR=aarch64 ;;
arm*) _CMAKE_SYSTEM_PROCESSOR=arm ;;
mips*) _CMAKE_SYSTEM_PROCESSOR=mips ;;
ppc64le*) _CMAKE_SYSTEM_PROCESSIR=ppc64le ;;
ppc64*) _CMAKE_SYSTEM_PROCESSOR=ppc64 ;;
*) _CMAKE_SYSTEM_PROCESSOR=generic ;;
esac
if [ -x "${XBPS_CROSS_BASE}/usr/bin/wx-config-gtk3" ]; then

View File

@ -21,6 +21,13 @@ do_configure() {
i686*)
_MESON_CPU_FAMILY=x86
;;
ppc64le)
_MESON_CPU_FAMILY=ppc64
;;
ppc64)
_MESON_TARGET_ENDIAN=big
_MESON_CPU_FAMILY=ppc64
;;
*)
# if we reached here that means that the cpu and cpu_family
# are the same like 'x86_64' and 'aarch64'

View File

@ -0,0 +1,9 @@
# Cross build profile for ppc64 big-endian musl.
XBPS_TARGET_MACHINE="ppc64-musl"
XBPS_CROSS_TRIPLET="powerpc64-linux-musl"
XBPS_CROSS_CFLAGS="-mcpu=970 -mtune=power9 -maltivec -mlong-double-64 -mabi=elfv2"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
XBPS_CROSS_FFLAGS=""
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
XBPS_CROSS_RUST_TARGET="powerpc64-unknown-linux-musl"

View File

@ -0,0 +1,9 @@
# Cross build profile for ppc64 little-endian musl.
XBPS_TARGET_MACHINE="ppc64le-musl"
XBPS_CROSS_TRIPLET="powerpc64le-linux-musl"
XBPS_CROSS_CFLAGS="-mcpu=powerpc64le -mtune=power9 -maltivec -mlong-double-64 -mabi=elfv2"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
XBPS_CROSS_FFLAGS=""
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
XBPS_CROSS_RUST_TARGET="powerpc64le-unknown-linux-musl"

View File

@ -0,0 +1,9 @@
# Cross build profile for ppc64 little-endian GNU.
XBPS_TARGET_MACHINE="ppc64le"
XBPS_CROSS_TRIPLET="powerpc64le-linux-gnu"
XBPS_CROSS_CFLAGS="-mcpu=powerpc64le -mtune=power9 -maltivec -mabi=elfv2"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
XBPS_CROSS_FFLAGS=""
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
XBPS_CROSS_RUST_TARGET="powerpc64le-unknown-linux-gnu"

View File

@ -8,6 +8,8 @@ case "$XBPS_TARGET_MACHINE" in
armv7*) export GOARCH=arm; export GOARM=7;;
i686*) export GOARCH=386;;
x86_64*) export GOARCH=amd64;;
ppc64le*) export GOARCH=ppc64le;;
ppc64*) export GOARCH=ppc64;;
esac
export GOPATH="${wrksrc}/_build-${pkgname}-xbps"

View File

@ -0,0 +1,14 @@
# glib
ac_cv_alignof_guint32=4
ac_cv_alignof_guint64=8
ac_cv_alignof_unsigned_long=4
# at-spi2-core
ac_cv_alignof_char=1
ac_cv_alignof_dbind_pointer=4
ac_cv_alignof_dbind_struct=1
ac_cv_alignof_dbus_bool_t=4
ac_cv_alignof_dbus_int16_t=2
ac_cv_alignof_dbus_int32_t=4
ac_cv_alignof_dbus_int64_t=8
ac_cv_alignof_double=8

View File

@ -0,0 +1,16 @@
# general
ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
# startup-notification
lf_cv_sane_realloc=yes
# glib
glib_cv_stack_grows=${glib_cv_stack_grows=no}
glib_cv_uscore=${glib_cv_uscore=no}
glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
# lftp
lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
# slrn
slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}

View File

@ -0,0 +1,41 @@
ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=8}
ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=8}
ac_cv_sizeof_unsigned_long_int=${ac_cv_sizeof_unsigned_long_int=8}
ac_cv_sizeof_unsigned_long_long_int=${ac_cv_sizeof_unsigned_long_long_int=8}
ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
ac_cv_sizeof_unsigned_short_int=${ac_cv_sizeof_unsigned_short_int=2}
ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
# screen
screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
# libpcap
ac_cv_linux_vers=${ac_cv_linux_vers=2}
# apr
apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
# cvs
cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}

View File

@ -87,6 +87,20 @@ case "$XBPS_TARGET_MACHINE" in
. ${_AUTOCONFCACHEDIR}/x86_64-linux
;;
ppc64le*)
. ${_AUTOCONFCACHEDIR}/endian-little
. ${_AUTOCONFCACHEDIR}/powerpc-common
. ${_AUTOCONFCACHEDIR}/powerpc-linux
. ${_AUTOCONFCACHEDIR}/powerpc64-linux
;;
ppc64*)
. ${_AUTOCONFCACHEDIR}/endian-big
. ${_AUTOCONFCACHEDIR}/powerpc-common
. ${_AUTOCONFCACHEDIR}/powerpc-linux
. ${_AUTOCONFCACHEDIR}/powerpc64-linux
;;
*) ;;
esac