Discussion:
[cmake-developers] CMAKE :: mingw make files with response file for includes
Jayakumar, Lenindarbi
2018-01-17 08:52:54 UTC
Permalink
Hello,

I have encountered a problem with response file usage for includes.
My project is using tasking compiler.

Issue:
Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not customizable for include paths.
Cmake generated the *.rsp file always using @ but this is not accepted by tasking compiler. Tasking compiler expects -f instead of @.

...
C_INCLUDES = @CMakeFiles/dummyTarget/includes_C.rsp

This issue is only with includes response file. For objects, CMAKE_C_RESPONSE_FILE_LINK_FLAG works.

Project setup:
set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f ")
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)

Possible cause:

The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmMakefileTargetGenerator.cxx.

if (useResponseFile) {
std::string name = "includes_";
name += lang;
name += ".rsp";
std::string arg = "@" +
this->CreateResponseFile(name.c_str(), includeFlags,
this->FlagFileDepends[lang]);
this->LocalGenerator->AppendFlags(flags, arg);
}

However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function.

// Lookup the response file reference flag.
std::string responseFlagVar = "CMAKE_";
responseFlagVar +=
this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar);
if (!responseFlag) {
responseFlag = "@";
}

Regards,

Lenindarbi Jayakumar
Software Engineer

Magna Electronics Europe GmbH & Co. OHG
Kurfürst-Eppstein-Ring 9
63877 Sailauf
OFFICE +49 6093 9942 6462
FAX +49 6093 9942 6001
MOBILE
***@magna.com
http://www.magna.com<http://www.magnaelectronics.com/>

Magna Electronics Europe GmbH & Co. OHG
Geschäftsführende Gesellschaft: Magna Electronics Europe Verwaltungs GmbH
Geschäftsführer: Rainer Bruns, Cornelius Wolber
Sitz der geschäftsführenden Gesellschaft: Sailauf, Deutschland
Registergericht: Aschaffenburg / HRB 8778
Sitz der Gesellschaft (OHG): 63877 Sailauf, Deutschland
Registergericht: Aschaffenburg / HRA 4616
Diese Nachricht ist ausschließlich für den oben bezeichneten Adressaten bestimmt und enthält möglicherweise vertrauliche Informationen. Sollten Sie nicht der oben bezeichnete Adressat sein oder diese Nachricht irrtümlich erhalten haben, ersuchen wir Sie, diese Nachricht nicht weiterzugeben, zu kopieren oder im Vertrauen darauf zu handeln, sondern uns unter ***@magna.com zu verständigen und diese Nachricht samt allfälliger Anlagen sofort zu löschen. Vielen Dank.
This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee, you should not disseminate, copy, or take any action in reliance on it. If you have received this message in error, please immediately notify ***@magna.com and delete this message and any attachment. Thank you.
Brad King
2018-01-19 14:01:15 UTC
Permalink
Response file link flag “CMAKE_C_RESPONSE_FILE_LINK_FLAG” is not customizable
for include paths.
In case the compiler and link driver want different response file flags,
one could add a separate "CMAKE_<LANG>_RESPONSE_FILE_COMPILE_FLAG" variable
to use for include flags. See

https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst

for contribution instructions if you'd like to work on it.

Thanks,
-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Jayakumar, Lenindarbi
2018-01-19 14:25:47 UTC
Permalink
Thanks for the reply.

It is not compiler and linker.
I have to use response file for both includes and objects.
Tasking compiler expects -f as Response file link flag for both. But cmake produces command line for objects using -f and includes using @.

I prefer to get it fixed in generator. Unfortunately I don't have enough time and experience.
Perhaps an cmake expert could confirm and fix it.

Possible cause:
The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file ../Source/cmMakefileTargetGenerator.cxx

if (useResponseFile) {
std::string name = "includes_";
name += lang;
name += ".rsp";
std::string arg = "@" +
this->CreateResponseFile(name.c_str(), includeFlags,
this->FlagFileDepends[lang]);
this->LocalGenerator->AppendFlags(flags, arg);
}

However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function.

// Lookup the response file reference flag.
std::string responseFlagVar = "CMAKE_";
responseFlagVar +=
this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar);
if (!responseFlag) {
responseFlag = "@";
}

Thanks,
Lenin

-----Original Message-----
From: Brad King [mailto:***@kitware.com]
Sent: Freitag, 19. Januar 2018 15:01
To: Jayakumar, Lenindarbi <***@magna.com>; cmake-***@cmake.org
Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes
Post by Jayakumar, Lenindarbi
Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not
customizable for include paths.
In case the compiler and link driver want different response file flags, one could add a separate "CMAKE_<LANG>_RESPONSE_FILE_COMPILE_FLAG" variable to use for include flags. See

https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst

for contribution instructions if you'd like to work on it.

Thanks,
-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Brad King
2018-01-22 12:54:07 UTC
Permalink
Post by Jayakumar, Lenindarbi
I have to use response file for both includes and objects.
Tasking compiler expects -f as Response file link flag for both.
I prefer to get it fixed in generator.
Yes, that use of `@` should be made configurable.

I'll take a look when I get a chance.

Thanks,
-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Jayakumar, Lenindarbi
2018-01-22 13:43:53 UTC
Permalink
Sounds good. Thank you Brad.

Grüße
Lenin

-----Original Message-----
From: Brad King [mailto:***@kitware.com]
Sent: Montag, 22. Januar 2018 13:54
To: Jayakumar, Lenindarbi <***@magna.com>; cmake-***@cmake.org
Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes
Post by Jayakumar, Lenindarbi
I have to use response file for both includes and objects.
Tasking compiler expects -f as Response file link flag for both.
I prefer to get it fixed in generator.
Yes, that use of `@` should be made configurable.

I'll take a look when I get a chance.

Thanks,
-Brad
--
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:
https://cmake.org/mailman/listinf
Brad King
2018-01-24 15:45:50 UTC
Permalink
Post by Brad King
I'll take a look when I get a chance.
The IBM XL compiler needs this too to use `-qoptfile=`.
See fix here:

https://gitlab.kitware.com/cmake/cmake/merge_requests/1691

-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Jayakumar, Lenindarbi
2018-04-11 16:25:26 UTC
Permalink
Hi Brad,
Is the below issue solved in latest release 3.11.0 ?
Could you please confirm?



Grüße
Lenin

-----Original Message-----
From: Jayakumar, Lenindarbi
Sent: Freitag, 19. Januar 2018 15:26
To: 'Brad King' <***@kitware.com>; cmake-***@cmake.org
Subject: RE: [cmake-developers] CMAKE :: mingw make files with response file for includes

Thanks for the reply.

It is not compiler and linker.
I have to use response file for both includes and objects.
Tasking compiler expects -f as Response file link flag for both. But cmake produces command line for objects using -f and includes using @.

I prefer to get it fixed in generator. Unfortunately I don't have enough time and experience.
Perhaps an cmake expert could confirm and fix it.

Possible cause:
The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file ../Source/cmMakefileTargetGenerator.cxx

if (useResponseFile) {
std::string name = "includes_";
name += lang;
name += ".rsp";
std::string arg = "@" +
this->CreateResponseFile(name.c_str(), includeFlags,
this->FlagFileDepends[lang]);
this->LocalGenerator->AppendFlags(flags, arg);
}

However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function.

// Lookup the response file reference flag.
std::string responseFlagVar = "CMAKE_";
responseFlagVar +=
this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar);
if (!responseFlag) {
responseFlag = "@";
}

Thanks,
Lenin

-----Original Message-----
From: Brad King [mailto:***@kitware.com]
Sent: Freitag, 19. Januar 2018 15:01
To: Jayakumar, Lenindarbi <***@magna.com<mailto:***@magna.com>>; cmake-***@cmake.org<mailto:cmake-***@cmake.org>
Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes
Post by Jayakumar, Lenindarbi
Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not
customizable for include paths.
In case the compiler and link driver want different response file flags, one could add a separate "CMAKE_<LANG>_RESPONSE_FILE_COMPILE_FLAG" variable to use for include flags. See

https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst

for contribution instructions if you'd like to work on it.

Thanks,
-Brad
Brad King
2018-04-11 17:02:15 UTC
Permalink
Post by Jayakumar, Lenindarbi
Is the below issue solved in latest release 3.11.0 ?
Could you please confirm?
The fix discussed elsewhere in the thread:

https://gitlab.kitware.com/cmake/cmake/merge_requests/1691

is in 3.11.0. The `@` is no longer hard coded. I think it
should work now.

-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Jayakumar, Lenindarbi
2018-04-12 08:35:17 UTC
Permalink
Perfect.
It works.

Grüße
Lenin


-----Original Message-----
From: Brad King [mailto:***@kitware.com]
Sent: Mittwoch, 11. April 2018 19:02
To: Jayakumar, Lenindarbi <***@magna.com>; cmake-***@cmake.org
Cc: '***@gmail.com' <***@gmail.com>
Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes
Post by Jayakumar, Lenindarbi
Is the below issue solved in latest release 3.11.0 ?
Could you please confirm?
The fix discussed elsewhere in the thread:

https://gitlab.kitware.com/cmake/cmake/merge_requests/1691

is in 3.11.0. The `@` is no longer hard coded. I think it should work now.

-Brad
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Loading...