• Artem Shinkarov's avatar
    Improved LIB_NEEDED by excluding c compiler builtin functions. · 31af9f99
    Artem Shinkarov authored
        This fixes a bug of not noticing the necessity to have -lm
        when compiling sacprelude.  The reason for this is that
    
        $ cat a.c
          #include <math.h>
            int main(void) {
            return log2(1.4);
          }
        $ gcc -Wall -Wextra -Werror -std=c99 a.c
        $ echo $?
        $ 0
        $ # success
        $ # whereas if we compile the same file like this:
        $ gcc -Wall -Wextra -Werror -std=c99 -fno-builtin -fno-builtin-function a.c
        $
        $/tmp/ccaHuGXn.o: In function `main':
        $a.c:(.text+0x1c): undefined reference to `log2'
        $collect2: error: ld returned 1 exit status
        $ echo $?
        $ 1
        $ # fail
    
        Therefore we want to include -fno-builtin whenever it is supported
        by the compiler.
    31af9f99