x86-64

How to build x86 and/or x64 on Windows from command line with CMAKE?

不羁岁月 提交于 2019-12-03 00:19:05
问题 One way to get cmake to build x86 on Windows with Visual Studio is like so: Start Visual Studio Command prompt for x86 Run cmake: cmake -G "NMake Makefiles" \path_to_source\ nmake One way to get cmake to build x64 on Windows with Visual Studio is like so: Start Visual Studio Command prompt for x64 Run cmake: cmake -G "NMake Makefiles" \path_to_source\ nmake Using Cmake, how do I compile either or both architectures? (like how Visual Studio does it from in the IDE) 回答1: This cannot be done

Why does the iOS simulator require i386 and x86_64 symbols even though I'm on an x86_64 system only?

二次信任 提交于 2019-12-03 00:12:21
I'm trying to get an app running on the simulator that has had some problems doing so before. We don't have libjpeg.a built for i386 , but it does have x86_64 . This is the only dependency left, but I'm wondering why I actually need i386 symbols, if I'm running on an x86_64 mac. The iOS simulator can run your app in 32 and 64-bit modes. This is allows you to work out a lot of 64-bit issues and make sure it is ready for both armv7 and arm64. To do this, it compiles your app for i386 and x86_64 and requires the libraries for both architectures. iOS apps need to run on many different

Navicat for oracle 提示 cannot load oci dll,193的解决方法

匿名 (未验证) 提交于 2019-12-02 23:43:01
原文: https://download.csdn.net/download/liufuwu1/9731201 Navicat for oracle 提示 cannot load oci dll,193的解决方法,需要两个oracle客户端包, instantclient-basic-win-x86-64-11.2.0.1.0.zip instantclient-sqlplus-win-x86-64-11.2.0.1.0.zip, 首先解压第一个包,放到D盘,那么路径为D:\instantclient_11_2 打开第2个包,将里面所有的文件复制到D:\instantclient_10_2里面 关闭Navicat,再次打开,就可以连接了。 文章来源: https://blog.csdn.net/qq_36178165/article/details/92570599

Intel 64 bits, strange RSP behavior

半世苍凉 提交于 2019-12-02 23:39:42
问题 I came accross a problem with debugging a 64 bit binary in Windows using IDA. Normally, after a push RSP value should be deducted by 8. But occasionally, from IDA I saw that RSP was only deducted by 2, and then 8 for the next Push. The codes involved are push rax push rbx push rsi push rdi I'm quite new to x64 environment, thus could anyone explain this behavior ? 回答1: You're probably getting mixed up by hexadecimal. Counting by 8 goes 0 8 10 18 20 28 30 Are you looking at that and thinking

速度《深入理解计算机系统》总结

谁说胖子不能爱 提交于 2019-12-02 23:11:42
速度《深入理解计算机系统》总结 1.“hello”程序的生命周期 (1) “hello”程序的生命周期是从一个源程序开始的,即程序员通过编辑器创建并保存文本文件hello.c; (2)每条C语句都必须转化为一系列的低级机器语言指令才能在系统上运行,源文件要被转化为编译文件并存放在磁盘上; (3)将文件名输入到成为shell的应用程序中才能运行该可执行文件,如下: linux>./hello hello,world linux> (4)运行“hello”程序 2.压入和弹出栈数据 栈是一种数据结构,可以添加或者删除值。不过,要遵循“先进后出”的原则,通过push操作把数据压入栈中,通过pop操作删除数据。指令效果如下表。 将一个四字值压入栈中,首先要将栈指针减8,然后将值写到新的栈顶地址。因此指令pushq %rab的行为相当于下面两条指令: subq $8,%rsp movq %rab,(%rsp) 数据具体移动存储过程如下图。 3.Y86-64的顺序实现和流水实现 (1)顺序实现:取指,译码,执行,访存,写回,更新PC。下图是SEQ的硬件结构(一种顺序实现) (2)流水实现:SEQ+重新安排计算 插入流水线寄存器 对信号进行重新编排和标号 预测下一个PC 4.存储器层次结构 存储技术:不同存储技术的访问时间差异很大。速度较快的技术每字节的成本要比速度较慢的技术高,而且容量较小

Is there an `x86` instruction to tell which core the instruction is being run on?

一个人想着一个人 提交于 2019-12-02 22:58:47
When I cat /proc/cpuinfo , I see 8 cores, with ID's from 0 to 7 . Is there an x86 instruction that will report the core id of the core that the instruction itself is running on? I looked at cpuid but that does not seem to return coreid under any parameter setting. The Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide, Part 1 , section 8.4.5 Identifying Logical Processors in an MP System lists, among others: This APIC ID is reported by CPUID.0BH:EDX[31:0] Note that this doesn't directly equate to the linux kernel's numbering. In the kernel there

How to late bind 32bit/64 bit libs at runtime

☆樱花仙子☆ 提交于 2019-12-02 22:46:47
I've got a problem similar to,but subtly different from, that described here (Loading assemblies and their dependencies). I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will have a CLR wrapper around it. The C++ DLL can be built in both 32 and 64bit versions, but I think this means we need to have two CLR wrappers since the CLR binds to a specific DLL? Say now our customer has a .NET app that can be either 32 or 64bit, and that it being a pure .NET app it leaves the CLR to work it out from a single set of assemblies. The question is how can the app code

What is the difference between assembly on mac and assembly on linux?

半城伤御伤魂 提交于 2019-12-02 22:05:33
I've been trying to get familiar with assembly on mac, and from what I can tell, the documentation is really sparse, and most books on the subject are for windows or linux. I thought I would be able to translate from linux to mac pretty easily, however this (linux) .file "simple.c" .text .globl simple .type simple, @function simple: pushl %ebp movl %esp, %ebp movl 8(%ebp), %edx movl 12(%ebp), %eax addl (%edx), %eax movl %eax, (%edx) popl %ebp ret .size simple, .-simple .ident "GCC: (Ubuntu 4.3.2-1ubuntu11) 4.3.2" .section .note.GNU-stack,"",@progbits seems pretty different from this (mac)

《深入理解计算机系统》阅读笔记--程序的机器级表示(上)

匿名 (未验证) 提交于 2019-12-02 21:59:42
一、为什么要学习和了解汇编 编译器基于编程语言的规则,目标机器的指令集和操作系统遵循的惯例,经过一系列的阶段生成机器代码。GCC c语言编译器以汇编代码的形式产生输出,汇编代码是机器代码的文本表示,给出程序中的每一条指令。然后GCC调用汇编和链接器,根据汇编代码生成可执行的机器代码。这一章节其实就是来更加深入的认识和理解汇编代码 现在我们更多接触的都是一些高级语言,如JAVA,GO,Python,其实用这些语言的时候,更大程度上,已经屏蔽了一些程序的细节,即机器级的实现。但是如果是用汇编语言,程序员就必须制定程序用来执行计算的低级指令。 那么为什么我们还要学习和了解汇编呢? 虽然现在编译器已经替我们做了生成汇编代码的大部分工作,但是作为程序员,如果我们能够阅读和理解汇编代码将是一个非常重要的技能,好处是: 能够理解编译器的优化能力分析代码中隐含的低效率 如我们通过线程包写并发程序时,了解不同线程是如何共享程序数据或保持数据私有的,以及准确知道如何在哪里访问共享数据,这些在机器代码都是可见的 二、历史 Inter的处理器系统俗称x86,第一代处理器是8086,一个单芯片,16位微处理器,主要为 IBM PC 和 DOS 设计,有 1MB 的地址空间。八年后的 1985,第一个 32 位 Intel 处理器(IA32) 386 诞生。2004 年,奔腾(Pentium) 4E

Why is memcmp(a, b, 4) only sometimes optimized to a uint32 comparison?

こ雲淡風輕ζ 提交于 2019-12-02 21:33:08
Given this code: #include <string.h> int equal4(const char* a, const char* b) { return memcmp(a, b, 4) == 0; } int less4(const char* a, const char* b) { return memcmp(a, b, 4) < 0; } GCC 7 on x86_64 introduced an optimization for the first case (Clang has done it for a long time): mov eax, DWORD PTR [rsi] cmp DWORD PTR [rdi], eax sete al movzx eax, al But the second case still calls memcmp() : sub rsp, 8 mov edx, 4 call memcmp add rsp, 8 shr eax, 31 Could a similar optimization be applied to the second case? What's the best assembly for this, and is there any clear reason why it isn't being