Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 同时使用sysroot和c++;11?_C++_C++11_Gcc_Arm_Yocto - Fatal编程技术网

C++ 同时使用sysroot和c++;11?

C++ 同时使用sysroot和c++;11?,c++,c++11,gcc,arm,yocto,C++,C++11,Gcc,Arm,Yocto,我遇到了一个非常奇怪的问题。我使用Yocto项目生成了一个ARM工具链/RFS。这本身可能并不重要,因为我已经用预先制作的ARM工具链和空的sysroot复制了相同的问题(请参见下面的编辑) 考虑一下简单的文件foo.cpp: #include <memory> int main() { return 0; } 编译器信息: Using built-in specs. COLLECT_GCC=aarch64-linux-gnu-g++ COLLECT_LTO_WRAPPER=/op

我遇到了一个非常奇怪的问题。我使用Yocto项目生成了一个ARM工具链/RFS。这本身可能并不重要,因为我已经用预先制作的ARM工具链和空的sysroot复制了相同的问题(请参见下面的编辑)

考虑一下简单的文件
foo.cpp

#include <memory>
int main() { return 0; }
编译器信息:

Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-g++
COLLECT_LTO_WRAPPER=/opt/marvell/5.2.1/armv8/le/aarch64v8-marvell-linux-gnu-5.2.1_x86_64_20151110/bin/../libexec/gcc/aarch64-linux-gnu/5.2.1/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/gccbuilder-x86/release/mgcc5.0/src/gcc-src/configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=aarch64-linux-gnu --prefix=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64 --enable-libssp --enable-shared --enable-threads --enable-lto --enable-libgomp --enable-gnu-indirect-function --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-pkgversion='Marvell GCC release 20151110-a53c013d' --with-bugurl=mailto:mrvlgccbug@gmail.com --with-sysroot=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/libc --with-build-sysroot=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/libc --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-build-time-tools=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/bin --enable-poison-system-directories --enable-symvers=gnu --enable-__cxa_atexit --enable-multiarch --enable-linker-build-id --disable-nls --disable-libstdcxx-pch --disable-libcc1 --with-specs='%{funwind-tables|fno-unwind-tables|ffreestanding|nostdlib:;:-funwind-tables}' --disable-multilib
Thread model: posix
gcc version 5.2.1 20151103 (Marvell GCC release 20151110-a53c013d) 
关于如何进行调试有什么见解吗?在尝试提交错误报告之前,我想确定由哪一方负责(GCC、Yocto、Marvell等)

编辑:

我找到了一个简单的方法来复制这个。只需下载x86_64编译器并使用空sysroot调用:


/aarch64-linux-gnu-g++--sysroot=“”-std=c++11 foo.cpp

当使用和不使用sysroot编译时,什么是
sizeof(uintpttr_t)
sizeof(void*)
。@n.m.使用sysroot:
4 8
,不使用sysroot(但使用c++11):
8
,并且分别不使用sysroot和c++11
8
。这是一个很好的线索!你知道这是什么原因吗?在我看来,这就像是你特定的gcc构建中的一个bug。尝试
g++-dM-E-
使用或不使用sysroot。我的gcc得到了相同的结果,您得到了不同的结果吗?如何得到sysroot?我已经用ubuntu交叉编译器和Yocto SDK测试了这两个版本,它们都可以指示由Yocto SDK生成的sysroot。唯一的区别是我使用gcc 5.4,我认为这不是问题所在tho@n.m.我在两种情况下都得到了相同的结果:
#define uuu uintptpr_uuutype uuuuu长无符号int
,如果我打印带有和不带sysroot的
sizeof(长无符号int)
,我两次都得到
8
。但是,如果我打印带有和不带sysroot的
sizeof(uintptr\u t)
,我将分别得到
4
8
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-g++
COLLECT_LTO_WRAPPER=/opt/marvell/5.2.1/armv8/le/aarch64v8-marvell-linux-gnu-5.2.1_x86_64_20151110/bin/../libexec/gcc/aarch64-linux-gnu/5.2.1/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/gccbuilder-x86/release/mgcc5.0/src/gcc-src/configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=aarch64-linux-gnu --prefix=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64 --enable-libssp --enable-shared --enable-threads --enable-lto --enable-libgomp --enable-gnu-indirect-function --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-pkgversion='Marvell GCC release 20151110-a53c013d' --with-bugurl=mailto:mrvlgccbug@gmail.com --with-sysroot=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/libc --with-build-sysroot=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/libc --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-build-time-tools=/home/gccbuilder-x86/release/mgcc5.0/Release/install/aarch64v8-marvell-linux-gnu-5.2.1_x86_64/aarch64-linux-gnu/bin --enable-poison-system-directories --enable-symvers=gnu --enable-__cxa_atexit --enable-multiarch --enable-linker-build-id --disable-nls --disable-libstdcxx-pch --disable-libcc1 --with-specs='%{funwind-tables|fno-unwind-tables|ffreestanding|nostdlib:;:-funwind-tables}' --disable-multilib
Thread model: posix
gcc version 5.2.1 20151103 (Marvell GCC release 20151110-a53c013d)