title: Difference between gcc and ${CC}
body: <p>Recently I got an NXP imx8 board. And I want to test my programme. But it didn't work on imx8.</p>
  <p>When I use aarch64-poky-linux-gcc</p>
  <pre class="lang-bash prettyprint-override"><code>$ source /opt/fsl-imx-internal-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux
  $ aarch64-poky-linux-gcc -o hello hello.c
  In file included from hello.c:1:
  /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
     27 | #include &lt;bits/libc-header-start.h&gt;
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  </code></pre>
  <p>when I use ${CC}</p>
  <pre class="lang-bash prettyprint-override"><code>$ source /opt/fsl-imx-internal-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux
  
  ${CC} -o hello hello.c # it can work
  </code></pre>
  <p>So I want to know the reason.
  And I do this thing:</p>
  <pre class="lang-bash prettyprint-override"><code>$ echo 'main(){}'|aarch64-poky-linux-gcc -E -v -
  Using built-in specs.
  COLLECT_GCC=aarch64-poky-linux-gcc
  Target: aarch64-poky-linux
  Configured with: ../../../../../../work-shared/gcc-11.2.0-r0/gcc-11.2.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr --bindir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/com --localstatedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var --libdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-default-pie --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --disable-install-libiberty --disable-libssp --enable-libitm --enable-lto --disable-bootstrap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/11.2.0 --with-build-time-tools=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot --enable-standard-branch-protection --enable-poison-system-directories --disable-static --enable-nls --with-glibc-version=2.28 --enable-initfini-array --enable-__cxa_atexit
  Thread model: posix
  Supported LTO compression algorithms: zlib zstd
  gcc version 11.2.0 (GCC)
  COLLECT_GCC_OPTIONS='-E' '-v' '-mlittle-endian' '-mabi=lp64'
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/cc1 -E -quiet -v - -mlittle-endian -mabi=lp64 -dumpbase -
  ignoring nonexistent directory &quot;/not/exist/usr/lib/aarch64-poky-linux/11.2.0/include&quot;
  ignoring nonexistent directory &quot;/not/exist/usr/local/include&quot;
  ignoring nonexistent directory &quot;/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/../../../../../aarch64-poky-linux/include&quot;
  ignoring nonexistent directory &quot;/not/exist/usr/include/&quot;
  #include &quot;...&quot; search starts here:
  #include &lt;...&gt; search starts here:
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/include
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/include-fixed
  End of search list.
  # 0 &quot;&lt;stdin&gt;&quot;
  # 0 &quot;&lt;built-in&gt;&quot;
  # 0 &quot;&lt;command-line&gt;&quot;
  # 1 &quot;&lt;stdin&gt;&quot;
  main(){}
  COMPILER_PATH=/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/
  LIBRARY_PATH=/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/
  COLLECT_GCC_OPTIONS='-E' '-v' '-mlittle-endian' '-mabi=lp64'
  
  $ echo 'main(){}'|${CC} -E -v -
  Using built-in specs.
  COLLECT_GCC=aarch64-poky-linux-gcc
  Target: aarch64-poky-linux
  Configured with: ../../../../../../work-shared/gcc-11.2.0-r0/gcc-11.2.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr --bindir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/com --localstatedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/var --libdir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-default-pie --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --disable-install-libiberty --disable-libssp --enable-libitm --enable-lto --disable-bootstrap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/11.2.0 --with-build-time-tools=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/bamboo/build/5.15-kirkstone-full/fsl-imx-internal-xwayland/mx8m/yocto/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/11.2.0-r0/recipe-sysroot --enable-standard-branch-protection --enable-poison-system-directories --disable-static --enable-nls --with-glibc-version=2.28 --enable-initfini-array --enable-__cxa_atexit
  Thread model: posix
  Supported LTO compression algorithms: zlib zstd
  gcc version 11.2.0 (GCC)
  COLLECT_GCC_OPTIONS='-march=armv8-a+crc+crypto' '-fstack-protector-strong' '-O2' '-D' '_FORTIFY_SOURCE=2' '-Wformat=1' '-Wformat-security' '-Werror=format-security' '-E' '-v' '-mlittle-endian' '-mabi=lp64'
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/cc1 -E -quiet -v -isysroot /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux -D _FORTIFY_SOURCE=2 - -march=armv8-a+crc+crypto -mlittle-endian -mabi=lp64 -Wformat=1 -Wformat-security -Werror=format-security -fstack-protector-strong -O2 -dumpbase -
  ignoring nonexistent directory &quot;/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/local/include&quot;
  ignoring nonexistent directory &quot;/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/../../../../../aarch64-poky-linux/include&quot;
  #include &quot;...&quot; search starts here:
  #include &lt;...&gt; search starts here:
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/include
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/lib/aarch64-poky-linux/11.2.0/include
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/include-fixed
   /opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/include/
  End of search list.
  # 0 &quot;&lt;stdin&gt;&quot;
  # 0 &quot;&lt;built-in&gt;&quot;
  # 0 &quot;&lt;command-line&gt;&quot;
  # 1 &quot;/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/include/stdc-predef.h&quot; 1 3 4
  # 0 &quot;&lt;command-line&gt;&quot; 2
  # 1 &quot;&lt;stdin&gt;&quot;
  main(){}
  COMPILER_PATH=/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/
  LIBRARY_PATH=/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/lib/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/lib/aarch64-poky-linux/11.2.0/:/opt/fsl-imx-internal-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/lib/
  COLLECT_GCC_OPTIONS='-march=armv8-a+crc+crypto' '-fstack-protector-strong' '-O2' '-D' '_FORTIFY_SOURCE=2' '-Wformat=1' '-Wformat-security' '-Werror=format-security' '-E' '-v' '-mlittle-endian' '-mabi=lp64'
  </code></pre>
  <p>I found that they both use aarch64-poky-linux-gcc. But I still don't know the difference between them.</p>