- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
关于在 C++14 或其他 C++ 版本中使用 Intel Pin,我有几个问题。
我正在构建一个动态调用图 pin 工具。为了使其易于理解,我正在计算调用堆栈的深度。为了安全起见,我决定用 std::mutex
包装增加或减少深度的代码摘录。这让我遇到了 std::mutex
仅在 C++11 之后才可用的问题,这不是我机器中的默认 Intel Pin。
$ g++ -v
[...]
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)
编译命令:
$ make obj-intel64/callgraph.so
[...]
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
[...]
我设法制定了一个将版本定义为 C++11 的构建规则,但它失败了。通过 make 发送给 g++ 的命令是
g++ -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -D__PIN__=1
-DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables
-fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC
-DTARGET_LINUX -fabi-version=2 -I/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/source/include/pin
-I/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/source/include/pin/gen
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/stlport/include
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/libstdc++/include
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/crt/include
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/crt/include/arch-x86_64
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi
-isystem /home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/crt/include/kernel/uapi/asm-x86
-I/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/components/include
-I/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/xed-intel64/include
-I/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/source/tools/InstLib -O3
-fomit-frame-pointer -fno-strict-aliasing -std=c++11
-c -o obj-intel64/callgraph.o callgraph.cpp
这不会编译。相反,它会落入 STL header 内的巨大错误日志中。 Pin 似乎带有它自己的 STL 子集,这与 C++11 和 C++14 冲突。我上传了 paste g++ 的输出。它填充了 2331 行,但我注意到它访问的文件夹中有奇怪的东西。 STL 库来自 2 个不同的目录:
/usr/include/c++/5/
/home/gabriel/Downloads/pin-3.0-76991-gcc-linux/extras/STLport/include/
一个一个地解决错误是不可行的,删除 pin STL 端口可能是一个更糟糕的主意。如果可以将 Pin 与更新的 C++ 一起使用,我会说简单的 std=c++1y
不是办法。
最佳答案
从用于编译pin工具的编译器选项来看,我推测您使用的是最新版本的Pin,即3.0。根据Intel ,框架附带的 CRT 不支持 C++11 和更高版本的语言。特别是,您将无法使用 C++11 中支持的任何 API,包括 std::mutex
。如果使用 C++11 API 对您来说很重要,那么您应该使用以前版本的 Pin,即 2.14,它不附带 CRT,而是使用编译器的 CRT。
但是,如果您只需要互斥量,则可以使用 Pin 3.0 附带的操作系统可移植互斥量。有关详细信息,请参阅 documentation .
使用 Pin 3.0 时,不允许使用编译器的任何头文件或目标文件(来自 /usr/include/c++/5/
)。只能使用 PinCRT 和少量系统头文件。
关于c++ - 带有 C++14 的 Intel Pin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39691080/
我正在使用 - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id ) annotation{ 为自定义图钉
试图了解Box::pin()和Pin::new_unchecked()之间的区别。假设以下代码: use std::pin::Pin; use std::marker::PhantomPinned;
我有最新版本的 Intel Pin 3.0 版本 76887。 我有一个支持 MPX 的玩具示例: #include int g[10]; int main(int argc, char **arg
我正在寻找一种算法来创建类似于预付费电话卡的安全唯一随机数。我确实看过Generating a unique 15 digite Pin code from a 10digit number但它确实让
作为Hans Passant wishes这是我的场景。我有一个混合模式应用程序,其中 native 代码完成所有艰苦的工作,同时尊重性能,托管代码仅负责 GUI。用户也将通过编写他们专有的 C# 代
我正在尝试解决一个我不确定如何解决的问题。在我的应用程序中,本地图套件启动时,我会在用户的当前位置放置一个图钉。 Mapkit 委托(delegate)给 viewForAnnotation,它设置了
我在 android 应用程序中集成了 admob,我达到了阈值。它会显示一条消息,您的付款目前处于暂停状态,因为您尚未验证您的地址 有什么方法可以避免等待数周才能从 admob 收到用于地址验证的
我正在使用 get_user_pages在 Linux 内核驱动程序中,为了 [硬件] DMA 固定内存。一切似乎都很好 - 但我很难证明“固定”正在做正确的事情。 当我在做 get_user_pag
在使用 MKMapView 时,我确实注意到了 IOS 11 上的一个问题。 当我想从图钉对话框中点击按钮 Action 并且按钮 Action 后面有另一个图钉时,它没有得到手势。 应该是zPosi
我是 PIN 工具的新手。我只是尝试运行自述文件中给出的示例代码。 最初我使用以下方式构建: $ cd source/tools/ManualExamples $ make all 它正确编译并创建了
我遇到一个小问题...我有自己的网站,带有一个简单的 mysqli 登录脚本,每当我输入用户名、密码和 PIN 码时,它都会让我登录... 我现在的问题是,我可以仅使用用户名和密码登录我的网站(无需输
我有一个显示现金点位置的 map View 。注释被删除,可以单击标注以转到包含有关该位置的更多详细信息的页面。提款机分为免费和付费两种,免费的提款机别针是绿色的,另一个是红色的。当别针掉落时,它们就
我正在构建一个带有 GSM 调制解调器和 SIM 卡的设备。我想用别针保护 SIM 卡,以防止在现场安装设备时误用。 将关联 SIM 卡的 PIN 码存储到每个设备中会很麻烦。此外,如果更换 SIM
我正在编写一个需要共享流所有权的流适配器。 将流(私下)存储在 Pin>> 中是否正确? ? 如何调用poll_next(self: Pin在流? 最佳答案 Mutex没有所谓的结构钉扎,这在 std
我对 Pin 的要求感到困惑那个 a value, once pinned, must remain pinned forever. 我看到了the discussion thread on redd
我目前正在实现 TrustKit framework在我的 iOS 应用程序中为 SSL 连接启用 SPKI 固定。我偶然发现了正确配置 TrustKit 所必需的“备用密码”。不幸的是,API 文档
在 rust 中学习 Pin 的实现时我很困惑。 我知道当一个类型不能安全移动时,它可以实现 !Unpin。 Pin 是为了防止别人从这些类型中获取到&mut T,使他们不能是std::mem::sw
我用的是 SIM868 模块,我用的是我常用的 SIM 卡,没有问题,但现在我买了一张新的 SIM 卡,没有 pin。我需要添加 PIN 码以提高安全性。 我使用以下命令检查了它是否没有启用 PIN:
我想知道是否可以在自定义 MKMapView 中创建 MKPinAnnotation,它可以像 map 应用程序中的“Drop Pin”注释一样响应触摸和拖动。 我想要一种在 GPS 给出的位置放置图
我正在开发一个应用程序,我需要通过为用户设置密码/密码/密码来设置安全功能,以便每当他们从后台打开应用程序时,应用程序都会要求输入密码/密码/密码。我阅读了一些文章/解决方案,例如 this但他们没有
我是一名优秀的程序员,十分优秀!