user15891: 
I'm compiling a simple sketch that reads values from an analog input
and activates a buzzer on a digital input.
working on an Arduino uno.
the sketch compiles and runs fine on windows and arch linux using the Arduino
IDE.

I recently tried to start working with Arduino-mk, I tried to compile the said sketch and got the following compiler error (analogVal is the variable holding the analogRead):
/usr/bin/avr-gcc -mmcu=atmega328p -Wl,--gc-sections -Os -o /home/niv/Gits/bin/uno/maglove/maglove.elf 
~/Gits/bin/uno/maglove/maglove.ino.o ~/Gits/bin/uno/maglove/libcore.a  -lc -lm 
/home/niv/Gits/bin/uno/maglove/maglove.ino.o: In function `_GLOBAL__sub_I_nothing':
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0xc): undefined reference to `__dso_handle'
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0xe): undefined reference to `__dso_handle'
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0x18): undefined reference to `__cxa_atexit'
/usr/bin/avr-ld: /home/niv/Gits/bin/uno/maglove/maglove.elf: hidden symbol `__dso_handle' isn't defined
/usr/bin/avr-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
/home/niv/Gits/Arduino-Makefile/Arduino.mk:1416: recipe for target '/home/niv/Gits/bin/uno/maglove/maglove.elf' failed
make: *** [/home/niv/Gits/bin/uno/maglove/maglove.elf] Error 1
make: Target 'all' not remade because of errors.

I am not very experienced with Arduino yet, and google has failed me in finding this error or any keyword from it in the context of Arduino uno.
thanks.

user10907: I can't say I fully understand what is going on, but it seems that if you add:
void * __dso_handle;

You may be able to eliminate one of the problems. You might try the same trick with __cxa_atexit as well.
I found the idea by searching on:

arduino __dso_handle

This is the webpage that I found that suggested the void * hack.

15891: <ol>
<li>I'm compiling a simple sketch that reads values from an analog input
and activates a buzzer on a digital input.</li>
<li>working on an Arduino uno.</li>
<li>the sketch compiles and runs fine on windows and arch linux using the Arduino
IDE.</li>
</ol>

<p>I recently tried to start working with Arduino-mk, I tried to compile the said sketch and got the following compiler error (analogVal is the variable holding the analogRead):</p>

<p>/usr/bin/avr-gcc -mmcu=atmega328p -Wl,--gc-sections -Os -o /home/niv/Gits/bin/uno/maglove/maglove.elf </p>

<pre><code>~/Gits/bin/uno/maglove/maglove.ino.o ~/Gits/bin/uno/maglove/libcore.a  -lc -lm 
/home/niv/Gits/bin/uno/maglove/maglove.ino.o: In function `_GLOBAL__sub_I_nothing':
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0xc): undefined reference to `__dso_handle'
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0xe): undefined reference to `__dso_handle'
maglove.ino:(.text.startup._GLOBAL__sub_I_nothing+0x18): undefined reference to `__cxa_atexit'
/usr/bin/avr-ld: /home/niv/Gits/bin/uno/maglove/maglove.elf: hidden symbol `__dso_handle' isn't defined
/usr/bin/avr-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
/home/niv/Gits/Arduino-Makefile/Arduino.mk:1416: recipe for target '/home/niv/Gits/bin/uno/maglove/maglove.elf' failed
make: *** [/home/niv/Gits/bin/uno/maglove/maglove.elf] Error 1
make: Target 'all' not remade because of errors.
</code></pre>

<p>I am not very experienced with Arduino yet, and google has failed me in finding this error or any keyword from it in the context of Arduino uno.</p>

<p>thanks.</p>
 10907: <p>I can't say I fully understand what is going on, but it seems that if you add:</p>

<pre><code>void * __dso_handle;
</code></pre>

<p>You may be able to eliminate one of the problems. You might try the same trick with <code>__cxa_atexit</code> as well.</p>

<p>I found the idea by searching on:</p>

<blockquote>
  <p>arduino __dso_handle</p>
</blockquote>

<p><a href="http://www.esp8266.com/viewtopic.php?f=29&amp;t=2196&amp;p=13039&amp;hilit=dso_handle#p13039" rel="nofollow">This</a> is the webpage that I found that suggested the <code>void *</code> hack.</p>
