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 <[email protected]>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 :)
>
> Cheers,
>
> Thomas
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to