Cross compiling Qt 4.7.4 with directfb support for SH4 on 64 bit platform



  • Hello.

    I am trying to cross compile Qt for sh4 on 64 bit platform. I created file mkspecs/qws/linux-sh4-g++/qmake.conf:

    @include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    modifications to g++.conf

    QMAKE_CC = sh4-linux-gcc
    QMAKE_CXX = sh4-linux-g++
    QMAKE_LINK = sh4-linux-g++
    QMAKE_LINK_SHLIB = sh4-linux-g++
    QMAKE_CFLAGS_RELEASE = -Os
    QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
    QMAKE_LIBDIR = /opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib

    modifications to linux.conf

    QMAKE_AR = sh4-linux-ar cqs
    QMAKE_OBJCOPY = sh4-linux-objcopy
    QMAKE_RANLIB = sh4-linux-ranlib

    QT_CFLAGS_DIRECTFB = -I/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include/directfb -D_REENTRANT
    QT_LIBS_DIRECTFB = -L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -ldirect -ldirectfb -lfusion

    QMAKE_STRIP = sh4-linux-strip

    load(qt_config)@

    and file mkspecs/qws/linux-sh4-g++/qplatformdefs.h:

    @#include "../../linux-g++/qplatformdefs.h"@

    After configuring with such string

    @PKG_CONFIG=which pkg-config PKG_CONFIG_PATH=/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib/pkgconfig ./configure --prefix=/opt/STM/STLinux-2.3/devkit/sh4/sh4-linux/usr/qt-4.7.4 -platform qws/linux-x86_64-g++ -embedded sh4 -little-endian -xplatform qws/linux-sh4-g++ -qt-gfx-directfb -opensource -confirm-license -no-qt3support -no-webkit -no-javascript-jit -no-script -no-scripttools -qt-zlib -qt-gif -no-libtiff -qt-libpng -no-libmng -qt-libjpeg -system-freetype -nomake examples -nomake demos -no-declarative -force-pkg-config@

    with "-platform" option or without it, I ran "make" and got error

    @...
    g++ -c -pipe -m64 -fno-exceptions -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/qws/linux-x86_64-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -I../../3rdparty/zlib -o .obj/release-static-emb-sh4/qxml.o ../../xml/sax/qxml.cpp
    g++ -c -pipe -m64 -fno-exceptions -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/qws/linux-x86_64-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -I../../3rdparty/zlib -o .obj/release-static-emb-sh4/qfsfileengine_unix.o ../../corelib/io/qfsfileengine_unix.cpp
    g++ -c -pipe -m64 -fno-exceptions -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/qws/linux-x86_64-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -I../../3rdparty/zlib -o .obj/release-static-emb-sh4/qfsfileengine_iterator_unix.o ../../corelib/io/qfsfileengine_iterator_unix.cpp
    /opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-gcc -c -pipe -m64 -fno-exceptions -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/qws/linux-x86_64-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -I../../3rdparty/zlib -o .obj/release-static-emb-sh4/adler32.o ../../3rdparty/zlib/adler32.c
    cc1: error: unrecognized command line option "-m64"
    make[1]: *** [.obj/release-static-emb-sh4/adler32.o] Error 1
    @

    Why "-m64" option was added for sh4-linux-gcc? What's wrong? Can somebody help me?



  • I found error in the file src/tools/bootstrap/Makefile, where CC variable was set as sh4-linux-gcc, not gcc. After correction it works.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.