View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015002CMakeCMakepublic2014-07-02 12:382016-06-10 14:31
ReporterOlivier Trichet 
Assigned ToKitware Robot 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.12.1 
Target VersionFixed in Version 
Summary0015002: GetPrerequisites : fix objdump usage under non english locale
DescriptionWhile cross-compile from linux to win32, objdump is used by GetPrerequisites to find dependency dll.
It runs : objdump -p some.exe | grep 'DLL Name:'

Under non English locale, the output of objdump can be translated. Thus the matching on 'DLL Name:' does not work.

The attached patch fix this issue.
Steps To Reproduce1) Create the CMakeLists.txt file with :
   include(GetPrerequisites)
   # Force the function 'get_prerequisites' to use objdump
   # (Avoid to setup a crosscompiling env unix -> win32)
   set(gp_tool "objdump")
   get_prerequisites("cmake-3.0.0-win32-x86.exe" DEPENDENCIES 0 1 "" "")
   message("Some dependencies should have been found: ${DEPENDENCIES}")

2) wget http://www.cmake.org/files/v3.0/cmake-3.0.0-win32-x86.exe [^]
3) Choose a non english locale from "locale -a" to to setup the variable LC_ALL
4) "LC_ALL=fr cmake ." => dependency dll not found without patch
   "LC_ALL=C cmake ." => dependency found

TagsNo tags attached.
Attached Filespatch file icon 0001-GetPrerequisites-ensure-objdump-output-is-not-locale.patch [^] (1,564 bytes) 2014-07-02 12:38 [Show Content]

 Relationships

  Notes
(0036310)
Brad King (manager)
2014-07-02 14:16

Recently in the CMake Git 'master' branch we've added a "cmake -E env" command. That could be used to run:

 ${CMAKE_COMMAND} -E env LC_ALL=C objdump ...
(0036311)
Brad King (manager)
2014-07-02 14:22

Re 0015002:0036310: On second thought, I see the set-new/set-old pair is already used for LD_LIBRARY_PATH and that a bit of other refactoring would be needed to wrap the call in "cmake -E env". I think the proposed patch's approach is good enough for now.

grep the Modules directory for "SAVED_LC_ALL" to see the convention used elsewhere for this. Also I do not think this needs to be conditional on the gp_tool because it won't hurt to set it for all tools.
(0042577)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-07-02 12:38 Olivier Trichet New Issue
2014-07-02 12:38 Olivier Trichet File Added: 0001-GetPrerequisites-ensure-objdump-output-is-not-locale.patch
2014-07-02 14:16 Brad King Note Added: 0036310
2014-07-02 14:22 Brad King Note Added: 0036311
2016-06-10 14:29 Kitware Robot Note Added: 0042577
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team