[Top][All Lists]

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

Re: [Tinycc-devel] Problem With Configured Search Directories

From: Cayce Pollard
Subject: Re: [Tinycc-devel] Problem With Configured Search Directories
Date: Thu, 12 Sep 2013 16:39:30 -0500

Just a quick follow up question:
for the --elfinterp option...should that be pointing to the elf interpreter on the build machine?

On Sat, Sep 7, 2013 at 12:36 PM, Thomas Preud'homme <address@hidden> wrote:
Le mardi 3 septembre 2013 16:32:41 Cayce Pollard a écrit :
> I believe I found the problem, but I don't know what the solution is.
> Running tcc -print-search-dirs on my target device lists the wrong
> directories; the search directories added to the executable are from my
> build machine...which don't exist on my target device.
> Further examination reveals that the directories are added from the
> --libpaths and --sysincludepaths options and not from the -Wl options
> referenced in the documentation for my standalone toolchain and specified
> by using the --extraldflags.

That is because tcc does the linking itself. Thus, it only recognize a handful
of options that ld provides. Take a look at the function tcc_set_linker in
libtcc.c to have the complete list. --libpaths and --sysincludepaths set the
paths where tcc will search for libs and include on the host (in GNU
terminology) machine. The search order for the build machine is handled by the
compiler that compiles tcc (gcc most likely).

> What is the right way to add lib and include paths to the binary?  Why is
> the path to the elf interpreter included in the binary?

The right way is with libpath, sysincludepath, crtpath. I've just noted there
is no libgccpath while there should be one as well. The reason it is included
in the binary is that all these paths are a property of the compiler and the
linker (for libpath). Since tcc is both a compiler and a linker, it all makes
sense :)



reply via email to

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