zezer3 / cmaked2

Automatically exported from code.google.com/p/cmaked2
0 stars 0 forks source link

make fails with gdc #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd cmaked2/tests
2. mkdir build
3. cd build
4. cmake ..
5. make
What is the expected output? What do you see instead?

See below...

What version of the product are you using? On what operating system?
cmake version 2.8.6
Linux 3.1.0-4-ARCH #1 SMP PREEMPT Mon Nov 7 22:47:18 CET 2011 x86_64 Intel(R) 
Core(TM) i7 CPU 860 @ 2.80GHz GenuineIntel GNU/Linux
gdc (GCC) 4.5.1 20100731 (gdc 0.30, using dmd 2.055)

Please provide any additional information below.
[gour@atmarama build] cmake ..
-- The C compiler identification is GNU
-- The D compiler identification is unknown
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID = 
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Enter Linux-gdc.cmake
**** Debug Info: Exit Linux-gdc.cmake
**** Debug Info: Exit CMakeDInformation.cmake
-- Check for working D compiler: /usr/bin/gdc
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID = 
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Enter Linux-gdc.cmake
**** Debug Info: Exit Linux-gdc.cmake
**** Debug Info: Exit CMakeDInformation.cmake
-- Check for working D compiler: /usr/bin/gdc -- works
-- Detecting D compiler ABI info
**** Debug Info: Enter CMakeDInformation.cmake
**** Debug Info: CMAKE_SYSTEM_NAME = Linux
**** Debug Info: CMAKE_D_COMPILER_ID = 
**** Debug Info: CMAKE_BASE_NAME = gdc
**** Debug Info: Enter Linux-gdc.cmake
**** Debug Info: Exit Linux-gdc.cmake
**** Debug Info: Exit CMakeDInformation.cmake
-- Detecting D compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: 
/home/gour/repos/external/cmaked2/tests/build
[gour@atmarama build] make
Scanning dependencies of target lib_1
[ 10%] Building D object lib_1/CMakeFiles/lib_1.dir/lib_1
Linking D static library liblib_1.a
[ 10%] Built target lib_1
Scanning dependencies of target lib_2
[ 20%] Building C object lib_2/CMakeFiles/lib_2.dir/lib_2.o
Linking C static library liblib_2.a
[ 20%] Built target lib_2
Scanning dependencies of target app_1
[ 30%] Building D object app_1/CMakeFiles/app_1.dir/app_1
Linking D executable app_1
[ 30%] Built target app_1
Scanning dependencies of target app_2
[ 40%] Building D object app_2/CMakeFiles/app_2.dir/app_2
Linking D executable app_2
[ 40%] Built target app_2
Scanning dependencies of target app_3
[ 50%] Building D object app_3/CMakeFiles/app_3.dir/app_3
Linking D executable app_3
[ 50%] Built target app_3
Scanning dependencies of target app_5
[ 60%] Building D object app_5/CMakeFiles/app_5.dir/app_5
[ 70%] Building C object app_5/CMakeFiles/app_5.dir/cfunc.o
Linking D executable app_5
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(obje
ct_.o): In function `rt_attachDisposeEvent':
(.text+0x41c1): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv':
(.text+0x51c): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `rt_init':
(.text+0x9f3): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `rt_term':
(.text+0xa93): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `main':
(.text+0xbc2): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(life
time.o):(.text+0x1306): more undefined references to `_Unwind_Resume' follow
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function `_d_throw':
(.text+0x10e): undefined reference to `_Unwind_RaiseException'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh17parse_lsda_headerFPS3gcc14unwind_generic15_Unwind_ContextPhPS3gcc3d
eh16lsda_header_infoZPh':
(.text+0x15d): undefined reference to `_Unwind_GetRegionStart'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x2d3): undefined reference to `_Unwind_GetLanguageSpecificData'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x336): undefined reference to `_Unwind_GetIP'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x48e): undefined reference to `_Unwind_SetGR'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x49e): undefined reference to `_Unwind_SetGR'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x4a9): undefined reference to `_Unwind_SetIP'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaGetRvalue':
(.text+0x18c): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaIn':
(.text+0x296): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaDel':
(.text+0x3b6): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaGet':
(.text+0x7fc): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dema
ngle.o): In function `_D4core8demangle8Demangle25mayBeTemplateInstanceNameMFZb':
(.text+0x3a6a): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dema
ngle.o):(.text+0x4d5c): more undefined references to `_Unwind_Resume' follow
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xc8): undefined reference to `_Unwind_GetRegionStart'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xd8): undefined reference to `_Unwind_GetTextRelBase'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xe8): undefined reference to `_Unwind_GetDataRelBase'
make[2]: *** [app_5/app_5] Error 1
make[1]: *** [app_5/CMakeFiles/app_5.dir/all] Error 2
make: *** [all] Error 2

Sincerely,
Gour

p.s. It works with dmd-2.0.56

Original issue reported on code.google.com by ggd...@gmail.com on 24 Nov 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Maybe it's a gdc bug. You can run make VERBOSE=on to see the commands that are 
actually executed.
Maybe linking against rt is missing. Since it's a linker error I suppose it 
must be some missing library.
Can you check?

Original comment by jens.k.mueller@gmail.com on 24 Nov 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Linking D executable app_5
cd /home/gour/repos/external/cmaked2/tests/build/app_5 && /usr/bin/cmake -E 
cmake_link_script CMakeFiles/app_5.dir/link.txt --verbose=on
/usr/bin/gdc   -w  CMakeFiles/app_5.dir/app_5 CMakeFiles/app_5.dir/cfunc.o 
-oapp_5  -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2 -lc  
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(obje
ct_.o): In function `rt_attachDisposeEvent':
(.text+0x41c1): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv':
(.text+0x51c): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `rt_init':
(.text+0x9f3): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `rt_term':
(.text+0xa93): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dmai
n2.o): In function `main':
(.text+0xbc2): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(life
time.o):(.text+0x1306): more undefined references to `_Unwind_Resume' follow
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function `_d_throw':
(.text+0x10e): undefined reference to `_Unwind_RaiseException'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh17parse_lsda_headerFPS3gcc14unwind_generic15_Unwind_ContextPhPS3gcc3d
eh16lsda_header_infoZPh':
(.text+0x15d): undefined reference to `_Unwind_GetRegionStart'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x2d3): undefined reference to `_Unwind_GetLanguageSpecificData'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x336): undefined reference to `_Unwind_GetIP'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x48e): undefined reference to `_Unwind_SetGR'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x49e): undefined reference to `_Unwind_SetGR'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(deh.
o): In function 
`_D3gcc3deh15personalityImplFiT3gcc14unwind_generic14_Unwind_ActionbPS3gcc14unwi
nd_generic17_Unwind_ExceptionPS3gcc14unwind_generic15_Unwind_ContextZk':
(.text+0x4a9): undefined reference to `_Unwind_SetIP'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaGetRvalue':
(.text+0x18c): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaIn':
(.text+0x296): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaDel':
(.text+0x3b6): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(aaA.
o): In function `_aaGet':
(.text+0x7fc): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dema
ngle.o): In function `_D4core8demangle8Demangle25mayBeTemplateInstanceNameMFZb':
(.text+0x3a6a): undefined reference to `_Unwind_Resume'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(dema
ngle.o):(.text+0x4d5c): more undefined references to `_Unwind_Resume' follow
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xc8): undefined reference to `_Unwind_GetRegionStart'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xd8): undefined reference to `_Unwind_GetTextRelBase'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib64/libgphobos2.a(unwi
nd_pe.o): In function 
`_D3gcc9unwind_pe21base_of_encoded_valueFhPS3gcc14unwind_generic15_Unwind_Contex
tZm':
(.text+0xe8): undefined reference to `_Unwind_GetDataRelBase'
make[2]: *** [app_5/app_5] Error 1
make[2]: Leaving directory `/home/gour/repos/external/cmaked2/tests/build'
make[1]: *** [app_5/CMakeFiles/app_5.dir/all] Error 2
make[1]: Leaving directory `/home/gour/repos/external/cmaked2/tests/build'
make: *** [all] Error 2

Original comment by ggd...@gmail.com on 24 Nov 2011 at 8:52

GoogleCodeExporter commented 9 years ago
From above
/usr/bin/gdc   -w  CMakeFiles/app_5.dir/app_5 CMakeFiles/app_5.dir/cfunc.o 
-oapp_5  -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2 -lc

I think there is a -lrt missing.
Can you just add it and see what you get.
I'm unsure about who is responsible for adding this -lrt. Because technically 
it's needed for phobos. For example dmd does it itself (see its dmd.conf).
So is gdc supposed to add it or are we?

Original comment by jens.k.mueller@gmail.com on 24 Nov 2011 at 9:01

GoogleCodeExporter commented 9 years ago
I found the problem:

-L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2

is wrong since it points to my system gcc and not the one on which gdc was 
built.

Changing the above to:

-L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/

solved the issue. ;)

However, I'm not sure what should be changed to pick theright gdc?

Otoh, I believe, that for now I can test with dmd only and proceed with the 
steps of integrating cmake2d into upstream...

Original comment by ggd...@gmail.com on 25 Nov 2011 at 2:32

GoogleCodeExporter commented 9 years ago
This is interesting. That means cmaked2 picked up the wrong path.
But gdc used to work. At least I added somebody's report to
http://code.google.com/p/cmaked2/wiki/TestedPlatforms some ago.

Thanks. I'll look into this.

Original comment by jens.k.mueller@gmail.com on 25 Nov 2011 at 6:00