- Sat Jun 11, 2016 11:55 am
#49004
lilzz wrote:how it can locate the library and linker script?
I compile it and it worked after I export the path
export PATH=/home/lilzz/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
but the makefile doesn't have path to library and linker script. so how does it find them?
They are in one of the locations searched by default. You can instruct the linker to print where it gets libraries by adding -Wl,-t to the compiler command line.
You'd see something like that:
Code: Select allxtensa-lx106-elf-gcc -Teagle.app.v6.ld -Wl,-t blinky.o -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc -o blinky
/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: mode elf32xtensa
blinky.o
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libmain.a)ets_timer.o
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libmain.a)user_interface.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libnet80211.a)ieee80211.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libwpa.a)ap_config.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/liblwip.a)dhcp.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libpp.a)esf_buf.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libphy.a)phy.o
...
(/home/jcmvbkbc/tmp/esp/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/libgcc.a)_divsi3.o
...
Here libgcc comes from the compiler installation, other libraries come from the sysroot directory.