Skip to content
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

support for ARM builds #134

Merged
merged 4 commits into from
May 17, 2021
Merged

support for ARM builds #134

merged 4 commits into from
May 17, 2021

Conversation

mammo0
Copy link
Contributor

@mammo0 mammo0 commented Dec 23, 2020

Hello,

during the build process on a Raspberry Pi I got an error from cmake, that the -m32 or -m64 flag is not supported on this platform.

So I reworked the code to detect not only if the system is 32/64bit but also if it's an ARM system. There's also support for aarch64.

-> '-m32'/'-m64' flags are not supported there
@HinTak
Copy link
Collaborator

HinTak commented Dec 23, 2020

You are going about it the wrong way - multi-arch build is only ever useful when the cpu is x86_64 (Linux /windows /mac os...) so you should conditioned on if x86_64. I heard that there are multi-arch raspberry pi distro/systems out there with armhf+aarch64 too though - not sure if they are switchable by -m32/m64.

Anyway, why do you want to build freetype on pi when it is available system-wide (and "./configure && make" works?)

@HinTak
Copy link
Collaborator

HinTak commented Dec 23, 2020

I'd suggest you change it to conditioning on x86_64 / x64 (for windows too) instead ; but mixed-arch raspberrypi system exists (64-bit kernel with 32-bit userland, etc), though not yet common, so I am not sure what purpose this change serve.

@mammo0
Copy link
Contributor Author

mammo0 commented Dec 23, 2020

First thanks for the quick response. But I don't really get your point...

My purpose is not a multiarch build on a x86_64 machine. I had just the issue, that if I manually build the freetype library with FREETYPEPY_BUNDLE_FT on my Pi, cmake complained about the -m32/-m64 flag. And it seems that those flags are not supported on arm. So I added a new case, that checks if the build system is on running on ARM. If so, it simply doesn't add those flags.

Anyway, why do you want to build freetype on pi when it is available system-wide (and "./configure && make" works?)

I stumbled about this issue because for my project I needed a freetype library, that was compiled with libpng support (see my PR #133). After successfully building the library with libpng on my x86_64 PC, I tried it on my Pi. There I got the above mentioned error.

@HinTak
Copy link
Collaborator

HinTak commented Dec 24, 2020

You tested on platform != aarch64. But aarch64 is not the one that needs special treatment. x86_64 / x64 is.

@mammo0
Copy link
Contributor Author

mammo0 commented Dec 24, 2020

I test on platform != arm and platform != aarch64 to check if it's ARM or not... Otherwise the the old behavior is used.

@HinTak
Copy link
Collaborator

HinTak commented Dec 24, 2020

You should test on platform == x86_64 instead. I wrote at the very beginning. That said, biarch armhf/aarch64 systems, although much rarer than x86_64 biarch systems, are around.

@mammo0
Copy link
Contributor Author

mammo0 commented Dec 24, 2020

Ok, then I will switch the if-statement.

Edit: Will do it after the Christmas holidays ;)

@mammo0
Copy link
Contributor Author

mammo0 commented Dec 26, 2020

Hello @HinTak,
please check my latest commit (f0c6bd8) in this PR. Is that how you meant it?

@HinTak
Copy link
Collaborator

HinTak commented May 14, 2021

The change, as is, is okay now, I think, but I just spotted a "problem" in the surrounding code: as I said, the special case is x86_64, not linux. People routinely use both 32-bit and 64-bit freetype on 64-bit (intel) windows too, and both 32-bit and 64-bit freetype on 64-bit Mac OS too, until OS X 15 (when they officially dropped 32-bit support, I think). So special-case'ing on linux seems wrong.

Anyway, I would say merge this as is now. If somebody care enough about bi-arch on 64-bit windows and mac os x, they can add some more code later.

@HinTak
Copy link
Collaborator

HinTak commented May 14, 2021

gcc on Mingw and Mac OS X takes -m32/-m64 too, like their linux siblings.

@mammo0
Copy link
Contributor Author

mammo0 commented May 17, 2021

Anyway, I would say merge this as is now. If somebody care enough about bi-arch on 64-bit windows and mac os x, they can add some more code later.

Thank you for approving this.

@rougier rougier merged commit b38d309 into rougier:master May 17, 2021
@mammo0 mammo0 deleted the arm_support branch September 4, 2021 09:24
@madig madig mentioned this pull request Apr 5, 2022
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