Skip to content

5.40.0 onwards won't build Darwin fat binaries #22466

Open
@gsteemso

Description

@gsteemso

Description
All Perls which I have built thus far will correctly build as NeXT-style fat (multi-architecture) binaries when the directions in README.macosx are followed – except the newest ones, beginning with version 5.40.0, which fail messily at the make step (apparently, by applying the variable-size expectations appropriate to 64-bit sub-builds to the corresponding variables in 32-bit sub-builds). It generates thousands of lines of compiler warnings that a bit shift has exceeded the width of the data type, culminating in a fatal error involving a negative bit-field width.

Steps to Reproduce
Follow the instructions in README.macosx. Run ./Configure, then make. You can’t run make test and make install because it errors out during make.

The ./Configure line I used was:

Prefix=/Users/gsteemso/devel/perl/built/5.40.0u
Sdk=/Developer/SDKs/MacOSX10.5.sdk
./Configure -des -Dprefix=${Prefix} -Uvendorprefix= -Dprivlib=${Prefix}/lib -Darchlib=${Prefix}/lib -Dman1dir=${Prefix}/share/man/man1 -Dmsn3dir=${Prefix}/share/man/man3 -Dman3ext=3pl -Doptimize=-Os -Dsitearch=${Prefix}/lib/site_perl -Dsitelib=${Prefix}/lib/site_perl -Dperladmin=none -Dstartperl='#!/usr/local/opt/perl/bin/perl' -Duseshrplib -Duselargefiles -Dusenm -Dusethreads -Accflags="-DNO_MATHOMS -mcpu=970 -arch ppc -arch ppc64 -nostdinc -B${Sdk}/usr/include/gcc -B${Sdk}/usr/lib/gcc -isystem${Sdk}/usr/include -F${Sdk}/System/Library/Frameworks" -Aldflags="-arch ppc -arch ppc64 -Wl,-syslibroot,${Sdk}"

Expected behavior
Perl should be constructed and installed as per usual, with all compiled code built as fat binaries in the manner normal for Macs.

Perl configuration
The configuration cannot be extracted because Perl never finishes building, but the corresponding one for a pure ppc64 build looks like this:

Summary of my perl5 (revision 5 version 40 subversion 0) configuration:

 Platform:
   osname=darwin
   osvers=9.8.0
   archname=darwin-thread-multi-2level
   uname='darwin nosferalto.local 9.8.0 darwin kernel version 9.8.0:
wed jul 15 16:57:01 pdt 2009; root:xnu-1228.15.4~1release_ppc power
macintosh '
   config_args='-des -Dprefix=/Users/gsteemso/devel/perl/built/5.40.0
-Uvendorprefix= -Dprivlib=/Users/gsteemso/devel/perl/built/5.40.0/lib
-Darchlib=/Users/gsteemso/devel/perl/built/5.40.0/lib
-Dman1dir=/Users/gsteemso/devel/perl/built/5.40.0/share/man/man1
-Dman3dir=/Users/gsteemso/devel/perl/built/5.40.0/share/man/man3
-Dman3ext=3pl -Doptimize=-Os
-Dsitearch=/Users/gsteemso/devel/perl/built/5.40.0/lib/site_perl
-Dsitelib=/Users/gsteemso/devel/perl/built/5.40.0/lib/site_perl
-Dperladmin=none -Dstartperl=#!/usr/local/opt/perl/bin/perl
-Duseshrplib -Duselargefiles -Dusenm -Dusethreads -Duse64bitall
-Accflags=-DNO_MATHOMS -mcpu=970 -arch ppc64 -nostdinc
-B/Developer/SDKs/MacOSX10.5.sdk/usr/include/gcc
-B/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc
-isystem/Developer/SDKs/MacOSX10.5.sdk/usr/include
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
-Aldflags=-arch ppc64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk
-Alddlflags=-mmacosx-version-min=10.5 -arch ppc64 -bundle -undefined
dynamic_lookup -L/usr/local/lib -fstack-protector'
   hint=recommended
   useposix=true
   d_sigaction=define
   useithreads=define
   usemultiplicity=define
   use64bitint=define
   use64bitall=define
   uselongdouble=undef
   usemymalloc=n
   default_inc_excludes_dot=define
 Compiler:
   cc='cc'
   ccflags ='-std=gnu99 -fno-common -DPERL_DARWIN
-mmacosx-version-min=10.5 -DNO_THREAD_SAFE_QUERYLOCALE
-DNO_POSIX_2008_LOCALE -arch ppc64 -DNO_MATHOMS -mcpu=970 -arch ppc64
-nostdinc -B/Developer/SDKs/MacOSX10.5.sdk/usr/include/gcc
-B/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc
-isystem/Developer/SDKs/MacOSX10.5.sdk/usr/include
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-D_FORTIFY_SOURCE=2'
   optimize='-Os'
   cppflags='-arch ppc64 -std=gnu99 -fno-common -DPERL_DARWIN
-mmacosx-version-min=10.5 -DNO_THREAD_SAFE_QUERYLOCALE
-DNO_POSIX_2008_LOCALE -arch ppc64 -DNO_MATHOMS -mcpu=970 -arch ppc64
-nostdinc -B/Developer/SDKs/MacOSX10.5.sdk/usr/include/gcc
-B/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc
-isystem/Developer/SDKs/MacOSX10.5.sdk/usr/include
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
   ccversion=''
   gccversion='4.2.1 (Apple Inc. build 5666) (dot 3)'
   gccosandvers=''
   intsize=4
   longsize=8
   ptrsize=8
   doublesize=8
   byteorder=87654321
   doublekind=4
   d_longlong=define
   longlongsize=8
   d_longdbl=define
   longdblsize=16
   longdblkind=6
   ivtype='long'
   ivsize=8
   nvtype='double'
   nvsize=8
   Off_t='off_t'
   lseeksize=8
   alignbytes=8
   prototype=define
 Linker and Libraries:
   ld='cc -arch ppc64'
   ldflags =' -mmacosx-version-min=10.5 -arch ppc64 -arch ppc64
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -fstack-protector
-L/usr/local/lib'
   libpth=/usr/local/lib /usr/lib
   libs=-lpthread -ldbm -ldl -lm -lutil -lc
   perllibs=-lpthread -ldl -lm -lutil -lc
   libc=/usr/lib/libc.dylib
   so=dylib
   useshrplib=true
   libperl=libperl.dylib
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs
   dlext=bundle
   d_dlsymun=undef
   ccdlflags=' '
   cccdlflags=' '
   lddlflags=' -mmacosx-version-min=10.5 -bundle -undefined
dynamic_lookup -mmacosx-version-min=10.5 -arch ppc64 -bundle
-undefined dynamic_lookup -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
 Compile-time options:
   HAS_LONG_DOUBLE
   HAS_STRTOLD
   HAS_TIMES
   MULTIPLICITY
   NO_MATHOMS
   PERLIO_LAYERS
   PERL_COPY_ON_WRITE
   PERL_DONT_CREATE_GVSV
   PERL_HASH_FUNC_SIPHASH13
   PERL_HASH_USE_SBOX32
   PERL_MALLOC_WRAP
   PERL_OP_PARENT
   PERL_PRESERVE_IVUV
   PERL_USE_SAFE_PUTENV
   USE_64_BIT_ALL
   USE_64_BIT_INT
   USE_ITHREADS
   USE_LARGE_FILES
   USE_LOCALE
   USE_LOCALE_COLLATE
   USE_LOCALE_CTYPE
   USE_LOCALE_NUMERIC
   USE_LOCALE_TIME
   USE_PERLIO
   USE_PERL_ATOF
   USE_REENTRANT_API
 Built under darwin
 Compiled at Aug  4 2024 15:00:48
 @INC:
   /Users/gsteemso/devel/perl/built/5.40.0/lib/site_perl
   /Users/gsteemso/devel/perl/built/5.40.0/lib

(It should be noted that, in a pure ppc64 build done without the aid of a package manager, -Alddlflags=xxxxx must also be set by hand on the ./Configure command line, because extensions' shared-library makefiles fail to propagate the compiler flags that tell it which variant of the CPU architecture to target. Without that change, the individual .o files are still built correctly, but their coalescence into library .bundles is botched.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions