Response files not working with TI compilers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Response files not working with TI compilers

Arturo Crespo
Dear All,

I'm currently using CMake-3.7.1 to build a big project with different TI compilers (cl6x, armcl, cl-arp32)  and since several months ago I started to use linker response files because the linker command line was too long for Windows and the build was failing.

When I tried to do this for the first time I got a linker error with an invalid flag being used, as the TI linker doesn't support response files (-@)

The way CMake invokes the TI linker is as mentioned in the TI documentation by invoking the compiler with an option to run the linker, i.e. cl6x --run_linker [options] filename1, ..., filenameN, in TI-CXX.cmake:
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")

The solution that I found was to change the order of the arguments passed to the linker, because the TI compiler supports response files (-@) and it passes that information to the linker, so by moving <OBJECTS> before --run_linker the problem was solved:
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS>")

The same change is needed in TI-C.cmake

This issue is present since at least since CMake-3.3.2

Regards,
Arturo


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Response files not working with TI compilers

manojkdi

When will these changes be available in the official version of cmake.

I also made similar changes. I am suing 3.8 version of the CMake and the issue is not fixed.

 

Regards

 

Manoj R

 

From: CMake [mailto:[hidden email]] On Behalf Of Arturo Crespo
Sent: Wednesday, January 11, 2017 9:02 PM
To: [hidden email]
Subject: [CMake] Response files not working with TI compilers

 

Dear All,

 

I'm currently using CMake-3.7.1 to build a big project with different TI compilers (cl6x, armcl, cl-arp32)  and since several months ago I started to use linker response files because the linker command line was too long for Windows and the build was failing.

 

When I tried to do this for the first time I got a linker error with an invalid flag being used, as the TI linker doesn't support response files (-@)

 

The way CMake invokes the TI linker is as mentioned in the TI documentation by invoking the compiler with an option to run the linker, i.e. cl6x --run_linker [options] filename1, ..., filenameN, in TI-CXX.cmake:

set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")


The solution that I found was to change the order of the arguments passed to the linker, because the TI compiler supports response files (-@) and it passes that information to the linker, so by moving <OBJECTS> before --run_linker the problem was solved:

set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS>")

 

The same change is needed in TI-C.cmake

 

This issue is present since at least since CMake-3.3.2

 

Regards,

Arturo

 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Response files not working with TI compilers

Nils Gladitz-2

On 02/20/2017 11:12 AM, R, Manoj wrote:

When will these changes be available in the official version of cmake.

I also made similar changes. I am suing 3.8 version of the CMake and the issue is not fixed.


The users mailing list might not be the ideal place to bring up issues like this.

You might want to report the issue here:
    https://gitlab.kitware.com/cmake/cmake/issues

and/or discuss the fix on the developers mailing list:
    https://cmake.org/mailman/listinfo/cmake-developers

Nils

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Response files not working with TI compilers

Tristram, Falk
In reply to this post by manojkdi

Hi,

 

I can confirm issues with the TI-C.cmake, not specifically with your problem,

but for some of the TI tools the command line input is not commutative.

 

Before changing this in CMake I would like to highlight two important points:

 

1. I am not sure if anyone of the CMake core developers actually has a TI-Compiler to test certain things.

So the question would be, how to test and verify these changes.

 

2. CMake is currently supporting several versions of the TI-Compiler and TI platforms.

For example the cg-tools 6 is very different to cg-tools 7.

I didn’t work with cg-tools 8 so far, but according to the release notes it is different to version 7.

 

All the changes should work with the versions 6,7 and 8. And these are only the C6X compilers/linkers.

 

Regards,

Falk

 

From: CMake [mailto:[hidden email]] On Behalf Of R, Manoj
Sent: Montag, 20. Februar 2017 11:13
To: Arturo Crespo; [hidden email]
Subject: Re: [CMake] Response files not working with TI compilers

 

When will these changes be available in the official version of cmake.

I also made similar changes. I am suing 3.8 version of the CMake and the issue is not fixed.

 

Regards

 

Manoj R

 

From: CMake [[hidden email]] On Behalf Of Arturo Crespo
Sent: Wednesday, January 11, 2017 9:02 PM
To: [hidden email]
Subject: [CMake] Response files not working with TI compilers

 

Dear All,

 

I'm currently using CMake-3.7.1 to build a big project with different TI compilers (cl6x, armcl, cl-arp32)  and since several months ago I started to use linker response files because the linker command line was too long for Windows and the build was failing.

 

When I tried to do this for the first time I got a linker error with an invalid flag being used, as the TI linker doesn't support response files (-@)

 

The way CMake invokes the TI linker is as mentioned in the TI documentation by invoking the compiler with an option to run the linker, i.e. cl6x --run_linker [options] filename1, ..., filenameN, in TI-CXX.cmake:

set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")


The solution that I found was to change the order of the arguments passed to the linker, because the TI compiler supports response files (-@) and it passes that information to the linker, so by moving <OBJECTS> before --run_linker the problem was solved:

set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS>")

 

The same change is needed in TI-C.cmake

 

This issue is present since at least since CMake-3.3.2

 

Regards,

Arturo

 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake