View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013601CMakeCMakepublic2012-10-23 18:192013-03-04 08:38
Reporterdmytro_ovdiienko 
Assigned ToBrad King 
PrioritynormalSeverityblockReproducibilityalways
StatusclosedResolutionfixed 
Platformx32OSWindowsOS Version7
Product VersionCMake 2.8.9 
Target VersionCMake 2.8.11Fixed in Version 
Summary0013601: LinkDelaySign /KEYFILE and /DELAYSIGN parameters do not work
DescriptionCMake generates incorrect keys for /KEYFILE and /DELAYSIGN parameters for VS2010
Steps To Reproduce0. Create dummy C++ project

Add following statement to teh project file

ADD_DEFINITIONS ("/clr /FUSystem.dll /FUSystem.Core.dll")

set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYSIGN /KEYFILE:\"path-to-key-file.snk\"")

Expected:
  LinkDelaySign and LinkKeyFile parameters are generated.

In fact:
  DelaySign and KeyFile are generated.
TagsNo tags attached.
Attached Fileszip file icon b2b_V12_net.vcxproj.zip [^] (4,602 bytes) 2012-10-25 06:14
png file icon Linker_Advanced.png [^] (26,869 bytes) 2012-10-25 06:25


zip file icon test_sign.vcxproj.zip [^] (4,940 bytes) 2012-10-25 10:26
? file icon patch [^] (1,260 bytes) 2012-10-25 16:38 [Show Content]

 Relationships

  Notes
(0031299)
dmytro_ovdiienko (reporter)
2012-10-23 18:20

I see bugfix in the following commit:
http://public.kitware.com/pipermail/cmake-commits/2012-August/013276.html [^]
(0031304)
Brad King (manager)
2012-10-24 13:44

This commit:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b2dda5d [^]

is in 2.8.10 and adds the mapping for VS 11 features. The /DELAYSIGN flag was called just DelaySign in VS 10:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVS10LinkFlagTable.h;hb=v2.8.9#l185 [^]
(0031311)
dmytro_ovdiienko (reporter)
2012-10-25 06:14
edited on: 2012-10-25 06:25

I've checked latest build on VS 2010:
http://www.cmake.org/files/dev/cmake-2.8.9.20121024-gd3328-win32-x86.zip [^]

It still generates DelaySign and KeyFile tags. VS 2010 does not support them. I'm attaching project file. Please try to open it and check Linker->Advanced settings. KeyFile and Delay Sign fields should be set.

(0031312)
Brad King (manager)
2012-10-25 07:48

Try changing the relevant entries in "Source/cmVS10LinkFlagTable.h" and report back with the correct lines for that. Use the VS 11 table from 2.8.10 as a reference.

The existing VS 10 table entries were computed automatically from parsing MSBuild rule files. I wonder if VS 10 sp1 changed these names.
(0031314)
dmytro_ovdiienko (reporter)
2012-10-25 08:47

I will try.

BTW, VS2010SP1 duplicates parameters.

1. It stores these parameters to the following structure:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> [^]

...

<PropertyGroup>
...
    <LinkKeyFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\key\FIXAntenna.Net.snk</LinkKeyFile>
    <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkDelaySign>

2. Additionally it stores values to:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> [^]
...
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
...
    <Link>
...
      <KeyFile>..\key\FIXAntenna.Net.snk</KeyFile>
      <DelaySign>true</DelaySign>


o_O
(0031316)
dmytro_ovdiienko (reporter)
2012-10-25 08:52

Looks like second option is not used by MSBuild. And it was obtained after migration from VS2008 to VS2010.

3rd option:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> [^]

..
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <LinkKeyFile>D:\src\epm-bfix\fix_trunk\dot_net\key\FIXAntenna.Net.snk </LinkKeyFile>
    <LinkDelaySign>true</LinkDelaySign>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <LinkKeyFile>D:\src\epm-bfix\fix_trunk\dot_net\key\FIXAntenna.Net.snk </LinkKeyFile>
    <LinkDelaySign>true</LinkDelaySign>
  </PropertyGroup>
(0031318)
Brad King (manager)
2012-10-25 08:56
edited on: 2012-10-25 08:56

Please try this patch (untested):

diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h
index c60e8eb..64febbb 100644
--- a/Source/cmVS10LinkFlagTable.h
+++ b/Source/cmVS10LinkFlagTable.h
@@ -182,8 +182,8 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] =
   {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 
0},
   {"SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 
0},
   {"Profile", "PROFILE", "", "true", 0},
-  {"DelaySign", "DELAYSIGN:NO", "", "false", 0},
-  {"DelaySign", "DELAYSIGN", "", "true", 0},
+  {"LinkDelaySign", "DELAYSIGN:NO", "", "false", 0},
+  {"LinkDelaySign", "DELAYSIGN", "", "true", 0},
   {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 
0},
   {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 
0},
   {"ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 
0},
@@ -294,7 +294,7 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] =
   {"MergeSections", "MERGE:",
    "Merge Sections",
    "", cmVS7FlagTable::UserValue},
-  {"KeyFile", "KEYFILE:",
+  {"LinkKeyFile", "KEYFILE:",
    "Key File",
    "", cmVS7FlagTable::UserValue},
   {"KeyContainer", "KEYCONTAINER:",


(0031319)
dmytro_ovdiienko (reporter)
2012-10-25 10:27

Does not work. You should put these tags to the PropertyGroup tag. Please find correct project attached.
(0031320)
Brad King (manager)
2012-10-25 10:45

In that case this will need special handling in the C++ code which I don't have time to do. Look at

 cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions

for generation of PropertyGroup elements.
(0031321)
dmytro_ovdiienko (reporter)
2012-10-25 10:52

OK. Thanks.
Is there workaround?
(0031322)
dmytro_ovdiienko (reporter)
2012-10-25 10:53

Could you please remove support of the keyfile and delaysign so it will be inserted as is?
(0031323)
Brad King (manager)
2012-10-25 11:50

Re 0013601:0031322: If you can construct a patch that does the minimum for what you need then post it here.
(0031333)
dmytro_ovdiienko (reporter)
2012-10-25 16:38

Please find attached.
(0031334)
Brad King (manager)
2012-10-25 16:41

Thanks. Will a similar change be needed to "Source/cmVS11LinkFlagTable.h" to handle this for VS 11?
(0031336)
dmytro_ovdiienko (reporter)
2012-10-25 17:11

dunno
(0031342)
Brad King (manager)
2012-10-26 12:51

It looks like the LinkIncremental and GenerateManifest options also need to be in the PropertyGroup instead of Link, and there was already hackish code to implement that. I've refactored it to avoid duplicate code:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c65a2ea6 [^]

The result allows this issue to be addressed easily in the same way:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=035e7bd0 [^]
(0032492)
Robert Maynard (manager)
2013-03-04 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-10-23 18:19 dmytro_ovdiienko New Issue
2012-10-23 18:20 dmytro_ovdiienko Note Added: 0031299
2012-10-24 13:44 Brad King Note Added: 0031304
2012-10-24 13:44 Brad King Assigned To => Brad King
2012-10-24 13:44 Brad King Status new => assigned
2012-10-24 13:44 Brad King Resolution open => fixed
2012-10-24 13:44 Brad King Fixed in Version => CMake 2.8.10
2012-10-24 13:44 Brad King Target Version => CMake 2.8.10
2012-10-24 13:44 Brad King Status assigned => resolved
2012-10-25 06:14 dmytro_ovdiienko Note Added: 0031311
2012-10-25 06:14 dmytro_ovdiienko Status resolved => feedback
2012-10-25 06:14 dmytro_ovdiienko Resolution fixed => reopened
2012-10-25 06:14 dmytro_ovdiienko File Added: b2b_V12_net.vcxproj.zip
2012-10-25 06:25 dmytro_ovdiienko Note Edited: 0031311
2012-10-25 06:25 dmytro_ovdiienko File Added: Linker_Advanced.png
2012-10-25 07:48 Brad King Note Added: 0031312
2012-10-25 07:48 Brad King Status feedback => assigned
2012-10-25 07:48 Brad King Resolution reopened => open
2012-10-25 07:48 Brad King Fixed in Version CMake 2.8.10 =>
2012-10-25 07:48 Brad King Target Version CMake 2.8.10 => CMake 2.8.11
2012-10-25 08:47 dmytro_ovdiienko Note Added: 0031314
2012-10-25 08:52 dmytro_ovdiienko Note Added: 0031316
2012-10-25 08:56 Brad King Note Added: 0031318
2012-10-25 08:56 Brad King Note Edited: 0031318
2012-10-25 10:26 dmytro_ovdiienko File Added: test_sign.vcxproj.zip
2012-10-25 10:27 dmytro_ovdiienko Note Added: 0031319
2012-10-25 10:45 Brad King Note Added: 0031320
2012-10-25 10:45 Brad King Assigned To Brad King =>
2012-10-25 10:45 Brad King Status assigned => backlog
2012-10-25 10:45 Brad King Target Version CMake 2.8.11 =>
2012-10-25 10:52 dmytro_ovdiienko Note Added: 0031321
2012-10-25 10:53 dmytro_ovdiienko Note Added: 0031322
2012-10-25 11:50 Brad King Note Added: 0031323
2012-10-25 16:38 dmytro_ovdiienko File Added: patch
2012-10-25 16:38 dmytro_ovdiienko Note Added: 0031333
2012-10-25 16:41 Brad King Note Added: 0031334
2012-10-25 17:11 dmytro_ovdiienko Note Added: 0031336
2012-10-26 12:51 Brad King Note Added: 0031342
2012-10-26 12:51 Brad King Assigned To => Brad King
2012-10-26 12:51 Brad King Status backlog => resolved
2012-10-26 12:51 Brad King Resolution open => fixed
2012-10-26 12:51 Brad King Target Version => CMake 2.8.11
2013-03-04 08:38 Robert Maynard Note Added: 0032492
2013-03-04 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team