[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem linking *without* avr-libc, libm, etc.
From: |
David Brown |
Subject: |
Re: Problem linking *without* avr-libc, libm, etc. |
Date: |
Fri, 30 Apr 2021 10:03:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 29/04/2021 21:43, Ian Molton wrote:
> Hi,
>
> I'm attempting to build my project, which does not use libc, or libm,
> but I do want to link with libgcc.
>
> additionally, I don't want any startup code to be linked - the project
> is intended to be fully standalone.
>
If you don't use any functions from these libraries, nothing from them
will be linked into your project - it doesn't matter if the linker has them.
(I can't remember the details for the avr, but often "libm" is actually
empty, and exists only for compatibility - all the maths functions are
frequently included in the main libc.)
Sometimes (again, this is from other targets rather than the avr, which
I have not used for many years) it is useful to provide stubs of
functions like "exit()" and "atexit()" - just add these as extra empty
functions in your code. That will ensure the library versions are not
used, and they do not pull in any other bits and pieces.