title: qmake adds /usr/lib absolute path when cross compiling
body: <p>I need to cross compile a Qt app for arm. This is what I do:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The mkspec file seems to be fine:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Linking fails, with this error:</p>
  
  <pre><code>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: could not read symbols: File format not recognized
  collect2: ld returned 1 exit status
  Makefile:183: recipe for target 'qt-hello' failed
  make: *** [qt-hello] Error 1
  </code></pre>
  
  <p>I guess because it is trying to search libraries in /usr/lib</p>
  
  <p>If I manually call the linker, removing <code>-L/usr/lib</code> it works and the executable can run on my target. The command below works, notice that I've removed <code>-L/usr/lib</code></p>
  
  <pre><code>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
  </code></pre>
  
  <p>What can I do make <code>qmake</code> working as expected? I don't want to link manually or edit the Makefile each time it is generated by qmake.</p>