Skip to content

Adjust "./Configure" for wider architecture support #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

tianon
Copy link
Contributor

@tianon tianon commented Aug 29, 2017

This builds on #38, and adds an appropriate -Darchname value for cross-building (arm32v7 builds on an arm64v8 kernel, i386 builds on an amd64 kernel, etc), and conditionally converts -Duse64bitall into -Duse64bitint (which is what Debian uses when compiling Perl).

*** You have chosen a maximally 64-bit build,
*** but your pointers are only 4 bytes wide.
*** Please rerun Configure without -Duse64bitall.
*** Since you have quads, you could possibly try with -Duse64bitint.

See also https://sources.debian.net/src/perl/stretch/debian/config.debian/#L115 and https://sources.debian.net/src/perl/stretch/debian/config.debian/#L130.

    -Darchname=$host_gnu_type			\
...
    -Duse64bitint                               \

I've personally tested (successfully) building 5.026.000-64bit/Dockerfile on arm32v7, arm64v8, i386, s390x, and ppc64le. I'm happy to perform further testing as desired. This should really work fine on any of the architectures supported by buildpack-deps:stretch (amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x), although I haven't verified arm32v5 directly (since it has no hardware floating point, and thus is usually really slow 😅).

This adds an appropriate "-Darchname" value for cross-building (arm32v7 builds on an arm64v8 kernel, i386 builds on an amd64 kernel, etc), and conditionally converts "-Duse64bitall" into "-Duse64bitint" (which is what Debian uses when compiling Perl).

See also https://sources.debian.net/src/perl/stretch/debian/config.debian/#L115 and https://sources.debian.net/src/perl/stretch/debian/config.debian/#L130.

> *** You have chosen a maximally 64-bit build,
> *** but your pointers are only 4 bytes wide.
> *** Please rerun Configure without -Duse64bitall.
> *** Since you have quads, you could possibly try with -Duse64bitint.
@tianon
Copy link
Contributor Author

tianon commented Aug 29, 2017

Might be worth noting that this requires docker-library/buildpack-deps#65 as-is, which was merged to official-images over in docker-library/official-images#3378.

@zakame
Copy link
Member

zakame commented Aug 30, 2017

@tianon nice work! Yeah I remember dpkg-architecture, very useful on Debian/Ubuntu packaging work (I was a MOTU before.) I was already mulling on doing build support for i386, arm32v7 et al. but you beat me to it 💃

"64bit" => "-Duse64bitall $common",
"64bit,threaded" => "-Dusethreads -Duse64bitall $common",
"64bit" => "$common",
"64bit,threaded" => "-Dusethreads $common",
Copy link
Member

@zakame zakame Aug 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we ought to change the 64bit names here now to something else (maybe std,) since we can build 32- or 64-bit depending on dpkg-architecture.

@tianon
Copy link
Contributor Author

tianon commented Aug 30, 2017 via email

@zakame
Copy link
Member

zakame commented Aug 30, 2017

Haha no worries, no offense taken at all! :D

@zakame
Copy link
Member

zakame commented Sep 1, 2017

@tianon how would I go about testing this on my own? Say, I want to try building 32-bit Perl 5.22 and 5.24 on amd64. I was looking at https://doi-janky.infosiftr.net/job/multiarch/ but can't make out the process (probably not looking hard enough...)

@yosifkit
Copy link

yosifkit commented Sep 1, 2017

The build server does something like the following.

$ docker pull i386/buildpack-deps:stretch 
$ docker tag i386/buildpack-deps:stretch buildpack-deps:stretch
$ docker build -t image-name .

An example from travis build for memcached.

That will most likely interfere with other images you build on the same machine. You can accomplish the same thing by temporarily changing the FROM in the Dockerfile to i386/buildpack-deps:stretch (or the proper parent) and doing a docker build.

@zakame
Copy link
Member

zakame commented Sep 1, 2017

@yosifkit thanks, it is similar to how I tested for #38 :) Will try it on a spare machine/VM.

@zakame
Copy link
Member

zakame commented Sep 4, 2017

Thanks @tianon @yosifkit for the help, I'm able try building 32-bit Perls 5.22 through 5.26 on amd64, and I'll take @tianon's word about the other archs he has already tested. :)

I'll adjust this after merging to rename some paths to the Dockerfiles as hinted in #43 (comment); many thanks again!

@zakame zakame merged commit cace6e7 into Perl:master Sep 4, 2017
@tianon tianon deleted the more-multiarch branch September 4, 2017 17:55
zakame added a commit to zakame/docker-library-official-images that referenced this pull request Dec 4, 2017
- Update to Perl 5.24.3 and 5.26.1
- Build Perl for more architectures (Perl/docker-perl#43)
zakame added a commit to zakame/docker-perl that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants