Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2019 15:02:14 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r518658 - in head/Mk: . Uses
Message-ID:  <201911291502.xATF2E5L022436@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Fri Nov 29 15:02:14 2019
New Revision: 518658
URL: https://svnweb.freebsd.org/changeset/ports/518658

Log:
  Mk/bsd.port.mk: detect powerpc64 abi
  
  We'll have a new abi on ppc64 soon (ELFv2) which is incompatible with the ELFv1 abi. We need to detect the abi on which we build stuff.
  
  Submitted by:	mikael_urankar@gmail.com
  Approved by:	portmgr (earlier version)
  Differential Revision:	https://reviews.freebsd.org/D22039

Modified:
  head/Mk/Uses/cargo.mk
  head/Mk/Uses/php.mk
  head/Mk/Uses/qt-dist.mk
  head/Mk/bsd.gecko.mk
  head/Mk/bsd.port.mk

Modified: head/Mk/Uses/cargo.mk
==============================================================================
--- head/Mk/Uses/cargo.mk	Fri Nov 29 14:44:18 2019	(r518657)
+++ head/Mk/Uses/cargo.mk	Fri Nov 29 15:02:14 2019	(r518658)
@@ -74,7 +74,7 @@ RUSTFLAGS+=	${CFLAGS:M-march=*:S/-march=/-C target-cpu
 RUSTFLAGS+=	${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/}
 .endif
 
-.if ${ARCH} == powerpc64
+.if defined(PPC_ABI) && ${PPC_ABI} == ELFv1
 USE_GCC?=	yes
 .endif
 

Modified: head/Mk/Uses/php.mk
==============================================================================
--- head/Mk/Uses/php.mk	Fri Nov 29 14:44:18 2019	(r518657)
+++ head/Mk/Uses/php.mk	Fri Nov 29 15:02:14 2019	(r518658)
@@ -159,7 +159,7 @@ FLAVOR=	${FLAVORS:[1]}
 .    endif
 .  endif
 
-.if ${PHP_VER} == 74 && (${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64)
+.if ${PHP_VER} == 74 && (${ARCH:Mmips*} || (${ARCH:Mpowerpc*} && !exists(/usr/bin/clang)) || ${ARCH} == sparc64)
 USE_GCC=	yes
 .endif
 

Modified: head/Mk/Uses/qt-dist.mk
==============================================================================
--- head/Mk/Uses/qt-dist.mk	Fri Nov 29 14:44:18 2019	(r518657)
+++ head/Mk/Uses/qt-dist.mk	Fri Nov 29 15:02:14 2019	(r518658)
@@ -171,7 +171,7 @@ _EXTRA_PATCHES_QT5=	${PORTSDIR}/devel/${_QT_RELNAME}/f
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_qt__module.prf \
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_common_bsd_bsd.conf \
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-clang_qmake.conf
-.        if ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64
+.        if ${ARCH:Mmips*} || (${ARCH:Mpowerpc*} && !exists(/usr/bin/clang)) || ${ARCH} == sparc64
 _EXTRA_PATCHES_QT5+=	${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_g++-base.conf \
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_gcc-base.conf \
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-g++_qmake.conf

Modified: head/Mk/bsd.gecko.mk
==============================================================================
--- head/Mk/bsd.gecko.mk	Fri Nov 29 14:44:18 2019	(r518657)
+++ head/Mk/bsd.gecko.mk	Fri Nov 29 15:02:14 2019	(r518658)
@@ -321,7 +321,6 @@ LDFLAGS+=	-B${LOCALBASE}/bin
 .elif ${ARCH:Mpowerpc*}
 . if ${ARCH} == "powerpc64"
 MOZ_EXPORT+=	UNAME_m="${ARCH}"
-CFLAGS+=	-mminimal-toc
 . endif
 .elif ${ARCH} == "sparc64"
 # Work around miscompilation/mislinkage of the sCanonicalVTable hacks.

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Fri Nov 29 14:44:18 2019	(r518657)
+++ head/Mk/bsd.port.mk	Fri Nov 29 15:02:14 2019	(r518658)
@@ -1126,6 +1126,16 @@ ARCH=	${CROSS_TOOLCHAIN:C,-.*$,,}
 .endif
 _EXPORTED_VARS+=	ARCH
 
+.if ${ARCH} == powerpc64
+.  if !defined(PPC_ABI)
+PPC_ABI!=	${CC} -dM -E - < /dev/null | ${AWK} '/_CALL_ELF/{print "ELFv"$$3}'
+.    if ${PPC_ABI} != ELFv2
+PPC_ABI=	ELFv1
+.    endif
+.  endif
+_EXPORTED_VARS+=	PPC_ABI
+.endif
+
 # Get operating system versions for a cross build
 .if defined(CROSS_SYSROOT)
 .if !exists(${CROSS_SYSROOT}/usr/include/sys/param.h)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911291502.xATF2E5L022436>