
GCC
Stroot_Zhang
这个作者很懒,什么都没留下…
展开
-
GCC 4.7+ version 字节对齐
1、位域对齐3.7版本之后GCC都默认使用了-mms-bitfields,此选项意义为使用Microsoft的方式进行对齐操作,其对齐策略为将对所有类型相同的位域合并到一起。与之相对的是GCC对其方式,其对齐策略为将所有位域合并到一起,并不区分位域类型。如下例:struct {unsigned long long c : 1;unsigned int a : 1;unsign原创 2013-09-25 01:42:11 · 2697 阅读 · 0 评论 -
Mingw GCC pack Struct.
U need wrap the code with #pragma pack(push,x)...#pragma pack(pop)Such as:#pragma pack(push,1)struct S { ... };#pragma pack(pop)ref: 1. https://forum.qt.io/topic/34592/cannot-run-app-in-windows-bu原创 2016-01-06 01:10:56 · 616 阅读 · 0 评论 -
Cross compile perl
Alex Suykov had do some work for this purpose, and my compile script is based on her patch.原创 2015-07-03 17:19:43 · 1755 阅读 · 0 评论 -
Cross compiling coreutils and generate the manpages
When we cross compiling coreutils, there is an problem of generating man pages, because the source script use the binaries generated by make process to produce man pages, but the cross compiled binarie原创 2015-07-02 17:28:17 · 941 阅读 · 0 评论 -
GCC compile debug: print include files and compile stage info.
GCC compile debug: print include files and compile stage info.原创 2015-07-01 23:52:10 · 1013 阅读 · 0 评论 -
Cannot build gcc-4.4.3: fenv_t has not been declared
Version info:crosstoll-ng : 1.21.0 want to build native gcc 4.4.3Error:Fail in stage: cc_for_host . Error info: fenv_t has not been declared.Cause:BUG of gcc-4.4.3 source code .Solution:Modify file原创 2015-07-01 22:40:43 · 2588 阅读 · 0 评论 -
GCC --sysroot=dir switch meaning
Use dir as the logical root directory for headers and libraries. For example, if the compiler normally searches for headers in /usr/include and libraries in /usr/lib, it instead searches dir/usr/incl原创 2015-06-27 14:38:02 · 2373 阅读 · 0 评论 -
Cross compile problem: cannot run test program while cross compiling
We have to modify the configure.ac or configure.in file and delete the check which is causing problems. Cross compiling with autoconf is pretty tricky and usually needs some tweaking of the config file原创 2015-06-27 01:43:11 · 1984 阅读 · 0 评论 -
Glibc configure error: The arm is not supported.
Support for compiling GLIBC for ARM GNU/Linux (arm-none-linux-gnueabi) is provided by the ports add-on.For example, the ports add-on of glibc-2.12.2.tar.xzisglibc-ports-2.12.2.tar.gzYou need to downlo原创 2015-06-28 01:45:50 · 2346 阅读 · 1 评论 -
Glibc configure problem: fails sanity check.
Cause: [Just guess] This error may be caused by header files.Solution:Unset all relative enviroment variable:unset LD_LIBRARY_PATH LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH原创 2015-06-28 01:34:02 · 782 阅读 · 0 评论 -
Solution: `GLIBC_2.xxx' not found”
Using the temp environment variable:env LD_LIBRARY_PATH=/path/to/correct/libc-xxx.so SomeProblemAPP appArgsorLD_LIBRARY_PATH=/path/to/correct/libc-xxx.so SomeProblemAPP appArgs原创 2015-06-27 01:58:09 · 698 阅读 · 0 评论 -
Cross Compiling For ARM With Autoconf
1、Have your cross compilers in your current $PATH 2、Set the CC and CXX environment variables to point to the cross compilers 3、Give the right –host and –buildhttp://stackoverflow.com/questions/1523翻译 2015-06-27 00:47:16 · 677 阅读 · 0 评论 -
Glibc feature _FORTIFY_SOURCE
_FORTIFY_SOURCE is a Glibc feature which adds memory and string functionprotection. There is no home site for this feature, but it is described wellon this page: http://gcc.gnu.org/ml/gcc-patches/2004原创 2014-12-05 15:02:24 · 806 阅读 · 0 评论 -
GCC 字节对齐设置
1、全局对齐设置:使用伪指令#pragma pack (n),GCC编译器将按照n个字节对齐。 使用伪指令#pragma pack (),取消自定义字节对齐方式。2、单变量设置:__attribute((aligned (n))),让所作用的结构成员对齐在n字节自然边界上。如果结构中有成员的长度大于n,则按照最大成员的长度来对齐。__attribute__ ((原创 2013-09-24 20:20:25 · 2357 阅读 · 0 评论 -
Convert int/long to hex string.
We can do this by the setNum function of QString.int decimal = 10000;QString hexadecimal;hexadecimal.setNum(decimal,16);ref: 1. https://forum.qt.io/topic/28890/convert-from-int-to-hex/4原创 2016-01-06 01:13:19 · 847 阅读 · 0 评论