[Top][All Lists]

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

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

From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] Problem With Configured Search Directories
Date: Sat, 07 Sep 2013 19:36:32 +0200
User-agent: KMail/4.10.5 (Linux/3.10-2-amd64; KDE/4.10.5; x86_64; ; )

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 :)



Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

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