Skip to content

Conversation

gongminmin
Copy link
Contributor

@gongminmin gongminmin commented Jan 12, 2019

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

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!

Copy link
Contributor

@eamanu eamanu left a comment

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.

@gongminmin
Copy link
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
Contributor Author

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

@bedevere-bot
Copy link

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
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
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

Thanks for making the requested changes!

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

@pitrou
Copy link
Member

pitrou commented Jan 21, 2019

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
Copy link
Member

pitrou commented Jan 21, 2019

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
Contributor Author

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

@pitrou
Copy link
Member

pitrou commented Jan 21, 2019

Perfect, will merge then ;-)

@pitrou pitrou merged commit 7a23680 into python:master Jan 21, 2019
@gongminmin
Copy link
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