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 other arch rather than x86, remove x86 spcified arguments for gc... #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coney
Copy link

@coney coney commented Mar 28, 2014

gcc不支持-m32的原因是我是在arm上执行的gcc, -m32 -m64 -mcx16等都是x86架构专有的参数.

现在通过platform.architecture()来获取位数,并且参考platform.machine()来判断架构. 如果不是x86则不对CC, CXX, CPP, LD加入-mXX及-mcx16等参数, 并且不对AS加入-32或-64

测试之前好像有8个不通过, 不太熟悉代码, 没修.. 把新加代码break的一个测试改了改

@chen3feng
Copy link
Owner

支持交叉编译曾考虑过,但是还没有开始搞。可能需要系统化地支持和改动。比如-m64改为-arch=x86_64之类的。我先看看你的修改吧。

@coney
Copy link
Author

coney commented Mar 28, 2014

这个应该不算交叉编译, 只是在非x86平台上编译native程序, 我是在我的一个小的arm开发板上编译

@chen3feng
Copy link
Owner

明白了,-arch是不是x86_64和i386视为独立的两个比较好?

@chen3feng
Copy link
Owner

可能需要引入不同arch下编译参数的可配置化。比如
arch(
name = 'i386',
ccflags = ...
linkflags = ...
)
之类的。

@chen3feng
Copy link
Owner

你的这个需求挺有意思,我review后,争取尽早merge到master。

@coney
Copy link
Author

coney commented Mar 28, 2014

好的^_^

@chen3feng
Copy link
Owner

gtalk:chen3feng
2014-3-28 下午1:30于 "Coney Wu" [email protected]写道:

这个应该不算交叉编译, 只是在非x86平台上编译native程序, 我是在我的一个小的arm开发板上编译


Reply to this email directly or view it on GitHubhttps://github.com//pull/98#issuecomment-38890003
.

def _arch(self):
"""Platform arch name."""
arch = platform.machine()
if arch in ['i386', 'i686', 'x86_64']:
Copy link
Owner

Choose a reason for hiding this comment

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

我觉得x86_64应该从i386中独立出来

Copy link
Author

Choose a reason for hiding this comment

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

这里我是这样分的:
arch分x86 arm等, bits分32 64.
所以x86_64是x86 64bit, i386是x86 32bit.
x86上能支持到cmpxchg -32 -64等, 不用再判断等于i386或x86_64,
你觉得怎么样好点?

@chen3feng
Copy link
Owner

reviewed

@chen3feng
Copy link
Owner

统一用platform.machine()获得arch如何?

@coney
Copy link
Author

coney commented Apr 1, 2014

这样对于非x86平台好像不好判断是32位或者64, 也可以目前假定非x86都是32位

@chen3feng
Copy link
Owner

如果要实现支持多平台,就得淡化位数的概念,用arch取代,比如
lib/x86_64/libxxx.a
位数只有x86/x64里才支持

@coney
Copy link
Author

coney commented Apr 1, 2014

恩 我看行

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.

2 participants