<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF58122 GCC S120 Softdevice Build failure - Collect2.exe</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1912/nrf58122-gcc-s120-softdevice-build-failure---collect2-exe</link><description>I am experiencing an error in the final linking stage of my build. 
 
 _build/blinky_gcc_xxaa_s120_xxaa.bin: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
make: *** [debug] Error 1
(See attached buildlog</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 13 Apr 2014 03:13:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1912/nrf58122-gcc-s120-softdevice-build-failure---collect2-exe" /><item><title>RE: nRF58122 GCC S120 Softdevice Build failure - Collect2.exe</title><link>https://devzone.nordicsemi.com/thread/8221?ContentTypeID=1</link><pubDate>Sun, 13 Apr 2014 03:13:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b66fc92-73ca-4b6f-8ae6-c56322562077</guid><dc:creator>mtsunstrum</dc:creator><description>&lt;p&gt;I haven&amp;#39;t solved this issue, but some extra observations:&lt;/p&gt;
&lt;p&gt;The problem is the last nonsensical gcc operation ...&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;C:/Program Files/GNU Tools ARM Embedded/4.8 2013q4/bin/arm-none-eabi-gcc&amp;quot; -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_PCA10001 -DNRF51822_QFAA_CA --std=gnu99 -Wall -Werror -Wno-unused-local-typedefs -mfloat-abi=soft -DDEBUG -g3 -O0  -L&amp;quot;C:/Program Files/GNU Tools ARM Embedded/4.8 2013q4/arm-none-eabi/lib/armv6-m&amp;quot; -L&amp;quot;C:/Program Files/GNU Tools ARM Embedded/4.8 2013q4/lib/gcc/arm-none-eabi/4.8.3/armv6-m&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/app_common&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/sd_common&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/ble&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/ble/ble_services&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/s120&amp;quot; -I&amp;quot;../&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/gcc&amp;quot; -I&amp;quot;C:/NordicSemi_nRF51SDK/nrf51822/Include/ext_sensors&amp;quot; -Xlinker -Map=_build/blinky_gcc_xxaa_s120_xxaa.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L C:/NordicSemi_nRF51SDK/nrf51822//Source//templates/gcc/ -Tgcc_nrf51_s120_xxaa.ld   ../debug.c _build/blinky_gcc_xxaa_s120_xxaa.bin _build/blinky_gcc_xxaa_s120_xxaa.hex   -o debug&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I noticed if I do &amp;quot;make release&amp;quot;, then my build is fine.
If I do &amp;quot;make debug&amp;quot;, then I get this last rogue gcc operation.&lt;/p&gt;
&lt;p&gt;Notably, if I continue to run my application with the .out file, it runs fine.&lt;/p&gt;
&lt;p&gt;It appears to be a makefile build rule causing this last gcc operation.&lt;/p&gt;
&lt;p&gt;After playing with it for a while, I was not able to solve it. Maybe someone else will stumble upon this, and see the same issue. I have included the various app Makefile, and gcc Makefile/Makefile.windows for analysis.&lt;/p&gt;
&lt;p&gt;To work around the issue, I moved over to using the pure-gcc Makefile operations, and everything works very fine now. Builds cleaner, faster and easier to understand.&lt;/p&gt;
&lt;p&gt;Thx.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8357.Makefile.txt"&gt;Makefile.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Makefile.common.txt"&gt;Makefile.common.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Makefile.windows.txt"&gt;Makefile.windows.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>