Raspberry PI 4 –ийг
ажиллуулах Bare
Metal C Programming аргачлал холбоотой хөгжүүлэлтийн орчиныг бүрдүүлэхэд тухай судалж үзэцгээе. http://agrielectronic.com/
Одоогын
хөгжүүлэлтийн орчин нь Ubuntu 18.04 LTS орчинд хийх болно. Raspberry PI 4 нь Ubuntu 18.04
LTS орчинд баг зэрэг алдаанууд гарч ирнэ. Шалтгаан нь Raspberry PI 4 нь
2018 он, 2019 онд бүтээгдсэн болохоор хөгжүүлэлтийн програм хангамжууд нь Ubuntu
18 хэрэглэхээр зохицуулагдсан, тиймээс програм пакетууд нь Ubuntu 16.04 LTS
дээр ажиллахгүй байгаатай холбоотой юм. http://agrielectronic.com/
Жишээлбэл
дараахтай адил Raspberry Pi Imager нь Ubuntu 16.04 LTS дээр ажиллахгүй. http://agrielectronic.com/
Зураг1. Суурилуулалтын эхлэлийн зураг
Эхлээд Barametal тай холбоотой C Program эх код нь Raspberry PI 3-д
зориулсан тэрхүү агуулгын хүрээнд орчиныг бүрдүүлэх болно. Raspberry PI 3-д
тохируулсан эх код нь https://github.com/bztsrc/raspi3-tutorial линк дээрээс жишээнүүдийг 00_crosscompiler доторхи агуулга нь ARM 64 bit
кросскомпайлерийг тохируулах жишээ c-program компайл хийж үзсэн. http://agrielectronic.com/
Зураг2. Raspberry PI 3-ийн жишээ програмууд
Raspberry PI 3 болон
Raspberry Pi 4 –уудын санах ойн хуваарилалт (memory mapping) хэрхэн ялгаатайг
олж үзье гэвэл Raspberry
Pi 4 –ийн Kernel
Source дотор байгаа төхөөрөмж модны бүтэцийг (device tree) сайн аналуз хийж
үзвэл, оролт гаралтын интерфейсүүд (Peripheral) хамааралттай хэсэг виртуал
хаягууд болох 0x3F00-0000 ~ 0xFE00-000 солигдсоныг мэдэж болно. Тухайлбал GPIO.h
файлыг засах өөрчлөх шаардлагатай. http://agrielectronic.com/
Дараахь мэдээлэлийг нэмэлт материал байдлаар орууллаа. 00_crosscompiler
фолдер дотор байгаа README.md файлын агуулаг болно. Энэхүү нэмэлт материал нь CrossCompiler –ыг хэрхэн
тохируулах тайлбарласан. http://agrielectronic.com/
AArch64 Cross Compiler
Before we could start our
tutorials, you'll need some tools. Namely a compiler that compiles for the
AArch64 architecture and it's companion utilities. http://agrielectronic.com/
IMPORTANT
NOTE:
this description is not about how to compile a cross-compiler in general. It's
about how to compile one specifically for the aarch64-elf target. If you have problems,
google "how to build a gcc cross-compiler" or ask on an appropriate
support forum for your operating system. I can't and won't help you with your
environment, you have to solve that on your own. As I've said in the
introduction I assume you know how to compile programs (including the
compilation of the cross-compiler). http://agrielectronic.com/
Each directory has two
Makefiles, one for the GNU gcc, and one for LLVM clang. Pick the one you
prefer. I could have used makefile variables and a common configuration, but it
was important that each tutorial must be self-contained and dependency-free.
LLVM Compiler and Linker
Clang by design is a
cross-compiler, therefore you don't have to build a special version of it like
with gcc. For some (probably archaical) reason the corresponding linker uses a
different target (no '-' in it), keep that in mind. http://agrielectronic.com/
clang
--target=aarch64-elf
ld.lld -m aarch64elf
Build
system
To orchestrate compilation, we'll
use GNU make. No need for cross-compiling this, as we are about to use it on
the host computer only, and not on the target machine. The reason I choosed
this build system for the tutorials is that GNU make is also required to
compile the GNU compiler, so you'll need it anyway. http://agrielectronic.com/
Download and unpack sources
First of all, download
binutils and gcc sources. In this example I've used the latest versions as of
writing. You are advised to check the mirrors and modify filenames accordly.
wget https://ftpmirror.gnu.org/binutils/binutils-2.30.tar.gz
wget
https://ftpmirror.gnu.org/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz
wget
https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.gz
wget
https://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2
wget
https://ftpmirror.gnu.org/mpc/mpc-1.1.0.tar.gz
wget
https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
wget
https://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz
If you want to verify the
downloads, you can also download the checksums and signatures:
wget
https://ftpmirror.gnu.org/binutils/binutils-2.30.tar.gz.sig
wget
https://ftpmirror.gnu.org/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz.sig
wget
https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.gz.sig
wget
https://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2.sig
wget
https://ftpmirror.gnu.org/mpc/mpc-1.1.0.tar.gz.sig
wget
https://gcc.gnu.org/pub/gcc/infrastructure/sha512.sum
Once the download finished,
verify the downloads by running:
sha512sum -c sha512.sum
--ignore-missing
for
i in *.sig; do gpg2 --auto-key-retrieve --verify-files "${i}"; done
The first command should say
'OK' for isl and cloog, the second should say 'Good signature' for the other
files.
Then unpack the tarballs with
these commands:
for i in *.tar.gz; do tar
-xzf $i; done
for
i in *.tar.bz2; do tar -xjf $i; done
Remove the files, we don't
need anymore:
rm
-f *.tar.* sha512.sum
You'll need some symbolic
links before you could start the compilation, so let's create them:
cd binutils-*
ln -s ../isl-* isl
cd ..
cd gcc-*
ln -s ../isl-* isl
ln -s ../mpfr-* mpfr
ln -s ../gmp-* gmp
ln -s ../mpc-* mpc
ln -s ../cloog-* cloog
cd
..
Compiling the sources
Okay, now we have to build
two packages. One is called binutils,
which includes linker, assembler and other useful commands. http://agrielectronic.com/
mkdir aarch64-binutils
cd aarch64-binutils
../binutils-*/configure --prefix=/usr/local/cross-compiler
--target=aarch64-elf \
--enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit \
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j4
make install
cd
..
The first argument tells the
configure script to install the build in /usr/local/cross-compiler.
The second specifies the target architecture, for which we want the tools to be
compiled. The other arguments turn specific options on and off, don't bother.
It's enough to know they are appropriately tweeked for an embedded system
compiler.
And the second package, of
course we'll need the gcc
compiler itself.
mkdir aarch64-gcc
cd aarch64-gcc
../gcc-*/configure
--prefix=/usr/local/cross-compiler --target=aarch64-elf --enable-languages=c \
--enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit \
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j4 all-gcc
make install-gcc
cd
..
Here we specify the same
directory and architecture as before. We also tell to compile only the C
compiler, as gcc otherwise would support tons of languages we don't need. This
reduces the compilation time significantly. The remaining arguments are the
same as with binutils. http://agrielectronic.com/
Now check bin
folder in your /usr/local/cross-compiler
directory. You should see a lot of executables there. You probably also want to
add this directory to your PATH environment variable. http://agrielectronic.com/
$ ls
/usr/local/cross-compiler/bin
aarch64-elf-addr2line aarch64-elf-elfedit aarch64-elf-gcc-ranlib aarch64-elf-ld aarch64-elf-ranlib
aarch64-elf-ar aarch64-elf-gcc aarch64-elf-gcov aarch64-elf-ld.bfd aarch64-elf-readelf
aarch64-elf-as aarch64-elf-gcc-7.2.0 aarch64-elf-gcov-dump aarch64-elf-nm aarch64-elf-size
aarch64-elf-c++filt aarch64-elf-gcc-ar aarch64-elf-gcov-tool aarch64-elf-objcopy aarch64-elf-strings
aarch64-elf-cpp aarch64-elf-gcc-nm aarch64-elf-gprof aarch64-elf-objdump aarch64-elf-strip
The executables we are
interested in:
·
aarch64-elf-as
- the assembler
·
aarch64-elf-gcc
- the C compiler
·
aarch64-elf-ld
- the linker
·
aarch64-elf-objcopy
- to convert ELF executable into IMG format
·
aarch64-elf-objdump
- utility to disassemble executables (for debugging)
·
aarch64-elf-readelf
- an useful utility to dump sections and segments in executables (for debugging)
If you have all of the above
six executables and you can also run them without error messages, congrats! You
have all the tools needed, you can start to work with my tutorials!
///////////////////////////////////////
home/wcham фолдер
дотор ажлын фолдер болох
RaspBareMetal –г үүсгэнэ.
Энд
дараахтай адил коммандаар binutils болон gcc тэй холбоотой
эх кодуудыг татаж авна. Миний хувьд ham1.sh файл үүсгээд ажиллуулсан.
#HAM binutils, gcc эх кодуудыг татаж авна. http://agrielectronic.com/
wget https://ftpmirror.gnu.org/binutils/binutils-2.30.tar.gz
wget
https://ftpmirror.gnu.org/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz
wget
https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.gz
wget
https://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2
wget
https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
Одоо дараах
командуудыг ажиллуулснаар “check sum” болон “signature” холбоотой файлуудын татаж авсан байдлыг шалгахад хэрэглэнэ.
http://agrielectronic.com/
wget
https://ftpmirror.gnu.org/binutils/binutils-2.30.tar.gz.sig
wget
https://ftpmirror.gnu.org/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz.sig
wget
https://ftpmirror.gnu.org/mpfr/mpfr-4.0.1.tar.gz.sig
wget https://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2.sig
wget
https://ftpmirror.gnu.org/mpc/mpc-1.1.0.tar.gz.sig
wget
https://gcc.gnu.org/pub/gcc/infrastructure/sha512.sum
Дээрхи
үйлдлүүдийг хялбар хийхийн тулд ham2.sh файл үүсгээд ажиллуулсан.
Одоо дараах
командыг ажилуулан татаж авсан файлыг шалгана. Энэ тохиолдолд ч гэсэн ham3.sh
файл үүсгээд ажилуулсан.
Энэ үед gpg2
команд ажилаагүй учраас дараах үйлдлийг хийсэн
sudo apt
install gnupg2
Ингээд
ham3.sh нь ажиллуулна. Файл тус бүрийн Signature –г шалгана. Дараах хийгдсэн агуулгын нэг хэсэг юм.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
gpg: Good signature from
"Andreas Enge <andreas@enge.fr>" [unknown]
gpg: aka "Andreas Enge
<andreas.enge@inria.fr>" [unknown]
gpg: WARNING: This key is not
certified with a trusted signature!
gpg: There is no indication that the
signature belongs to the owner.
Primary key fingerprint: AD17
A21E F8AE D8F1 CC02 DBD9 F7D5 C9BF 765C
61E3
gpg: assuming signed data in
'mpfr-4.0.1.tar.gz'
gpg: Signature made 2018년 02월 08일 (목)
gpg: using DSA key
07F3DBBECC1A39605078094D980C197698C3739D
gpg: key 980C197698C3739D: 24
signatures not checked due to missing keys
gpg: key 980C197698C3739D:
public key "Vincent Lefevre <vincent@vinc17.net>" imported
gpg: no ultimately trusted
keys found
gpg: Total number processed:
1
gpg: imported: 1
gpg: Good signature from
"Vincent Lefevre <vincent@vinc17.net>" [unknown]
gpg: aka "Vincent Lefevre
<vincent@vinc17.org>" [unknown]
gpg: aka "Vincent Lefèvre
<vincent@vinc17.net>" [unknown]
gpg: aka "Vincent Lefèvre
<vincent@vinc17.org>" [unknown]
gpg: aka "Vincent Lefevre
<Vincent.Lefevre@inria.fr>" [unknown]
gpg: aka "Vincent Lefèvre
<Vincent.Lefevre@inria.fr>" [unknown]
gpg: aka "Vincent Lefevre
<Vincent.Lefevre@ens-lyon.fr>" [unknown]
gpg: aka "Vincent Lefèvre <Vincent.Lefevre@ens-lyon.fr>"
[unknown]
gpg: WARNING: This key is not
certified with a trusted signature!
gpg: There is no indication that the
signature belongs to the owner.
Primary key fingerprint: 07F3
DBBE CC1A 3960 5078 094D 980C 1976 98C3 739D
wcham@wcham-C7Z270-CG:~/RaspBareMetal$
////////////////////////////////////////////////////////////////////////////////////////////////
Одоо дараах
командыг ажилуулан файлуудыг задлана. Энэ үйлдлийг ч бас ham4.sh –г үүсгээд
хийсэн.
Одоо
дараахтай адил Symbolic link хийх шаардлагатай бол доорхитой адил хийнэ.
cd binutils-*
ln -s ../isl-* isl
cd ..
cd gcc-*
ln -s ../isl-* isl
ln -s ../mpfr-* mpfr
ln -s ../gmp-* gmp
ln -s ../mpc-* mpc
ln -s ../cloog-* cloog
cd
..
Дээрхи
бичилтээс “*” нь хувилбартай холбоотой
хэрэглэнэ.
binutils-* → binutils-2.30
isl-* → isl-0.18
gcc-* → gcc-8.1.0
isl-* → isl-0.18
mpfr-* → mpfr-4.0.1
gmp-* → gmp-6.1.2
mpc-* → mpc-1.1.0
cloog-* →
cloog-0.18.1
http://agrielectronic.com/
Энэ
үйлдлүүдийг ham5.sh үүсгээд хийсэн болно. http://agrielectronic.com/
Одоо дараах
адил aarch64-binutils фолдер
нэгийг үүсгээд, тэнд нь дараахтай адил бичээд ажилуулна. http://agrielectronic.com/
mkdir aarch64-binutils
cd aarch64-binutils
../binutils-*/configure
--prefix=/usr/local/cross-compiler --target=aarch64-elf \
--enable-shared --enable-threads=posix
--enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit \
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j4
make install
cd
..
Дээрхийг дараахтай адилаар солионо.
mkdir aarch64-binutils
cd aarch64-binutils
../binutils-2.30/configure
--prefix=/usr/local/cross-compiler --target=aarch64-elf \
--enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit
\
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j8
make install
cd
.
Эндээс binutils-* нь binutils-2.30 –ийг
хувилбараар хэрэглэнэ..
Make командыг ажилуулбал
дараахтай адил алдаа гарсан.
configure: error: gmp.h
header not found
yes
…
onfig.status: executing
default commands
make[1]: Leaving directory
'/home/wcham/RaspBareMetal/aarch64-binutils'
Makefile:850: recipe for
target 'all' failed
make: *** [all] Error 2
Гэсэн хэдийч асуудлууд гарч ирээд асаж янзлах ажилууд байна.
Make install
Энэ
командын хувьд “Permission Error” гараад “sudo” командыг дахиад хэрэглэх шаардлага гарна.
sudo make install
http://agrielectronic.com/
Одоо дараах
“gcc” –тэй холбоотой ажиллыг хийж үзье.
mkdir aarch64-gcc
cd aarch64-gcc
../gcc-*/configure
--prefix=/usr/local/cross-compiler --target=aarch64-elf --enable-languages=c \
--enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit \
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j4 all-gcc
make install-gcc
cd
..
Магадгүй
энд “gcc-* нь gcc-8.1.0- г хэрэглэсэн. Яг хэрэглэсэн бичилт нь дараахьтай адил
болно.
mkdir aarch64-gcc
cd aarch64-gcc
../gcc-8.1.0/configure
--prefix=/usr/local/cross-compiler --target=aarch64-elf --enable-languages=c \
--enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit \
--disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-plugin \
--disable-linker-build-id
--enable-lto --enable-install-libiberty --with-linker-hash-style=gnu
--with-gnu-ld\
--enable-gnu-indirect-function
--disable-multilib --disable-werror --enable-checking=release
--enable-default-pie \
--enable-default-ssp
--enable-gnu-unique-object
make -j8 all-gcc
sudo make install-gcc
cd
..
Дээрхээс “make -j8” команд нь дараахтай адил “thread”
тэй холбоотой алдаа гарсан.
http://agrielectronic.com/
///////////////////////
./gthr-default.h:35:10: fatal
error: pthread.h: No such file or directory
#include <pthread.h>
^~~~~~~~~~~
compilation terminated.
../../../gcc-8.1.0/libgcc/static-object.mk:17:
recipe for target 'unwind-dw2-fde.o' failed
make[2]: ***
[unwind-dw2-fde.o] Error 1
make[2]: *** Waiting for
unfinished jobs....
../../../gcc-8.1.0/libgcc/static-object.mk:17:
recipe for target 'unwind-dw2.o' failed
make[2]: *** [unwind-dw2.o]
Error 1
In file included from
../../../gcc-8.1.0/libgcc/gthr.h:148,
from
../../../gcc-8.1.0/libgcc/unwind-sjlj.c:31:
./gthr-default.h:35:10: fatal
error: pthread.h: No such file or directory
#include <pthread.h>
^~~~~~~~~~~
compilation terminated.
../../../gcc-8.1.0/libgcc/static-object.mk:17:
recipe for target 'unwind-sjlj.o' failed
make[2]: *** [unwind-sjlj.o]
Error 1
In file included from
../../../gcc-8.1.0/libgcc/gthr.h:148,
from
../../../gcc-8.1.0/libgcc/emutls.c:31:
./gthr-default.h:35:10: fatal
error: pthread.h: No such file or directory
#include <pthread.h>
^~~~~~~~~~~
compilation terminated.
../../../gcc-8.1.0/libgcc/static-object.mk:17:
recipe for target 'emutls.o' failed
make[2]: *** [emutls.o] Error
1
libtool: link: g++ -fPIC -DPIC -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o
.libs/libcp1plugin.o .libs/callbacks.o .libs/connection.o
.libs/marshall.o
-L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o -static-libstdc++ -static-libgcc
../libiberty/pic/libiberty.a
-Wl,-soname -Wl,libcp1plugin.so.0 -Wl,-retain-symbols-file
-Wl,../../gcc-8.1.0/libcc1/libcp1plugin.sym -o .libs/libcp1plugin.so.0.0.0
make[2]: Leaving directory
'/home/wcham/RaspBareMetal/aarch64-gcc/aarch64-elf/libgcc'
Makefile:12956: recipe for
target 'all-target-libgcc' failed
make[1]: ***
[all-target-libgcc] Error 2
make[1]: *** Waiting for
unfinished jobs....
libtool: link: (cd
".libs"&& rm -f "libcp1plugin.so.0"&& ln -s
"libcp1plugin.so.0.0.0""libcp1plugin.so.0")
libtool: link: (cd
".libs"&& rm -f "libcp1plugin.so"&& ln -s
"libcp1plugin.so.0.0.0""libcp1plugin.so")
libtool: link: ( cd
".libs"&& rm -f "libcp1plugin.la"&& ln -s
"../libcp1plugin.la""libcp1plugin.la" )
make[3]: Leaving directory
'/home/wcham/RaspBareMetal/aarch64-gcc/libcc1'
make[2]: Leaving directory
'/home/wcham/RaspBareMetal/aarch64-gcc/libcc1'
make[1]: Leaving directory
'/home/wcham/RaspBareMetal/aarch64-gcc'
Makefile:891: recipe for
target 'all' failed
make: *** [all] Error 2
///////////////////////////////
emutls.so файлыг үүсгэж чадахгүй гэсэн алдаа гарч ирсэн.
http://agrielectronic.com/
Жаахан ажиглаад үзвэл “make
install all-gcc” –г ажилуулах ёстой байсан ч
буруу команд “make
-j8” ажилуулсан.
Тэгээд
дахиад “make install all-gcc” –г ажилуулахад ямарч асуудал байхгүй болсон.
http://agrielectronic.com/
Одоо
“sudo make install-gcc”-г ажилуулана. Ажилуулахад ямарч асуудалгүй
болох дараах зурагаас харж болох юм.
Одоо бүх
зүйл амжилттай болбол “/usr/local/cross-compiler/bin” фолдер дотор “64bit arm” –тай холбоотой “compiler, linker” –ууд нь бүгд үүссэн болох харж болно.
http://agrielectronic.com/
Дараах нь
дээр хийсэн ажилын үр дүн юм. http://agrielectronic.com/
Компайлдаад
ажилууд амжилттай болсныг дараах командыг ажилуулаад шалгаж үзэж болно.
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$ ./aarch64-elf-as
--version
GNU assembler (GNU Binutils)
2.30
Copyright (C) 2018 Free
Software Foundation, Inc.
This program is free
software; you may redistribute it under the terms of
the GNU General Public
License version 3 or later.
This program has absolutely
no warranty.
This assembler was configured
for a target of `aarch64-elf'.
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$ ./aarch64-elf-gcc
--version
aarch64-elf-gcc (GCC) 8.1.0
Copyright (C) 2018 Free
Software Foundation, Inc.
This is free software; see
the source for copying conditions. There
is NO
warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$ ./aarch64-elf-ld
--version
GNU ld (GNU Binutils) 2.30
Copyright (C) 2018 Free
Software Foundation, Inc.
This program is free
software; you may redistribute it under the terms of
the GNU General Public
License version 3 or (at your option) a later version.
This program has absolutely
no warranty
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$
./aarch64-elf-objcopy --version
GNU objcopy (GNU Binutils)
2.30
Copyright (C) 2018 Free
Software Foundation, Inc.
This program is free
software; you may redistribute it under the terms of
the GNU General Public
License version 3 or (at your option) any later version.
This program has absolutely
no warranty.
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$
./aarch64-elf-objdump --version
GNU objdump (GNU Binutils)
2.30
Copyright (C) 2018 Free
Software Foundation, Inc.
This program is free
software; you may redistribute it under the terms of
the GNU General Public
License version 3 or (at your option) any later version.
This program has absolutely
no warranty.
wcham@wcham-C7Z270-CG:/usr/local/cross-compiler/bin$
./aarch64-elf-readelf --version
GNU readelf (GNU Binutils)
2.30
Copyright (C) 2018 Free Software
Foundation, Inc.
This program is free
software; you may redistribute it under the terms of
the GNU General Public
License version 3 or (at your option) any later version.
This program has absolutely
no warranty.
Одоо энэ
түүлийг(tool) ашиглаад ажилладаг програмууд(executable
program) үүсгэж үзэцгээе.
Нэмэлт
материал: