View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009798CMakeCMakepublic2009-10-29 15:492009-12-01 14:26
ReporterShane Dixon 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009798: when setting toolchain.cmake, try_compile fails for gcc-fm where -rdynamic fails but -shared works
DescriptionIn toolchain.cmake:
INCLUDE( CMakeForceCompiler )
SET( CMAKE_SYSTEM_NAME Linux )
CMAKE_FORCE_C_COMPILER( gcc-fm GNU )
CMAKE_FORCE_CXX_COMPILER( g++-fm GNU )
SET( CMAKE_FIND_ROOT_PATH
  "C:/gcc-fm"
  "$ENV{ProgramFiles}/Eracom/ProtectProcessing Orange SDK"
  "$ENV{ProgramFiles}/Eracom/ProtectToolkit C SDK" )
SET( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

Setting CMAKE_C_COMPILER doesn't work. I get an error saying
#doesn't work, get error about -rdynamic not working
SET( CMAKE_C_COMPILER gcc-fm )
SET( CMAKE_CXX_COMPILER g++-fm )

# works
CMAKE_FORCE_C_COMPILER( gcc-fm GNU )
CMAKE_FORCE_CXX_COMPILER( g++-fm GNU )

A small test program shows that "gcc-fm -rdynamic main.c" doesn't work, but "gcc-fm -shared main.c" does work.
Additional InformationSee notes in this closed bug for more details:
http://public.kitware.com/Bug/view.php?id=9796 [^]

Pastebin of error message:
http://pastebin.com/m185e1316 [^]

I was advised by Alex to put in a bug report for this issue.
TagsNo tags attached.
Attached Files? file icon Linux.cmake [^] (3,279 bytes) 2009-11-22 12:44

 Relationships
related to 0009985closedBrad King Linux.cmake should not hard-code -rdynamic 

  Notes
(0018530)
Alex Neundorf (developer)
2009-11-22 12:32

The problem here is the cross compiling.
The build host is Windows, the target system is Linux.
So basically it loads Platforms/Linux.cmake which specifies for gcc to use -rdynamic. But the compiler here is gcc on Windows, and this one needs -shared instead of -rdynamic.

Alex
(0018531)
Alex Neundorf (developer)
2009-11-22 12:33

This is from the pastebin, before it goes away:
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/gcc-fm/bin/gcc-fm.exe" is not able to compile a simple
  test program.

  It fails with the following output:

   Change Dir: C:/temp/atmelfm_gcc/CMakeFiles/CMakeTmp



  Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"

        "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f
  CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
  CMakeFiles\cmTryCompileExec.dir\build

        "C:\Program Files\CMake 2.8\bin\cmake.exe" -E cmake_progress_report
  C:\temp\atmelfm_gcc\CMakeFiles\CMakeTmp\CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

        C:\gcc-fm\bin\gcc-fm.exe -o
  CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.o -c
  C:\temp\atmelfm_gcc\CMakeFiles\CMakeTmp\testCCompiler.c

  Linking C executable cmTryCompileExec

        C:\gcc-fm\bin\gcc-fm.exe
  "CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.o" -o cmTryCompileExec
  -rdynamic

  gcc-fm.exe: unrecognized option `-rdynamic'

  /gcc/arm-elf/bin/ld: warning: cannot find entry symbol _start; defaulting
  to 41200000

  /gcc/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o): In function
  `__do_global_ctors':

  __main.o(.text+0xbc): undefined reference to `atexit'

  collect2: ld returned 1 exit status

  NMAKE : fatal error U1077: 'C:\gcc-fm\bin\gcc-fm.exe' : return code '0x1'

  Stop.

  NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
  9.0\VC\BIN\nmake.exe"' : return code '0x2'
(0018532)
Alex Neundorf (developer)
2009-11-22 12:45

Please replace the file Modules/Platform/Linux.cmake in your cmake installation with the attached one (the file is for cmake 2.8.0, maybe it also works with 2.6.4, not sure).

Does the problem then go away ?

Alex
(0018626)
Brad King (manager)
2009-12-01 14:26

The fix to issue 0009985 should address this issue too.

 Issue History
Date Modified Username Field Change
2009-10-29 15:49 Shane Dixon New Issue
2009-10-29 16:38 Alex Neundorf Status new => assigned
2009-10-29 16:38 Alex Neundorf Assigned To => Alex Neundorf
2009-11-22 12:32 Alex Neundorf Note Added: 0018530
2009-11-22 12:33 Alex Neundorf Note Added: 0018531
2009-11-22 12:44 Alex Neundorf File Added: Linux.cmake
2009-11-22 12:45 Alex Neundorf Note Added: 0018532
2009-12-01 14:23 Brad King Relationship added child of 0009985
2009-12-01 14:24 Brad King Relationship replaced related to 0009985
2009-12-01 14:26 Brad King Note Added: 0018626
2009-12-01 14:26 Brad King Status assigned => closed
2009-12-01 14:26 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team