I tried your first advice, that is hide the libicu taken from the Raspberry, and actually it says at configure time that doesn't find any icu, so the custom ones are not taken into consideration at all.
Everytime I try to compile with custom icu the log file is
looking for library icu
Trying source 0 (type inline) of library icu ...
=> source failed condition 'config.win32 && !features.shared'.
Trying source 1 (type inline) of library icu ...
=> source failed condition 'config.win32 && features.shared'.
Trying source 2 (type inline) of library icu ...
cd /home/quantum/RaspberryPi3/qt-5.9/sources2/config.tests/unix/icu && PKG_CONFIG_SYSROOT_DIR=/home/quantum/RaspberryPi3/sysroot PKG_CONFIG_LIBDIR=/home/quantum/RaspberryPi3/sysroot/usr/lib/pkgconfig:/home/quantum/RaspberryPi3/sysroot/usr/share/pkgconfig:/home/quantum/RaspberryPi3/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console single_arch" "QMAKE_CFLAGS += --sysroot=/home/quantum/RaspberryPi3/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/quantum/RaspberryPi3/sysroot" "QMAKE_LFLAGS += --sysroot=/home/quantum/RaspberryPi3/sysroot" -early "CONFIG += cross_compile" 'LIBS += -L/home/quantum/RaspberryPi3/libicu60/build-icu-rpi/icu-build/lib -licui18n -licuuc -licudata' 'INCLUDEPATH *= /home/quantum/RaspberryPi3/libicu60/build-icu-rpi/icu-build/include' 'LIBS += -ldl' /home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/config.tests/unix/icu
cd /home/quantum/RaspberryPi3/qt-5.9/sources2/config.tests/unix/icu && MAKEFLAGS= /usr/bin/make
/home/quantum/RaspberryPi3/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/quantum/RaspberryPi3/sysroot --sysroot=/home/quantum/RaspberryPi3/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I/home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/config.tests/unix/icu -I. -I/home/quantum/RaspberryPi3/libicu60/build-icu-rpi/icu-build/include -I/home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o icu.o /home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/config.tests/unix/icu/icu.cpp
/home/quantum/RaspberryPi3/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/quantum/RaspberryPi3/sysroot --sysroot=/home/quantum/RaspberryPi3/sysroot -Wl,-O1 -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/opt/vc/lib -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/lib/arm-linux-gnueabihf -o icu icu.o -L/home/quantum/RaspberryPi3/libicu60/build-icu-rpi/icu-build/lib -licui18n -licuuc -licudata -ldl
=> source accepted.
that is, at the end of the day, it always picks the Raspberry ones.
I tried recompiling the icu taking the architecture options directly from the Qt setup,
CPPFLAGS="-O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=1 -fno-short-enums -pipe -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard"
but Qt ignores them as well.
Now I'm using the Qt cross-compiled with -no-icu, and they work just fine (no qtwebengine though), but I would like to solve it as well.
This is the part where the make crashes
/home/quantum/RaspberryPi3/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/quantum/RaspberryPi3/sysroot -Wl,--gc-sections -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../lib -Wl,-rpath-link,/home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/lib -Wl,-rpath-link,/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialport/lib -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/opt/vc/lib -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/quantum/RaspberryPi3/sysroot/lib/arm-linux-gnueabihf -o ../../../bin/canbusutil .obj/main.o .obj/readtask.o .obj/canbusutil.o .obj/sigtermhandler.o .obj/moc_readtask.o .obj/moc_canbusutil.o .obj/moc_sigtermhandler.o -L/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialbus/lib -lQt5SerialBus -L/home/quantum/RaspberryPi3/qt-5.9/sources2/qtbase/lib -lQt5Core -lpthread
/home/quantum/RaspberryPi3/sysroot/usr/lib/arm-linux-gnueabihf/libicui18n.so.57: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
collect2: error: ld returned 1 exit status
Makefile:92: recipe for target '../../../bin/canbusutil' failed
make[4]: *** [../../../bin/canbusutil] Error 1
make[4]: Leaving directory '/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialbus/src/tools/canbusutil'
Makefile:44: recipe for target 'sub-canbusutil-make_first' failed
make[3]: *** [sub-canbusutil-make_first] Error 2
make[3]: Leaving directory '/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialbus/src/tools'
Makefile:97: recipe for target 'sub-tools-make_first' failed
make[2]: *** [sub-tools-make_first] Error 2
make[2]: Leaving directory '/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialbus/src'
Makefile:46: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/home/quantum/RaspberryPi3/qt-5.9/sources2/qtserialbus'
Makefile:230: recipe for target 'module-qtserialbus-make_first' failed
make: *** [module-qtserialbus-make_first] Error 2
I will try to recompile the icu with different options.