
GCC
hushui
Coding Since 1998
展开
-
overflow.h/Gcc5
#if __GNUC__ >= 5 || __has_builtin(__builtin_add_overflow)/** assume clang and gcc (>=5) to only have builtins for now. */# define add_of(a, b, r) __builtin_add_overflow(a, b, r)# define sub_of(a, b, r) __builtin_sub_overflow(a, b, r)# define.原创 2021-11-17 10:48:09 · 545 阅读 · 0 评论 -
GCC build a 32-bit binary on a 64-bit linux machine
export CFLAGS=-m32 export CXXFLAGS=-m32export LDFLAGS=-m32 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 gcc/g++/make Example for busyboxCFLAGS=-m32CXXFLAGS=-m32LDFLAGS=-m32 make defconfigCFLAGS=-m32CXXFLAGS=-m32LDFLAGS=-m32 mak...原创 2021-10-26 17:33:09 · 395 阅读 · 0 评论 -
STL container value types can‘t be reference
No. STL container value types need to be assignable. References are not assignable. (You cannot assign them a different object to reference.)原创 2021-09-08 08:41:00 · 115 阅读 · 0 评论 -
make_unique for c++11
// for c++ 11 as make_unique is only specified in c++ 14template<typename T, typename... Args>std::unique_ptr<T> make_unique(Args&&... args){ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));}原创 2021-09-07 09:41:05 · 246 阅读 · 0 评论 -
patch/lib without LD_LIBBRARY_PATH
Question:Buildroot does not allowLD_LIBBRARY_PATHBuild/make user does not have root provilege.Buildroot needs some extra so/lib for host side tool/QT buildSolution[lake@localhost rk3399_linux_release_v2.5.1_20210301]$ ldd /data/sdb/lake/sou..原创 2021-07-21 17:38:47 · 147 阅读 · 0 评论 -
time_t is signed int/long
Thetime_tdatatype is a data type in the ISO C library defined for storing system time values. Such values are returned from the standardtime()library function. This type is a typedef defined in the standard header.ISO C defines time_t as an arithmetic...原创 2021-06-04 10:17:15 · 172 阅读 · 0 评论 -
Cross Build procps/ps/free/kill/pidof etc
Source https://gitlab.com/procps-ng/procps###tool chain[lake@localhost8 toolchain]$ which aarch64-your-toolchain-gnu-gcc~/usr/local/kreatv/toolchain/aarch64/2.0.3/bin/aarch64-your-toolchain-gnu-gcc[lake@localhost8 toolchain]$ basename /usr/lo...原创 2021-03-29 16:59:00 · 243 阅读 · 1 评论 -
patchelf for aosp9/10 build on Centos7/Glibc<2.18
#!/usr/bin/bash# Ugly workaround for building on systems with older GLIBC versions (<2.18) on Centos7/RHEL7.x etc## ld-loader updates to prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.19-4.8# Before you patch, put GLIBC2.19 into prebuilts/gcc/li.原创 2021-01-21 16:51:55 · 442 阅读 · 0 评论 -
patchelf to change ld-linux-xxx with new glibc on old system/Centos7-RHEL7.x
####### patchelf## Change ld-linux-XXXX.so### Change with new glibc version [lake@Centos7 hello]$ pwd/home/lake/extra/source/hello### Centos7/RHEL7.x glibc is 2.17 NOT 2.18/2.19 [lake@Centos7 hello]$ rpm -qf /lib64/libc.so.6glibc-2.17-78.el7..原创 2021-01-21 16:48:20 · 378 阅读 · 0 评论 -
Cross Build GDB
1.Gdb host side with specified program profix[lake@XXXX gdb-7.10]$ ./configure --target=arm-linux-gnueabihf --program-prefix=arm-YourName-linux-gnueabihf- --prefix=$HOME/usr/local/kreatv/toolchain/hi53/2.0.3[lake@xxxx gdb-7.10]$ ./configure --...原创 2020-07-27 17:25:19 · 308 阅读 · 0 评论 -
gcc -v -Werror -I$HOME/usr/include -Wl,--verbose y.c -L$HOME/lib -llua -ldl -
gcc -v -Werror -I$HOME/usr/include -Wl,--verbose your.c -L/home/lake/usr/lib -llua -ldl -lmNote1. -v print complie detail2. -Wl,--verbose print link detail3. -c compile on...原创 2019-11-08 16:43:17 · 267 阅读 · 0 评论 -
PRINT_MACRO_HELPER
#define PRINT_MACRO_HELPER(x) #x#define PRINT_MACRO(x) #x "=" PRINT_MACRO_HELPER(x) /** C11 standard */#pragma message(PRINT_MACRO(REQUEST_TRACKER_TIMEOUT_VAL))#pragma message(PRINT_MA...原创 2019-10-31 12:54:47 · 250 阅读 · 0 评论 -
cmake/make/AosoBuild verbose print
Linux/make$make V=1For CMake, usemake VERBOSE=1; for GNU autotoolsmake V=1Note: make -s (silent) willsuppress all make log.CMakecmake --build build -v>>>CMakeLists.txt...原创 2019-10-24 10:38:17 · 336 阅读 · 0 评论 -
PRINT_MACRO
#define __HELP_PRINT_MACRO(macroname) #macroname#define PRINT_MACRO(macroname) #macroname"="__HELP_PRINT_MACRO(x)原创 2019-07-23 12:52:02 · 318 阅读 · 0 评论 -
MinGW build how to libiconv libz libjpeg libpng libtiff etc
http://www.gaia-gis.it/spatialite-2.4.0-3/mingw_how_to.htmlhttp://www.gaia-gis.it/spatialite-2.4.0-3/mingw_how_to.ht原创 2019-03-01 11:35:10 · 336 阅读 · 0 评论 -
get GCC build command line through `pkg-config --cflags --libs xxxxx`
Example/Test in Ubuntu18$ pkg-config --cflags --libs opencv-I/usr/include/opencv -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioin...原创 2019-02-21 09:41:01 · 331 阅读 · 0 评论 -
Linux from scratch git
Bootloader git clone git://git.denx.de/u-boot.gitkernelgit clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitFile System git clone git://busybox.net/busy...原创 2019-03-03 11:48:09 · 257 阅读 · 0 评论 -
Default macros of GCC/Debug __func__ etc
X86/GCC/Linux## on x86-64bit hostgcc -posix -E -dM -< /dev/null#ifdefined(__x86_64__)||defined(_M_X64)/*x8664-bit-----------------------------------------------*/#elif...原创 2018-04-24 13:34:06 · 201 阅读 · 0 评论 -
Keil C51 default macro/printf
Keil/C51#ifdef KEIL /* KEIL compiler */#ifdef __C51__ /* C51 Compiler */C lib/Keil/C51 printf format string!!unsigned short , %d, %uunsigned char , %bd,...原创 2019-03-15 09:01:59 · 488 阅读 · 0 评论 -
Jtag/TI/XDS110 manually command check/Windows/CCS
C:\>c:\ti\ccsv7\ccs_base\common\uscif\dbgjtag.exe The utility build date was 'Jul 21 2017'. The utility build time was '19:39:14'. The utility package version is '7.0.48.0'. The utility co...原创 2019-04-29 15:27:55 · 842 阅读 · 0 评论 -
RHEL8 Software/Kernel version
Refer tohttps://computingforgeeks.com/red-hat-enterprise-linux-rhel-8-new-features/Red Hat Enterprise Linux 8.0 is based on Fedora 28 andupstream kernel 4.18. This provides users with a secure, st...转载 2019-06-04 12:29:25 · 794 阅读 · 0 评论 -
MinGW/VS2019 VSCode setup. https://github.com/lakehu/hello.git
launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwl...原创 2019-06-18 10:16:49 · 3933 阅读 · 1 评论 -
NDK r19 to build standalone app/HelloWorld on Android
1. Standalone toolchain from NDK r19/2019Google/https://developer.android.com/ndk/guides/other_build_systemsUsing the NDK with other build systemsNote: The content described in this document requi...原创 2019-06-27 14:05:30 · 668 阅读 · 0 评论 -
make/Makefile verbose
1. Linux for example kernelmake V=1For CMake, usemake VERBOSE=1; for GNU autotoolsmake V=1This depends on your make program.Note: make -s (silent) willsuppress all make log.2. make ...原创 2019-07-23 10:18:53 · 2139 阅读 · 0 评论 -
Guide to predefined macros in C++ compilers (gcc, clang, msvc etc.)
https://blog.kowalczyk.info/article/j/guide-to-predefined-macros-in-c-compilers-gcc-clang-msvc-etc..htmlSoftware • About MeHome/ Guide to predefined macros in C++ compilers (gcc, clang, msvc ...转载 2019-07-23 10:38:35 · 224 阅读 · 0 评论 -
CRT lib in Win32/VC++
Reusable Library Switch Library Macro(s) DefinedSingle Threaded /ML LIBC (none) Win32 Console App/Static Lib (No MFC) Obsolete since VC2003 Debug Single MultiThread ...原创 2019-03-01 08:21:49 · 270 阅读 · 1 评论