[CMake] Segfault for the Blackberry 10 build (devalpha device)

Laszlo Papp lpapp at kde.org
Wed Jan 16 18:57:04 EST 2013


This is my latest toolchain file version:
http://quickgit.kde.org/?p=scratch%2Flpapp%2Fwikireader.git&a=blob&h=5c6c4dbda324a8285f99115c3de7d45e441d47ca&hb=f296afed1993d7c28edd5f9adcfd41465667d823&f=frontends%2Fblackberry%2Fcmake%2FToolchain-QNX-8.0.0.cmake

At least, it is clear now what I should achieve, but the CMAKE_C(XX)_FLAGS*
do not seem to work as I would expect them to.

On Wed, Jan 16, 2013 at 11:20 PM, Laszlo Papp <lpapp at kde.org> wrote:

> Hi Bill!
>
> This works: echo "int main() { return 0; }" > main.cpp && qcc
> -Vgcc_ntoarmv7le main.cpp -l QtCore -L
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/ -o cmake-test
>
> This does not work: echo "int main() { return 0; }" > main.cpp &&
> ntoarmv7-g++ main.cpp -lQtCore
> -L/opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/ -o cmake-test
>
> This is the qcc documentation which is just a wrapper around the
> preprocessor, compiler, linker, and assembler:
>
>
> http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.neutrino.utilities/topic/q/qcc.html
>
> Now I am getting this:
>
> cd /home/lpapp/Projects/qt/wikireader/build/frontends/blackberry &&
> /usr/bin/cmake -E cmake_link_script CMakeFiles/wikireader.dir/link.txt
> --verbose=1
> /opt/bbndk/host_10_0_9_404/linux/x86/usr/bin/qcc   -Wall -fPIC
> CMakeFiles/wikireader.dir/main.cpp.o
> CMakeFiles/wikireader.dir/wikimodel.cpp.o
> CMakeFiles/wikireader.dir/qrc_wikireader.cxx.o
> CMakeFiles/wikireader.dir/wikireader_automoc.cpp.o  -o wikireader
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtCore.so
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtNetwork.so
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtXml.so
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtGui.so
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtDeclarative.so
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/libbbcascades.so
> -Wl,-rpath,/opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib:/opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib
>
> /opt/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/qt4/lib/libQtCore.so:
> could not read symbols: File in wrong format
> cc: /opt/bbndk/host_10_0_9_404/linux/x86/usr/bin/ntox86-ld error 1
> make[2]: *** [frontends/blackberry/wikireader] Error 1
> make[2]: Leaving directory `/home/lpapp/Projects/qt/wikireader/build'
> make[1]: *** [frontends/blackberry/CMakeFiles/wikireader.dir/all] Error 2
> make[1]: Leaving directory `/home/lpapp/Projects/qt/wikireader/build'
> make: *** [all] Error 2
>
> For some reason, "-Vgcc_ntoarmv7le" does not take any effect in the
> toolchain file. Do you have an idea why that could happen? Should I use
> "CMAKE_EXE_LINKER_FLAGS" or something else? -Wl would be the linker for
> qcc, and "ntox86-ld" is the wrong one, not the arm variant.
>
> Laszlo
>
>
> On Wed, Jan 16, 2013 at 9:40 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:
>
>> On 1/16/2013 4:05 PM, Laszlo Papp wrote:
>>
>>> At least I cannot reproduce the crash with the following skeleton:
>>>
>>>  You should look at the compile/link lines.   First I would look at the
>> link lines:
>>
>> This is the qmake one:
>>
>> qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,/home/taylor/**
>> Development/bbndk/target_10_0_**9_2318/qnx6/armle-v7/lib
>> -Wl,-rpath-link,/home/taylor/**Development/bbndk/target_10_0_**9_2318/qnx6/armle-v7/usr/lib
>> -Wl,-rpath-link,/home/taylor/**Development/bbndk/target_10_0_**
>> 9_2318/qnx6/armle-v7/usr/lib/**qt4/lib -o o.le-v7-g/WikiReader
>> o.le-v7-g/.obj/main.o o.le-v7-g/.obj/wikimodel.o
>> o.le-v7-g/.obj/moc_wikimodel.o -L/home/taylor/Development/**
>> bbndk/target_10_0_9_2318/qnx6/**armle-v7/lib -L/home/taylor/Development/*
>> *bbndk/target_10_0_9_2318/qnx6/**armle-v7/usr/lib
>> -L/home/taylor/Development/**bbndk/target_10_0_9_2318/qnx6/**armle-v7/usr/lib/qt4/lib
>> -L/home/taylor/Development/**bbndk/target_10_0_9_2318/qnx6/**/usr/lib/qt4/lib
>> -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lsqlite3 -lz
>> -lQtXmlPatterns -lQtGui -lQtXml -lQtNetwork -lsocket -lQtCore -lm -lbps
>>
>>
>> This is the cmake one:
>>
>> /opt/bbndk/host_10_0_9_404/**linux/x86/usr/bin/ntoarmv7-c++   -Wall
>> -fPIC -Wall -fPIC -g3 -ggdb -O0    CMakeFiles/wikireader.dir/**main.cpp.o
>> CMakeFiles/wikireader.dir/**wikimodel.cpp.o
>> CMakeFiles/wikireader.dir/qrc_**wikireader.cxx.o
>> CMakeFiles/wikireader.dir/**wikireader_automoc.cpp.o  -o wikireader
>> /opt/bbndk/target_10_0_9_1673/**qnx6/armle-v7/usr/lib/qt4/lib/**libQtCore.so
>> /opt/bbndk/target_10_0_9_1673/**qnx6/armle-v7/usr/lib/qt4/lib/**libQtNetwork.so
>> /opt/bbndk/target_10_0_9_1673/**qnx6/armle-v7/usr/lib/qt4/lib/**libQtXml.so
>> /opt/bbndk/target_10_0_9_1673/**qnx6/armle-v7/usr/lib/qt4/lib/**libQtGui.so
>> /opt/bbndk/target_10_0_9_1673/**qnx6/armle-v7/usr/lib/qt4/lib/**libQtDeclarative.so
>> -lbbcascades -Wl,-rpath,/opt/bbndk/target_**
>> 10_0_9_1673/qnx6/armle-v7/usr/**lib/qt4/lib
>>
>>
>>
>> Right off the bat they are using different compilers to link.   I would
>> try to get the CMake one to match the qmake one by hand and see if you can
>> fix the problem.  Once you figure out the magic command line that makes it
>> work, then we can figure out how to get CMake to produce the same command
>> line.
>>
>> BTW, same thing with the compile lines.  CMake does c++ and qmake does
>> gcc -lang-c++.
>>
>>
>>    cat ../../cmake-test/main.cpp
>>> int main() {return 0;}
>>> cat ../../cmake-test/CMakeLists.**txt
>>> add_executable(cmake-test main.cpp)
>>>
>>> I am running out of the quick ideas soon. Anything else to try?
>>>
>>> On Wed, Jan 16, 2013 at 2:12 PM, Laszlo Papp <lpapp at kde.org
>>> <mailto:lpapp at kde.org>> wrote:
>>>
>>>     Interesting finding! It happened to PySide as well on this platform
>>>     which may help with proceeding:
>>>     http://www.engcorp.com/**pipermail/blackberry-python/**
>>> 2013/000016.html<http://www.engcorp.com/pipermail/blackberry-python/2013/000016.html>
>>>
>>>
>>>     On Wed, Jan 16, 2013 at 10:31 AM, Laszlo Papp <lpapp at kde.org
>>>     <mailto:lpapp at kde.org>> wrote:
>>>
>>>         I have just tried to add the following libraries to the linkage
>>>         even if they seem unnecessary: -lz -lsocket -lm -lbps, but it is
>>>         still crashing. :'(
>>>
>>>         I have also tried to save out the wikireader.core file of mine,
>>>         and run through an arm gdb on the host, but it did not provide
>>>         too much information sadly even with a debug build:
>>>
>>>         (gdb) core wikireader.core
>>>         [New LWP 1]
>>>         Program terminated with signal 11, Segmentation fault.
>>>         #0  0x01d27380 in ?? ()
>>>         (gdb) thread apply all bt
>>>
>>>         Thread 1 (LWP 1):
>>>         #0  0x01d27380 in ?? ()
>>>         #1  0x00000000 in ?? ()
>>>         (gdb)
>>>
>>>         How can we proceed?
>>>
>>>         Laszlo
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/**
>>> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>>>
>>>
>>
>> --
>> Bill Hoffman
>> Kitware, Inc.
>> 28 Corporate Drive
>> Clifton Park, NY 12065
>> bill.hoffman at kitware.com
>> http://www.kitware.com
>> 518 881-4905 (Direct)
>> 518 371-3971 x105
>> Fax (518) 371-4573
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/**
>> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130116/f35e51d2/attachment-0001.htm>


More information about the CMake mailing list