I adding to my project (MiniMyth2) additional targets: arm and aarch64 (MiniMyth2 uses cross-compile to build mythtv appliance for given platform).
I have nicely cross-compiling (and working appliance) for: i386, x86_64 and aarch64.
All targets are built with exactly the same packages, build system, makefiles, etc. To select target I'm changing only: cross-compilation target string and gcc/ld flags.
This works Ok for i386, x86_64 and aarch64 - but not for ARM target.
On ARM however I have many packages failing with libtool relinking. Usually failure looks like this:
make[11]: Entering directory `/home/piotro/minimyth-dev/script/gtk/glib/work/main.d/glib-2.53.1/gmodule'
//home/piotro/minimyth-dev/images/build/usr/bin/mkdir -p '/home/piotro/minimyth-dev/images/main/usr/lib'
//home/piotro/minimyth-dev/images/build/bin/bash ../libtool --mode=install //home/piotro/minimyth-dev/images/build/usr/bin/install -c libgmodule-2.0.la '/home/piotro/minimyth-dev/images/main/usr/lib'
libtool: warning: relinking 'libgmodule-2.0.la'
libtool: install: (cd /home/piotro/minimyth-dev/script/gtk/glib/work/main.d/glib-2.53.1/gmodule; //home/piotro/minimyth-dev/images/build/bin/bash "/home/piotro/minimyth-dev/script/gtk/glib/work/main.d/glib-2.53.1/libtool" --tag CC --mode=relink armv7a-minimyth-linux-gnueabihf-gcc -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format=2 -Werror=missing-include-dirs -fvisibility=hidden -pipe -pipe -march=armv7-a -O2 -flto -Wl,-Bsymbolic-functions -Wl,-z,nodelete -Wl,--export-dynamic -version-info 5301:0:5301 -export-dynamic -Wl,--as-needed -pipe -pipe -march=armv7-a -O2 -flto -o libgmodule-2.0.la -rpath /usr/lib libgmodule_2_0_la-gmodule.lo -ldl ../glib/libglib-2.0.la -inst-prefix-dir /home/piotro/minimyth-dev/images/main)
libtool: relink: armv7a-minimyth-linux-gnueabihf-gcc -shared -fPIC -DPIC .libs/libgmodule_2_0_la-gmodule.o -ldl -L/home/piotro/minimyth-dev/images/main/usr/lib -L/usr/lib -lglib-2.0 -lpcre -lpthread -march=armv7-a -O2 -flto -Wl,-Bsymbolic-functions -Wl,-z -Wl,nodelete -Wl,--export-dynamic -Wl,--as-needed -march=armv7-a -O2 -flto -Wl,-soname -Wl,libgmodule-2.0.so.0 -o .libs/libgmodule-2.0.so.0.5301.0
/usr/lib/libgcc_s.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
libtool: error: error: relink 'libgmodule-2.0.la' with the above command before installing it
make[11]: *** [install-libLTLIBRARIES] Error 1
Of course /usr/lib/libgcc_s.so will be not recognised as it is for x86_64 architecture (my OS on which I'm cross-compiling is x86_64) while target is ARM.
But: Why libtool relinking is looking for /usr/lib/libgcc_s.so durring durring relinking on ARM target - but not on i386, x86_64 and aarch64 targets?
Only difference between targets in my cross-building process are: target string and gcc/ld flags:
NAME: cross-compilation target (in glibc, etc):
c3 -> i586-minimyth-linux-gnu
c3-2 -> i586-minimyth-linux-gnu
pentium-mmx -> i586-minimyth-linux-gnu
atom -> x86_64-minimyth-linux-gnu
x86-64 -> x86_64-minimyth-linux-gnu
armv7 -> armv7a-minimyth-linux-gnueabihf
armv8 -> aarch64-minimyth-linux-gnu
gcc/ld lfags:
c3 -> -march=atom -mtune=atom -O2 -mfpmath=sse -ftree-vectorize -mmovbe
c3-2 -> -march=c3-2 -mtune=c3-2 -Os -mfpmath=sse
pentium-mmx -> -march=pentium-mmx -mtune=generic -Os
atom -> -march=atom -mtune=atom -O2 -mfpmath=sse -ftree-vectorize -mmovbe
x86-64 -> -march=x86-64 -mtune=generic -O3 -mfpmath=sse
armv7 -> -march=armv7-a -O2
armv8 -> -march=armv8-a -O2
and gcc common for all: -pipe -flto
ld common for all: -Wl,--as-needed -pipe -flto
Rest (packages, makefiles, etc are exactly the same)
gcc is 7.3.0, glibc is 2.27, binutils are 2.28.1