gcc信息文件在x86-64特定标志的部分中说明,其中包括:
There is no `-march=generic' option because `-march'
indicates the instruction set the compiler can use, and there
is no generic instruction set applicable to all processors.
In contrast, `-mtune' indicates the processor (or, in this
case, collection of processors) for which the code is
optimized.
Run Code Online (Sandbox Code Playgroud)
我的问题是,当没有给出-march选项时,gcc编译的指令(子)集是什么?在webosphere中有很多关于-march和-mtune的相关信息,但我找不到哪个能回答这个简单的问题.它不能是march = native,否则就不可能编译通用分发内核和二进制包.
首先是一些背景.
我试图用开罗(实际上是pycairo)绘制一个Gdk(实际上是pygtk)pixbuf.我原来的代码看起来像这样:
import cairo as C
import gtk.gdk as GG
FMT = C.FORMAT_ARGB32
CSP = GG.COLORSPACE_RGB
st = C.ImageSurface.format_stride_for_width(FMT, zw)
surf = C.ImageSurface(FMT, zw, zh)
c = C.Context(surf)
# draw into c here ...
pixels = surf.get_data()
return GG.pixbuf_new_from_data(pixels, CSP, True, 8, zw, zh, st)
Run Code Online (Sandbox Code Playgroud)
有一段时间,看起来这只会起作用,直到我试图绘制颜色而不仅仅是黑色文本.事实证明两个库在字节顺序上不一致,如下所示:
# !!! FIXME !!! cairo ARGB surfaces and gdk pixbufs disagree on bytesex:
# cairo: LSB --> B G R A <-- MSB
# gdk: LSB --> R G B A <-- MSB
# …Run Code Online (Sandbox Code Playgroud)