This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

--sysroot option

I have just realized that the TI toolchain does not have such a feature, at least not exposed anyway.

It would be a useful feature because currently, TI does not ship an own environment script to set up a sysroot variable for the target environment [1]. It is now up to the third-party projects to define a variable for this purpose, but it would be a lot better solution to handle this centrally either by a --sysroot option, or an environment setup script as aforementioned.

Please open up a bugreport for this as mentioned in the relevant thread [2]. I would like to get a number where I can follow the cycle of this request. Thank you in advance.

[1] http://e2e.ti.com/support/development_tools/compiler/f/343/t/252470.aspx

[2] http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/140452.aspx

  • I don't know exactly how --sysroot works.  The gnu.org web site seems to be down, so I was never able to look it up.  At any rate, I'm pretty sure the TI compiler has no equivalent.

    The TI compiler does interact with some environment variables.  These are all discussed in the section titled Controlling the Compiler Through Environment Variables in the C6000 compiler manual.

    As already noted in forum thread [1], I filed SDSCM00046761 in the SDOWP system to request that compiler installation create a script that makes it easy to invoke the compiler from the command line.  Feel free to track that request with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • George Mock said:

    I don't know exactly how --sysroot works.  The gnu.org web site seems to be down, so I was never able to look it up.  At any rate, I'm pretty sure the TI compiler has no equivalent.

    Quoting from a cached copy:

    --sysroot=dir

    Use dir as the logical root directory for headers and libraries. For example, if the compiler normally searches for headers in /usr/include and libraries in /usr/lib, it instead searches dir/usr/include and dir/usr/lib.

    If you use both this option and the -isysroot option, then the --sysroot option applies to libraries, but the -isysroot option applies to header files.

    The GNU linker (beginning with version 2.16) has the necessary support for this option. If your linker does not support this option, the header file aspect of --sysroot still works, but the library aspect does not.

    Essentially, the option provides functionality similar to a chroot environment, without requiring OS support. It helps to support cross building autotoolish packages that assume a certain directory layout (are there many codebases for TI platforms that have this problem?)

  • As already noted in forum thread [1], I filed SDSCM00046761 in the SDOWP system to request that compiler installation create a script that makes it easy to invoke the compiler from the command line.  Feel free to track that request with the SDOWP link below in my signature.

    Actually, these are not exclusive cases. In fact, it is simpler to pass --sysroot to a third party project without getting into the contribution to support the environment scripts. Several third-party projects support that off-hand, like Qt. I think both have its use case in different scenarios. Both are convenience. I would use --sysroot when a third-party project supports that, otherwise I would either contribute to that project to support --sysroot, or/and the environment variables.

    By the way, it is not too complicated, essentially the sysroot is considered for the include and library paths. You do not need to set those up manually, so I would personally suggest to have both features in. Blackberry also managed both: qcc (thin gcc wrapper) and the environment script.

    Also, it is not just gcc having this, but also the Intel Compiler Collection, Clang from Apple and so forth.

  • I'm afraid I don't quite follow.  Please see the section titled The Search Path for #include Files in the C6000 compiler manual.  What can you do with --sysroot that you cannot do with --include_path?

    Thanks and regards,

    -George

  • As written before, --sysroot is not only for the include path.

    Besides, even if it was, you would need to pass that for each include path inside the target environment which can go haywire if you start installing more and more libraries into the target environment.

  • Laszlo Papp said:

    As written before, --sysroot is not only for the include path.

    Yes, but you can get very close using the --include_path, --search_path, and --library options in conjunction.

    Besides, even if it was, you would need to pass that for each include path inside the target environment which can go haywire if you start installing more and more libraries into the target environment.

    Are you saying you would prefer to put everything that's used by your superproject in a single sysroot?

  • Yes, but you can get very close using the --include_path, --search_path, and --library options in conjunction.

    The whole point of the report is to avoid that inconvenience.