[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] To document "-l" option clearer
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] To document "-l" option clearer |
Date: |
Sun, 29 Jun 2014 16:44:29 +0800 |
User-agent: |
KMail/4.12.4 (Linux/3.14-1-amd64; KDE/4.13.1; x86_64; ; ) |
Le dimanche 29 juin 2014, 04:56:59 YX Hao a écrit :
> Hi,
>
> "Usage: tcc [options...] [-o outfile] [-c] infile(s)..."
>
> Is "-l" option must follow the infile(s)? Yes! I tried different positions.
> Before, "undefined symbol" error; behind, ok. Because of I had forgotten
> it. Usually, a library is appended by reviewing.
>
> I searched and found the reason out. A linker only adds the undefined
> symbols that the (previous) existing program codes need.
Indeed, it works this way in all compilers. The advantage is that a library is
not pulled in if none of its symbol is used.
>
> It is a trick that experienced one knows (usage format from gcc). If the
> usage is organized in a clearer way, it may be better. How to do it simple
> and clear?
I don't think usage can renders this appropriately. After all it can be put
anywhere, it's just that its position matters. The manual should mention it
though, as is done in GCC:
"It makes a difference where in the command you write this option; the linker
searches and processes libraries and object files in the order they are
specified. Thus, foo.o -lz bar.o searches library z after file foo.o but
before
bar.o. If bar.o refers to functions in z, those functions may not be loaded."
Best regards,
Thomas
signature.asc
Description: This is a digitally signed message part.