qt - qmake adds /usr/lib absolute path when cross compiling -


i need cross compile qt app arm. do:

export sdk_mxc_path="/path/to/sdk" export qmakespec="${sdk_mxc_path}/usr/mkspecs/devices/linux-imx6-g++/" export sdk_mxc_bin="${sdk_mxc_path}/toolchain/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/" export qmake="${sdk_mxc_bin}/qmake" export path="${sdk_mxc_bin}:${path}"  ${qmake} -spec ${qmakespec}  make 

the mkspec file seems fine:

include(../common/linux_device_pre.conf)  eglfs_platform_hooks_sources = $$pwd/qeglfshooks_imx6.cpp  qmake_incdir           += $(sdk_mxc_path)/usr/include qmake_libdir           += $(sdk_mxc_path)/usr/lib  qmake_libs_egl         += -legl -l$(sdk_mxc_path)/usr/lib qmake_libs_opengl_es2  += -lglesv2 -legl -lgal -l$(sdk_mxc_path)/usr/lib qmake_libs_openvg      += -lopenvg -legl -lgal -l$(sdk_mxc_path)/usr/lib qmake_libdir_opengl_es2 = $(sdk_mxc_path)/usr/lib  qmake_lflags           += -wl,-rpath-link=$(sdk_mxc_path)/usr/lib qmake_cflags_release   += -dlinux=1 -degl_api_fb=1 -o3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer qmake_cxxflags_release += -dlinux=1 -degl_api_fb=1 -o3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer  include(../common/linux_device_post.conf)  load(qt_config) 

linking fails, error:

arm-none-linux-gnueabi-g++ -c -pipe -o2 -dlinux=1 -degl_api_fb=1 -o3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer -wall -w -d_reentrant -fpie -dqt_no_debug -dqt_widgets_lib -dqt_gui_lib -dqt_core_lib -i../../path/to/sdk/usr/mkspecs/devices/linux-imx6-g++ -i. -i../../path/to/sdk/usr/include -i../../path/to/sdk/usr/include/qtwidgets -i../../path/to/sdk/usr/include/qtgui -i../../path/to/sdk/usr/include/qtcore -i. -i/path/to/sdk/usr/include -o main.o main.cpp arm-none-linux-gnueabi-g++ -wl,-rpath-link=/path/to/sdk/usr/lib -wl,-o1 -wl,-rpath,/usr/lib -o qt-hello main.o   -l/path/to/sdk/usr/lib -l/path/to/sdk/usr/lib -lqt5widgets -l/usr/lib -lqt5gui -lqt5core -lglesv2 -legl -lgal -lpthread  /usr/lib/libc_nonshared.a: not read symbols: file format not recognized collect2: ld returned 1 exit status makefile:183: recipe target 'qt-hello' failed make: *** [qt-hello] error 1 

i guess because trying search libraries in /usr/lib

if manually call linker, removing -l/usr/lib works , executable can run on target. command below works, notice i've removed -l/usr/lib

arm-none-linux-gnueabi-g++ -wl,-rpath-link=/path/to/sdk/usr/lib -wl,-o1 -wl,-rpath,/usr/lib -o qt-hello main.o   -l/path/to/sdk/usr/lib -l/path/to/sdk/usr/lib -lqt5widgets -lqt5gui -lqt5core -lglesv2 -legl -lgal -lpthread 

what can make qmake working expected? don't want link manually or edit makefile each time generated qmake.

just having same problem w/ compiling qt - seems affect calls mesa. mesa's .pc files okay.

otoh, qt creates broken .pc files. looking @ monstrous makefile generator code, seems ever understood pkg-config handles dependencies on it's own - iow: missed whole point. (well, still didn't understand make either).

yet old story - still not @ suited embedded systems.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -