Skip to content

bpo-35758: Fix building on ARM + MSVC#11531

Merged
pitrou merged 5 commits into
python:masterfrom
gongminmin:FixForArm
Jan 21, 2019
Merged

bpo-35758: Fix building on ARM + MSVC#11531
pitrou merged 5 commits into
python:masterfrom
gongminmin:FixForArm

Conversation

@gongminmin

@gongminmin gongminmin commented Jan 12, 2019

Copy link
Copy Markdown
Contributor

Msvc defines _M_ARM for arm target, but it doesn't have x87 control word. Need to disable it to prevent some compiling problems.

https://bugs.python.org/issue14802

@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@eamanu eamanu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You must sign CLA and add NEWS. Maybe this PR need more discuss. I recommend open a new bpo or send some comments to the issue to activate it.

Comment thread Include/pyport.h Outdated
@gongminmin

Copy link
Copy Markdown
Contributor Author

I'll file a new bug about this. Thanks.

@gongminmin gongminmin changed the title bpo-14802: Disable x87 control word for ARM bpo-35758 : Disable x87 control word for ARM Jan 17, 2019
@gongminmin

Copy link
Copy Markdown
Contributor Author

CLA signed, and a new bug 35758 is filed for disabling x87 on ARM.

Comment thread Include/pyport.h Outdated
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

On msvc, x87 control word is only available on x86 target. Need to disable it for other targets to prevent compiling problems.
@gongminmin

Copy link
Copy Markdown
Contributor Author

I found another problem about arm. In Include\internal\pycore_atomic.h, immintrin.h should only be included on x86 and x64. Should I fix it in this PR or open another one? Thanks.

@gongminmin

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again. And also add an entry in Misc/News.d/next.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@pitrou: please review the changes made to this pull request.

@pitrou

pitrou commented Jan 21, 2019

Copy link
Copy Markdown
Member

Should I fix it in this PR or open another one?

You can fix it in this PR.

Immintrin.h is only available on x86 and x64. Need to disable it for other targets to prevent compiling problems.
@pitrou

pitrou commented Jan 21, 2019

Copy link
Copy Markdown
Member

Thanks @gongminmin. Is this sufficient to get Python to compile and run on ARM + MVSC? If so, I think we can merge soon.

@pitrou pitrou changed the title bpo-35758 : Disable x87 control word for ARM bpo-35758 : Fix building on ARM + MSVC Jan 21, 2019
@pitrou pitrou changed the title bpo-35758 : Fix building on ARM + MSVC bpo-35758: Fix building on ARM + MSVC Jan 21, 2019
@gongminmin

Copy link
Copy Markdown
Contributor Author

Yes, with this change, I can build arm and arm64 pythoncore and most modules.

@pitrou

pitrou commented Jan 21, 2019

Copy link
Copy Markdown
Member

Perfect, will merge then ;-)

@pitrou pitrou merged commit 7a23680 into python:master Jan 21, 2019
@gongminmin

Copy link
Copy Markdown
Contributor Author

Thanks very much!

@gongminmin gongminmin deleted the FixForArm branch January 21, 2019 20:51
gongminmin added a commit to gongminmin/cpython that referenced this pull request Jan 22, 2019
* Disable x87 control word for non-x86 targets

On msvc, x87 control word is only available on x86 target. Need to disable it for other targets to prevent compiling problems.

* Include immintrin.h on x86 and x64 only

Immintrin.h is only available on x86 and x64. Need to disable it for other targets to prevent compiling problems.
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.

5 participants