avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #32086] libm library not linked


From: Christian Mikula
Subject: [avr-libc-dev] [bug #32086] libm library not linked
Date: Mon, 10 Jan 2011 10:23:13 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10

URL:
  <http://savannah.nongnu.org/bugs/?32086>

                 Summary: libm library not linked
                 Project: AVR C Runtime Library
            Submitted by: cmikula
            Submitted on: Mo 10 Jan 2011 10:23:12 GMT
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Build system
                  Status: None
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.6.7
           Fixed Release: None

    _______________________________________________________

Details:

Hi,

the libm library will be not linked if the -lm command is added once! it must
be added twice to get correct result!

main code:


#include "avr/io.h"
#include "math.h"

#define R1 10000
#define R0 10000
#define T0 298.15
#define B 3380
#define ZeroTemp 273.15

float get_temp(float Rth) {
        float T = B / (log(Rth / (R0 * exp(-B / T0))));
        return T - ZeroTemp;
}


int main(void) {
        double x = 1234;
        while (1) {
                x = get_temp(x);
        }
        return 0;
}


Invoking: AVR Compiler
avr-gcc -Wall -Os -fpack-struct -fshort-enums -std=gnu99 -funsigned-char
-funsigned-bitfields -mmcu=attiny861 -DF_CPU=8000000UL -MMD -MP -MF"main.d"
-MT"main.d" -c -o"main.o" "../main.c"

Invoking: AVR C++ Linker will not work correctly
avr-g++ -Wl,-Map,gpptest.map,--cref -mmcu=attiny861 -o"gpptest.elf"  ./main.o
  -lm
 
Invoking: AVR C++ Linker work correctly
avr-g++ -Wl,-Map,gpptest.map,--cref -mmcu=attiny861 -o"gpptest.elf"  ./main.o
  -lm -lm


See the problem to invoke the print size kommand!
avr-size --format=avr --mcu=attiny861 gpptest.elf

Best regards

Chris




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mo 10 Jan 2011 10:23:12 GMT  Name: main.c  Size: 429B   By: cmikula

<http://savannah.nongnu.org/bugs/download.php?file_id=22381>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?32086>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]