View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011826CMakeCPackpublic2011-02-09 04:172011-02-17 12:52
ReporterNikita Krupenko 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
Platformx86OSLinuxOS VersionMandriva 2010.2
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0011826: CPack don't use correct strip utility when cross-compiling
DescriptionI use MontaVista Linux 4.0.1 toolchain, the platform is "armv5tl-montavista-linuxeabi". The toolcahin utilities available in PATH. I configured my sources with option "-DCMAKE_C_COMPILER=arm_v5t_le-gcc" and build works normally. But when I try to use CPack, it uses "/usr/bin/strip" instead of "arm_v5t_le-strip" and fails to strip binaries.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0025358)
Alex Neundorf (developer)
2011-02-09 15:39

It works here for me, when I use the ppc toolchain from eldk it correctly picks up the ppc strip.

The toolchain prefix is determined in CMakeDetermineCCompiler.cmake. It is only checked in crosscompiling mode.
Are you crosscompiling or do you only specify -DCMAKE_C_COMPILER=your_gcc and that's all ?

For a proper cross compile you should follow the cross compiling howto in the cmake wiki.

Very short version: if CMAKE_SYSTEM_NAME is preset (in your case to Linux), cmake considers the build as a cross compile, and will then check for the toolchain prefix.
If cmake determines CMAKE_SYSTEM_NAME itself, it is not cross compiling, and will not find the strip you want. It will also try to execute binaries in try_run(), search in the default system directories, etc.
(0025366)
Nikita Krupenko (reporter)
2011-02-10 05:31

I specified CMAKE_SYSTEM_NAME and now all works fine. So this is not error in CMake, this was my fault.

Also, I have one question. Can this parameters be identified from compiler? If so, T think, it will be convenient and less error-prone to specify only compiler.
(0025374)
Alex Neundorf (developer)
2011-02-10 12:04

You mean identified the target operating system from the compiler ?

I don't think so.
At least not from the name.
Also, the same compiler can be used for multiple operating systems, e.g. I was using some gcc for eCos, which was not specifically built to build for eCos.

Alex
(0025388)
Nikita Krupenko (reporter)
2011-02-11 03:43

We can try to get some information from compiler itself, for example output of "gcc -dumpmachine" may be useful.

Also, if one compiler used for multiple systems, can we treat them as one system?
(0025418)
Alex Neundorf (developer)
2011-02-12 12:12

> Also, if one compiler used for multiple systems, can we treat them as one
> system?

No. E.g. Linux and eCos are really different OSs.

Especially for other embedded/RT OSs the compilers are not specific.
(0025460)
Nikita Krupenko (reporter)
2011-02-17 10:09

Ok. So, this is not a bug and should be closed.
(0025461)
Alex Neundorf (developer)
2011-02-17 12:52

With presetting CMAKE_SYSTEM_NAME everything worked as expected.

 Issue History
Date Modified Username Field Change
2011-02-09 04:17 Nikita Krupenko New Issue
2011-02-09 08:11 Brad King Assigned To => Alex Neundorf
2011-02-09 08:11 Brad King Status new => assigned
2011-02-09 15:39 Alex Neundorf Note Added: 0025358
2011-02-10 05:31 Nikita Krupenko Note Added: 0025366
2011-02-10 12:04 Alex Neundorf Note Added: 0025374
2011-02-11 03:43 Nikita Krupenko Note Added: 0025388
2011-02-12 12:12 Alex Neundorf Note Added: 0025418
2011-02-17 10:09 Nikita Krupenko Note Added: 0025460
2011-02-17 12:52 Alex Neundorf Note Added: 0025461
2011-02-17 12:52 Alex Neundorf Status assigned => closed
2011-02-17 12:52 Alex Neundorf Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team