Add a MULTILIB option to gcc{,48,49,5} for powerpc64

This change is the same as r400632, which updated gcc[56]-devel, but now
for gcc{,48,49,5}.  Waited a week to ensure the change caused nothing to go
horribly wrong but this change is very low risk because it only affects
powerpc64.

This fixes the build of gcc{,48,49,5} under powerpc64 when the system
is built without the lib32 libraries.

More in detail:

If the system is built with lib32 support (WITH_LIB32, which is the default),
building gcc from ports results in a compiler that can target both 64-bit and
32-bit binaries on powerpc64.  However, when lib32 support is disabled
(WITHOUT_LIB32), gcc should only be built with 64-bit support or otherwise
the build fails.

To fix this, explicitly disable 32-bit support when /usr/lib32 is not present
and add a MULTILIB option (which is only defined for powerpc64 when 32-bit
support is possible and defaults to yes to preserve the current behavior) to
allow the user to explicitly control this feature.

Approved by:    gerald (maintainer), bdrewery (mentor), andreast
Differential Revision:  https://reviews.freebsd.org/D3952
This commit is contained in:
Julio Merino 2015-11-08 20:09:59 +00:00
parent ba70851ecb
commit c6b41d9541
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=401072
4 changed files with 37 additions and 1 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= gcc PORTNAME= gcc
PORTVERSION= 4.8.5 PORTVERSION= 4.8.5
PORTREVISION= 1
CATEGORIES= lang java CATEGORIES= lang java
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} MASTER_SITES= GCC/releases/gcc-${DISTVERSION}
@ -46,6 +47,14 @@ OPTIONS_DEFAULT_i386= JAVA
OPTIONS_DEFAULT_amd64= JAVA OPTIONS_DEFAULT_amd64= JAVA
OPTIONS_EXCLUDE_DragonFly= JAVA OPTIONS_EXCLUDE_DragonFly= JAVA
BOOTSTRAP_DESC= Build using a full bootstrap BOOTSTRAP_DESC= Build using a full bootstrap
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE+= MULTILIB
OPTIONS_DEFAULT+= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit target types
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>

View file

@ -3,6 +3,7 @@
PORTNAME= gcc PORTNAME= gcc
PORTVERSION= 4.8.5 PORTVERSION= 4.8.5
PORTREVISION= 1
CATEGORIES= lang java CATEGORIES= lang java
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} MASTER_SITES= GCC/releases/gcc-${DISTVERSION}
PKGNAMESUFFIX= ${SUFFIX} PKGNAMESUFFIX= ${SUFFIX}
@ -49,6 +50,14 @@ OPTIONS_DEFAULT_i386= JAVA
OPTIONS_DEFAULT_amd64= JAVA OPTIONS_DEFAULT_amd64= JAVA
OPTIONS_EXCLUDE_DragonFly= JAVA OPTIONS_EXCLUDE_DragonFly= JAVA
BOOTSTRAP_DESC= Build using a full bootstrap BOOTSTRAP_DESC= Build using a full bootstrap
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE+= MULTILIB
OPTIONS_DEFAULT+= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit target types
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>

View file

@ -3,6 +3,7 @@
PORTNAME= gcc PORTNAME= gcc
PORTVERSION= 4.9.4.s20151028 PORTVERSION= 4.9.4.s20151028
PORTREVISION= 1
CATEGORIES= lang java CATEGORIES= lang java
MASTER_SITES= GCC/snapshots/${DISTVERSION} MASTER_SITES= GCC/snapshots/${DISTVERSION}
PKGNAMESUFFIX= ${SUFFIX} PKGNAMESUFFIX= ${SUFFIX}
@ -50,6 +51,14 @@ OPTIONS_DEFAULT_i386= JAVA
OPTIONS_DEFAULT_amd64= JAVA OPTIONS_DEFAULT_amd64= JAVA
OPTIONS_EXCLUDE_DragonFly= JAVA OPTIONS_EXCLUDE_DragonFly= JAVA
BOOTSTRAP_DESC= Build using a full bootstrap BOOTSTRAP_DESC= Build using a full bootstrap
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE+= MULTILIB
OPTIONS_DEFAULT+= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit target types
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>

View file

@ -3,7 +3,7 @@
PORTNAME= gcc PORTNAME= gcc
PORTVERSION= 5.2.0 PORTVERSION= 5.2.0
PORTREVISION= 1 PORTREVISION= 2
CATEGORIES= lang java CATEGORIES= lang java
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} MASTER_SITES= GCC/releases/gcc-${DISTVERSION}
PKGNAMESUFFIX= ${SUFFIX} PKGNAMESUFFIX= ${SUFFIX}
@ -52,6 +52,15 @@ OPTIONS_DEFAULT_amd64= JAVA
OPTIONS_EXCLUDE_DragonFly= JAVA OPTIONS_EXCLUDE_DragonFly= JAVA
BOOTSTRAP_DESC= Build using a full bootstrap BOOTSTRAP_DESC= Build using a full bootstrap
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE_powerpc64= MULTILIB
OPTIONS_DEFAULT_powerpc64= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit targets
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>
.if ${ARCH} == "amd64" .if ${ARCH} == "amd64"