Dynalib location not same as exported location

I’m still trying to build the firmware for my new mesh dev kits … I now get the following error:

/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: Dynalib location not correct
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: Dynalib location not same as exported location
collect2: error: ld returned 1 exit status                                     
../../../build/module.mk:232: recipe for target '../../../build/target/user-part/platform-14-m/user-part.elf' failed
make[1]: *** [../../../build/target/user-part/platform-14-m/user-part.elf] Error 1
make[1]: Leaving directory '/firmware/modules/xenon/user-part'                 
makefile:85: recipe for target '/firmware/modules/xenon/user-part/makefile' failed
make: *** [/firmware/modules/xenon/user-part/makefile] Error 2                 

These are the steps I followed this time:

nottheoilrig@debian:~$ git clone -b mesh-develop https://github.com/particle-iot/firmware.git
Cloning into 'firmware'...
remote: Enumerating objects: 176, done.
remote: Counting objects: 100% (176/176), done.
remote: Compressing objects: 100% (117/117), done.
remote: Total 82722 (delta 92), reused 111 (delta 59), pack-reused 82546
Receiving objects: 100% (82722/82722), 125.30 MiB | 3.50 MiB/s, done.          
Resolving deltas: 100% (58624/58624), done.                                    
nottheoilrig@debian:~$ cd firmware/modules                                     
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ git submodule update --init
Submodule 'gsm0710muxer/gsm0710muxer' (https://github.com/particle-iot/gsm0710muxer.git) registered for path '../gsm0710muxer/gsm0710muxer'                    
Submodule 'proto' (https://github.com/particle-iot/firmware-protobuf.git) registered for path '../proto'
Submodule 'third_party/freertos/freertos' (https://github.com/particle-iot/freertos.git) registered for path '../third_party/freertos/freertos'                
Submodule 'third_party/littlefs/littlefs' (https://github.com/particle-iot/littlefs.git) registered for path '../third_party/littlefs/littlefs'                
Submodule 'third_party/lwip/lwip' (https://github.com/particle-iot/lwip.git) registered for path '../third_party/lwip/lwip'                                    
Submodule 'third_party/lwip/lwip-contrib' (https://github.com/particle-iot/lwip-contrib.git) registered for path '../third_party/lwip/lwip-contrib'            
Submodule 'third_party/mbedtls/mbedtls' (https://github.com/particle-iot/mbedtls.git) registered for path '../third_party/mbedtls/mbedtls'                     
Submodule 'third_party/miniz/miniz' (https://github.com/particle-iot/miniz.git)
registered for path '../third_party/miniz/miniz'                               
Submodule 'third_party/nanopb/nanopb' (https://github.com/particle-iot/nanopb.git) registered for path '../third_party/nanopb/nanopb'                          
Submodule 'third_party/nrf5_sdk/nrf5_sdk' (https://github.com/particle-iot/nrf5_sdk.git) registered for path '../third_party/nrf5_sdk/nrf5_sdk'                
Submodule 'third_party/nrf_802154/nrf_802154' (https://github.com/NordicSemiconductor/nRF-IEEE-802.15.4-radio-driver.git) registered for path '../third_party/nrf_802154/nrf_802154'
Submodule 'third_party/openthread/openthread' (https://github.com/particle-iot/openthread.git) registered for path '../third_party/openthread/openthread'      
Submodule 'third_party/wiznet_driver/wiznet_driver' (https://github.com/particle-iot/ioLibrary_Driver.git) registered for path '../third_party/wiznet_driver/wiznet_driver'
Cloning into '/home/nottheoilrig/firmware/gsm0710muxer/gsm0710muxer'...        
Cloning into '/home/nottheoilrig/firmware/proto'...                            
Cloning into '/home/nottheoilrig/firmware/third_party/freertos/freertos'...    
Cloning into '/home/nottheoilrig/firmware/third_party/littlefs/littlefs'...    
Cloning into '/home/nottheoilrig/firmware/third_party/lwip/lwip'...            
Cloning into '/home/nottheoilrig/firmware/third_party/lwip/lwip-contrib'...    
Cloning into '/home/nottheoilrig/firmware/third_party/mbedtls/mbedtls'...      
Cloning into '/home/nottheoilrig/firmware/third_party/miniz/miniz'...          
Cloning into '/home/nottheoilrig/firmware/third_party/nanopb/nanopb'...        
Cloning into '/home/nottheoilrig/firmware/third_party/nrf5_sdk/nrf5_sdk'...    
Cloning into '/home/nottheoilrig/firmware/third_party/nrf_802154/nrf_802154'...
Cloning into '/home/nottheoilrig/firmware/third_party/openthread/openthread'...
Cloning into '/home/nottheoilrig/firmware/third_party/wiznet_driver/wiznet_driver'...
Submodule path '../gsm0710muxer/gsm0710muxer': checked out '3cdbf88bc1c1a6c75c484bda36936b94d9146dbd'
Submodule path '../proto': checked out '005aea3bb6eae6067c1a9bb7cac2c73ba8830a2c'
Submodule path '../third_party/freertos/freertos': checked out '3feb84fee1840c0a8a3ea50810fb5f3e7527c6ce'
Submodule path '../third_party/littlefs/littlefs': checked out '9996634a148c68f6135318cce0f69b9debf73469'
Submodule path '../third_party/lwip/lwip': checked out 'd4faff78f96cf4f7f2b46f790a711d4ad3f7003f'
Submodule path '../third_party/lwip/lwip-contrib': checked out 'cce6cd11ffc1e0bddcb5a9c96674d1a7ae73e36f'
Submodule path '../third_party/mbedtls/mbedtls': checked out '48fe5b1030039557c6a6340d22bb473fc8042920'
Submodule path '../third_party/miniz/miniz': checked out 'f07041c88cdbb5a85401a0f49366cac2143871d8'
Submodule path '../third_party/nanopb/nanopb': checked out '2d40a90db76036458cf1150cdf5979e5e5fc77c6'
Submodule path '../third_party/nrf5_sdk/nrf5_sdk': checked out '8433b5f2ea1bce4135f3b96ef7f24507b41a1017'
Submodule path '../third_party/nrf_802154/nrf_802154': checked out '4fbe9d9d29291921295c1df56b6ffb6f44d53af7'
Submodule path '../third_party/openthread/openthread': checked out 'bc2c9e68cf9b669dffb46c645a39e2dc089de67c'
Submodule path '../third_party/wiznet_driver/wiznet_driver': checked out '53401b1d55b63641f60577e40e6996da59d71fd5'
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ make PLATFORM=xenon

I followed these instructions. What causes this error? What am I missing now?

I think you need to use gcc-arm 5.3.1 (5_3-2016q1), not 5.4.1.

On my machine:

arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.3.1 20160307 (release) [ARM/embedded-5-branch revision 234589]

I think I ran your exact commands in a fresh directory:

git clone -b mesh-develop https://github.com/particle-iot/firmware.git
cd firmware/
git submodule update --init
cd modules
make PLATFORM=xenon

And it built successfully:

mv -f ../../../build/target/user-part/platform-14-m/user-part_fi.elf ../../../build/target/user-part/platform-14-m/user-part.elf

Invoking: ARM GNU Create Flash Image
arm-none-eabi-objcopy -O binary ../../../build/target/user-part/platform-14-m/user-part.elf ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc
if [ -s ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc ]; then \
	head -c $((`stat -f%z ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc` - 38)) ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-14-m/user-part.bin.no_crc && \
	tail -c 38 ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-14-m/user-part.bin.crc_block && \
	test "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20280078563412" = `xxd -p -c 500 ../../../build/target/user-part/platform-14-m/user-part.bin.crc_block` && \
	shasum -a 256 ../../../build/target/user-part/platform-14-m/user-part.bin.no_crc | cut -c 1-65 | xxd -r -p | dd bs=1 of=../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc seek=$((`stat -f%z ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc` - 38)) conv=notrunc  && \
	head -c $((`stat -f%z ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc` - 4)) ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-14-m/user-part.bin.no_crc && \
	 crc32 ../../../build/target/user-part/platform-14-m/user-part.bin.no_crc | cut -c 1-10 | xxd -r -p | dd bs=1 of=../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc seek=$((`stat -f%z ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc` - 4)) conv=notrunc ;\
	fi
32+0 records in
32+0 records out
32 bytes transferred in 0.039248 secs (815 bytes/sec)
4+0 records in
4+0 records out
4 bytes transferred in 0.075726 secs (53 bytes/sec)
[ ! -f ../../../build/target/user-part/platform-14-m/user-part.bin ] || rm ../../../build/target/user-part/platform-14-m/user-part.bin
mv ../../../build/target/user-part/platform-14-m/user-part.bin.pre_crc ../../../build/target/user-part/platform-14-m/user-part.bin

arm-none-eabi-objcopy -O ihex ../../../build/target/user-part/platform-14-m/user-part.elf ../../../build/target/user-part/platform-14-m/user-part.hex
arm-none-eabi-size --format=berkeley ../../../build/target/user-part/platform-14-m/user-part.elf
   text	   data	    bss	    dec	    hex	filename
  10916	    152	    804	  11872	   2e60	../../../build/target/user-part/platform-14-m/user-part.elf
rm -f module_user_memory.ld
arm-none-eabi-objdump -h -S ../../../build/target/user-part/platform-14-m/user-part.elf > ../../../build/target/user-part/platform-14-m/user-part.lst
3 Likes

Okay, the following worked. I built the firmware for my Xenon dev kit. Thank you!

I am curious why I get “Dynalib location not same as exported location” with the Debian 5.4.1+svn241155-1+9 toolchain, but not with the Arm 5_3-2016q1 one … Any idea? I find it more frictionless to use the toolchain that comes with my distribution, unless there’s a specific reason that that doesn’t work.

nottheoilrig@debian:~$ wget armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/gccarmnoneeabi532016q120160330linuxtar.bz2
--2018-11-14 11:02:40--  http://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/gccarmnoneeabi532016q120160330linuxtar.bz2
Resolving armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)... 52.239.137.100
Connecting to armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)|52.239.137.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 93090908 (89M) [application/octet-stream]
Saving to: ‘gccarmnoneeabi532016q120160330linuxtar.bz2’

gccarmnoneeabi53201 100%[===================>]  88.78M   310KB/s    in 2m 26s  

2018-11-14 11:05:06 (622 KB/s) - ‘gccarmnoneeabi532016q120160330linuxtar.bz2’ saved [93090908/93090908]

nottheoilrig@debian:~$ tar xf gccarmnoneeabi532016q120160330linuxtar.bz2
nottheoilrig@debian:~$ git clone -b mesh-develop https://github.com/particle-iot/firmware.git
Cloning into 'firmware'...
remote: Enumerating objects: 184, done.
remote: Counting objects: 100% (184/184), done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 82730 (delta 92), reused 114 (delta 60), pack-reused 82546
Receiving objects: 100% (82730/82730), 125.31 MiB | 3.87 MiB/s, done.
Resolving deltas: 100% (58624/58624), done.
nottheoilrig@debian:~$ cd firmware/modules
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ git submodule update --init
Submodule 'gsm0710muxer/gsm0710muxer' (https://github.com/particle-iot/gsm0710muxer.git) registered for path '../gsm0710muxer/gsm0710muxer'
Submodule 'proto' (https://github.com/particle-iot/firmware-protobuf.git) registered for path '../proto'
Submodule 'third_party/freertos/freertos' (https://github.com/particle-iot/freertos.git) registered for path '../third_party/freertos/freertos'
Submodule 'third_party/littlefs/littlefs' (https://github.com/particle-iot/littlefs.git) registered for path '../third_party/littlefs/littlefs'
Submodule 'third_party/lwip/lwip' (https://github.com/particle-iot/lwip.git) registered for path '../third_party/lwip/lwip'
Submodule 'third_party/lwip/lwip-contrib' (https://github.com/particle-iot/lwip-contrib.git) registered for path '../third_party/lwip/lwip-contrib'
Submodule 'third_party/mbedtls/mbedtls' (https://github.com/particle-iot/mbedtls.git) registered for path '../third_party/mbedtls/mbedtls'
Submodule 'third_party/miniz/miniz' (https://github.com/particle-iot/miniz.git) registered for path '../third_party/miniz/miniz'
Submodule 'third_party/nanopb/nanopb' (https://github.com/particle-iot/nanopb.git) registered for path '../third_party/nanopb/nanopb'
Submodule 'third_party/nrf5_sdk/nrf5_sdk' (https://github.com/particle-iot/nrf5_sdk.git) registered for path '../third_party/nrf5_sdk/nrf5_sdk'
Submodule 'third_party/nrf_802154/nrf_802154' (https://github.com/NordicSemiconductor/nRF-IEEE-802.15.4-radio-driver.git) registered for path '../third_party/nrf_802154/nrf_802154'
Submodule 'third_party/openthread/openthread' (https://github.com/particle-iot/openthread.git) registered for path '../third_party/openthread/openthread'
Submodule 'third_party/wiznet_driver/wiznet_driver' (https://github.com/particle-iot/ioLibrary_Driver.git) registered for path '../third_party/wiznet_driver/wiznet_driver'
Cloning into '/home/nottheoilrig/firmware/gsm0710muxer/gsm0710muxer'...
Cloning into '/home/nottheoilrig/firmware/proto'...
Cloning into '/home/nottheoilrig/firmware/third_party/freertos/freertos'...
Cloning into '/home/nottheoilrig/firmware/third_party/littlefs/littlefs'...
Cloning into '/home/nottheoilrig/firmware/third_party/lwip/lwip'...
Cloning into '/home/nottheoilrig/firmware/third_party/lwip/lwip-contrib'...
Cloning into '/home/nottheoilrig/firmware/third_party/mbedtls/mbedtls'...
Cloning into '/home/nottheoilrig/firmware/third_party/miniz/miniz'...
Cloning into '/home/nottheoilrig/firmware/third_party/nanopb/nanopb'...
Cloning into '/home/nottheoilrig/firmware/third_party/nrf5_sdk/nrf5_sdk'...
Cloning into '/home/nottheoilrig/firmware/third_party/nrf_802154/nrf_802154'...
Cloning into '/home/nottheoilrig/firmware/third_party/openthread/openthread'...
Cloning into '/home/nottheoilrig/firmware/third_party/wiznet_driver/wiznet_driver'...
Submodule path '../gsm0710muxer/gsm0710muxer': checked out '3cdbf88bc1c1a6c75c484bda36936b94d9146dbd'
Submodule path '../proto': checked out '005aea3bb6eae6067c1a9bb7cac2c73ba8830a2c'
Submodule path '../third_party/freertos/freertos': checked out '3feb84fee1840c0a8a3ea50810fb5f3e7527c6ce'
Submodule path '../third_party/littlefs/littlefs': checked out '9996634a148c68f6135318cce0f69b9debf73469'
Submodule path '../third_party/lwip/lwip': checked out 'd4faff78f96cf4f7f2b46f790a711d4ad3f7003f'
Submodule path '../third_party/lwip/lwip-contrib': checked out 'cce6cd11ffc1e0bddcb5a9c96674d1a7ae73e36f'
Submodule path '../third_party/mbedtls/mbedtls': checked out '48fe5b1030039557c6a6340d22bb473fc8042920'
Submodule path '../third_party/miniz/miniz': checked out 'f07041c88cdbb5a85401a0f49366cac2143871d8'
Submodule path '../third_party/nanopb/nanopb': checked out '2d40a90db76036458cf1150cdf5979e5e5fc77c6'
Submodule path '../third_party/nrf5_sdk/nrf5_sdk': checked out '8433b5f2ea1bce4135f3b96ef7f24507b41a1017'
Submodule path '../third_party/nrf_802154/nrf_802154': checked out '4fbe9d9d29291921295c1df56b6ffb6f44d53af7'
Submodule path '../third_party/openthread/openthread': checked out 'bc2c9e68cf9b669dffb46c645a39e2dc089de67c'
Submodule path '../third_party/wiznet_driver/wiznet_driver': checked out '53401b1d55b63641f60577e40e6996da59d71fd5'
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ make GCC_PREFIX=~/gcc-arm-none-eabi-5_3-2016q1/bin/arm-none-eabi- PLATFORM=xenon

I am seeing the same error, but my toolchain is the version reported as working above:

/usr/local/Cellar/gcc-arm-none-eabi-53/20160330/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld: Dynalib location not correct
/usr/local/Cellar/gcc-arm-none-eabi-53/20160330/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld: Dynalib location not same as exported location
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.3.1 20160307 (release) [ARM/embedded-5-branch revision 234589]

Digging into this some more, this seems to happen as I start to add code to my project. A smaller project has an LMA of 0x000d4018, whereas a larger project has an LMA of 0x000d4020, which causes user.ld to balk at the output.

Anyone know why this is happening and what to do about it? Here is a diff of the two .lst files:

Sections:
 Idx Name          Size      VMA       LMA       File off  Algn
   0 .module_info  00000018  000d4000  000d4000  00004000  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  1 .text         000194f0  000d4020  000d4020  00004020  2**4
+  1 .text         00006928  000d4018  000d4018  00004018  2**3